How to save all figure as jpeg format in folder?
34 次查看(过去 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!