how to read images from matlab? matlab image processing

조회 수: 1 (최근 30일)
Sevval Ayse yurtekin
Sevval Ayse yurtekin 2020년 12월 6일
답변: Image Analyst 2020년 12월 6일
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));

답변 (2개)

Ameer Hamza
Ameer Hamza 2020년 12월 6일
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
Sevval Ayse yurtekin
Sevval Ayse yurtekin 2020년 12월 6일
When I try to this example, I get empty set
Ameer Hamza
Ameer Hamza 2020년 12월 6일
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.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2020년 12월 6일

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by