我用来存储图像的代码(函数)是:
function X = ReadImgs(Folder,ImgType)
Imgs = dir([Folder '/' ImgType]);
NumImgs = size(Imgs,1);
image = double(imread([Folder '/' Imgs(1).name]));
X = zeros([NumImgs size(image)]);
for i=1:NumImgs,
image = double(imread([Folder '/' Imgs(i).name]));
if (size(image,3) == 1)
X(i,:,:) = image;
else
X(i,:,:,:) = image;
end
end
ImageData = ReadImgs('sample images','*.jpg');
我无法一次检索一张图像。Matlab专家请帮助..