Not able to read all the images into matlab
1 回表示 (過去 30 日間)
古いコメントを表示
clear all
clc
folder = 'C:/all_video_frames/';
filename = dir(fullfile(folder, '*.jpg'));
for i = 1:numel(filename)
f=fullfile(folder,filename(i).name);
img=imread(f);
figure(1),imshow(img)
gray_image = rgb2gray(img);
figure(2), imshow(gray_image)
resized_image=imresize(gray_image,[25,25]);
figure(3),imshow(resized_image)
path=strcat('C:/images25/', filename(i).name);
imwrite(resized_image, path);
end
Read images folder has images like:
Subject1-Frame1.jpg, Subject2-Frame2.jpg so on
Subject2-Frame2.jpg, Subject2-Frame2.jpg so on
Having 40 subjects in total
Output images coming as: Subject1-Frame1.jpg, Subject1-Frame10.jpg, Subject1-Frame100.jpg,Subject2-Frame1000.jpg, Subject1-Frame1001.jpg so on.
Missing many images.
How can I get all the images? Please help.
2 件のコメント
per isakson
2020 年 11 月 9 日
Step through the the script and inspect the values of critical variables. Does folder has the expected value? Etc.
Geoff Hayes
2020 年 11 月 9 日
Parminder - are the images missing or just not appearing in the order that you are expecting? I suspect that you will see files in the order of 1,10,100,1000,1001,....,2,20,200,2000,2001,...., 3,30, 300,3000,3001, ... etc.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!