How to save all figure as jpeg format in folder?
35 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Image Analyst
el 11 de Mzo. de 2017
Editada: Image Analyst
el 11 de Mzo. de 2017
Use export_fig() and put it inside, not outside, your for loop.
3 comentarios
Image Analyst
el 12 de Mzo. de 2017
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);
Mei Synn Tan
el 13 de Mzo. de 2017
Editada: Mei Synn Tan
el 13 de Mzo. de 2017
Ver también
Categorías
Más información sobre Feature Detection and Extraction en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!