Borrar filtros
Borrar filtros

Not able to read all the images into matlab

1 visualización (últimos 30 días)
Parminder Kaur
Parminder Kaur el 9 de Nov. de 2020
Comentada: Geoff Hayes el 9 de Nov. de 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 comentarios
per isakson
per isakson el 9 de Nov. de 2020
Step through the the script and inspect the values of critical variables. Does folder has the expected value? Etc.
Geoff Hayes
Geoff Hayes el 9 de Nov. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by