Effacer les filtres
Effacer les filtres

Not able to read all the images into matlab

1 vue (au cours des 30 derniers jours)
Parminder Kaur
Parminder Kaur le 9 Nov 2020
Commenté : Geoff Hayes le 9 Nov 2020
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 commentaires
per isakson
per isakson le 9 Nov 2020
Step through the the script and inspect the values of critical variables. Does folder has the expected value? Etc.
Geoff Hayes
Geoff Hayes le 9 Nov 2020
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by