Reading images from a folder ony by one
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi I have folder with bunch of images I am trying to read the images one by one from that folder, using imread command, any ideas how to do that? will appreciate thanks
댓글 수: 0
답변 (2개)
Honglei Chen
2012년 2월 15일
You can use dir and filter out the files you need, for example, let's say you want to read in all the jpg files in the folder 'myimage'.
files = dir('myimage');
for m = 1:numel(files)
if strcmp(files(m).name(end-3:end),'.jpg')
x = imread(file(m).name,'jpg');
% process x
end
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!