Azzera filtri
Azzera filtri

Not able to read all the images into matlab

3 visualizzazioni (ultimi 30 giorni)
Parminder Kaur
Parminder Kaur il 9 Nov 2020
Commentato: Geoff Hayes il 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 Commenti
per isakson
per isakson il 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 il 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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by