how to read images from matlab? matlab image processing

1 Ansicht (letzte 30 Tage)
Sevval Ayse yurtekin
Sevval Ayse yurtekin am 6 Dez. 2020
Beantwortet: Image Analyst am 6 Dez. 2020
Hello everyone,
I have 322 images. How to read lots of images data from matlab? I can read ony 1 image. Can you help me?
P = 'C:\Users\sy\Desktop\miasdbv1.21\MIASDBv1.21';
D = dir(fullfile(P,'*.pgm'));
C = cell(size(D));
dd = imread(fullfile(P,D(75).name));

Antworten (2)

Ameer Hamza
Ameer Hamza am 6 Dez. 2020
You can write a for-loop and save all the images in a cell array
P = 'C:\Users\sy\Desktop\miasdbv1.21\MIASDBv1.21';
D = dir(fullfile(P,'*.pgm'));
C = cell(size(D));
for i = 1:numel(C)
filename = fullfile(P, D(i).name);
C{i} = imread(filename);
end
  2 Kommentare
Sevval Ayse yurtekin
Sevval Ayse yurtekin am 6 Dez. 2020
When I try to this example, I get empty set
Ameer Hamza
Ameer Hamza am 6 Dez. 2020
Add breakpoints: https://www.mathworks.com/help/matlab/matlab_prog/set-breakpoints.html in your code and see if each line run correctly. You can check if imread() ic correctly loading the pgm files.

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 6 Dez. 2020

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by