How to save all figure as jpeg format in folder?
조회 수: 22 (최근 30일)
이전 댓글 표시
srcFiles = dir('C:\Users\fit\Documents\MATLAB\H\*.jpg'); % the folder in which ur images exists
for i = 1 : length(srcFiles)
filename = strcat('C:\Users\fit\Documents\MATLAB\H\',srcFiles(i).name);
I = imread(filename);
I = rgb2gray(I);
I = im2double(I);
origin = I;
regions = detectMSERFeatures(I);
figure; imshow(I); hold on; plot(regions, 'showPixelList', true, 'showEllipses', false);
end
saveas(figurename,' C:\Users\fit\Documents\MATLAB\H'.'jpg')
댓글 수: 0
답변 (1개)
Image Analyst
2017년 3월 11일
편집: Image Analyst
2017년 3월 11일
Use export_fig() and put it inside, not outside, your for loop.
댓글 수: 3
Image Analyst
2017년 3월 12일
Check your filename - is it different each time? Maybe put this after imshow():
drawnow;
Maybe also try closing the figure after you save it
close(f);
참고 항목
카테고리
Help Center 및 File Exchange에서 Feature Detection and Extraction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!