how to load images in order

4 ビュー (過去 30 日間)
Kamyar Mazarei
Kamyar Mazarei 2021 年 4 月 10 日
コメント済み: Kamyar Mazarei 2021 年 4 月 12 日
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

採用された回答

Jan
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
  2 件のコメント
Kamyar Mazarei
Kamyar Mazarei 2021 年 4 月 11 日
thank you for replying
im getting this error:
Error using load
Number of columns on line 6 of ASCII file C:\Users\Nik\Desktop\NNDL-Pr1\English Alphabet\1\1.png must be the same as
previous lines.
Error in DEEPNEW (line 6)
a = load(File);
Kamyar Mazarei
Kamyar Mazarei 2021 年 4 月 12 日
ok i got it
need to use a=imread(File);
thanks man

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by