我想加载我的图像调用 caltrain,有 30 个 img。我用了代码
对于我 = 0:30
imgINumber = i;
imgPNumber = i+2;
if imgINumber < 10
imgIFile = sprintf('C:\sequence01_caltrain_gray\caltrain/gray/%s00%d.ras',imageName, imageName, imgINumber);
elseif imgINumber < 100
imgIFile = sprintf('C:\sequence01_caltrain_gray\caltrain/gray/%s0%d.ras',imageName, imageName, imgINumber);
end
if imgPNumber < 10
imgPFile = sprintf('C:\sequence01_caltrain_gray\caltrain\gray/%s00%d.ras',imageName, imageName, imgPNumber);
elseif imgPNumber < 100
imgPFile = sprintf('C:\sequence01_caltrain_gray\caltrain\gray/%s0%d.ras',imageName, imageName, imgPNumber);
end
imgI = double(imread(imgIFile));
imgP = double(imread(imgPFile));
imgI = imgI(:,1:352);
imgP = imgP(:,1:352);
但错误:
使用 ==> imread 时出错无法打开文件“C:”进行读取;您可能没有阅读权限。
我需要解决方案谢谢