複数の画像を含むフォルダーがあります。これらの画像をすべて読み込んで個別に処理したいのですが、matlab を使用してそれを行うにはどうすればよいですか? 次のコードを使用してみました。「xyz.jpgを読み取れません。そのようなファイルまたはディレクトリが見つかりません」と表示されます... xyzはそのフォルダーの最初のファイルです。
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