我在目录中有一些图像,我想加载所有这些图像进行一些处理.我尝试过使用这个load功能.
imagefiles = dir('F:\SIFT_Yantao\demo-data\*.jpg');
nfiles = length(imagefiles); % Number of files found
for i=1:nfiles
currentfilename=imagefiles(i).name;
I2 = imread(currentfilename);
[pathstr, name, ext] = fileparts(currentfilename);
textfilename = [name '.mat'];
fulltxtfilename = [pathstr textfilename];
load(fulltxtfilename);
descr2 = des2;
frames2 = loc2;
do_match(I1, descr1, frames1, I2, descr2, frames2) ;
end
Run Code Online (Sandbox Code Playgroud)
我收到一个错误,因为无法读取xyz.jpg没有找到这样的文件或目录,其中xyz是我在该目录中的第一个图像.
我还想从目录加载所有格式的图像,而不仅仅是jpg ......我怎么能这样做?