how to load images in order
1 次查看(过去 30 天)
显示 更早的评论
hi i have 520 images in total
20 images in 26 files
each images is names 1 to 20 and files 1 to 26
i want to load them 1 by 1 and put them in a matrix or process them
im looking for something like this :
for ii=1:26
for jj=1:20
a=load('C:\Users\Nik\Desktop\NNDL-Pr1\English Alphabet\ii\jj.png');
*process codes*
end
end
thank you
0 个评论
采纳的回答
Jan
2021-4-10
Folder = 'C:\Users\Nik\Desktop\NNDL-Pr1\English Alphabet';
for ii=1:26
SubFolder = sprintf('%d', ii);
for jj=1:20
File = fullfile(Folder, SubFolder, sprintf('%d.png', jj));
a = load(File);
...
end
end
See also: FAQ: How to process a sequence of files
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!