How to show all jpg images saved in MATLAB folder?
조회 수: 5 (최근 30일)
이전 댓글 표시
storedStructure = dir('*.jpg')
How should I proceed?
댓글 수: 2
채택된 답변
추가 답변 (4개)
Bjorn Gustavsson
2016년 2월 1일
Perhaps one of the submissions creating thumbnails (into tables guis or the like) found on the file exchange does what you want: Thumbnaily submissions
댓글 수: 0
DGM
2023년 2월 14일
편집: DGM
2023년 2월 24일
(Almost) straight from the docs for montage:
% Create a montage from a series of JPG images in a directory
targetpath = fullfile(matlabroot,'toolbox','images','imdata','*.jpg');
imds = imageDatastore(targetpath);
montage(imds);
Alternatively, without using imageDatastore():
% Create a montage from a series of JPG images in a directory
targetpath = fullfile(matlabroot,'toolbox','images','imdata','*.jpg');
S = dir(targetpath);
allpaths = fullfile({S.folder},{S.name});
montage(allpaths);
In either case, if you want to actually save the output to a new image file, don't use montage(). Use imtile() instead and save the result using imwrite(). Most of the syntax overlaps between the two, so it should be fairly straightforward.
Image Analyst
2016년 2월 1일
This is answered in the second chunk of code in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
