Borrar filtros
Borrar filtros

Problem with batch processing

1 visualización (últimos 30 días)
Chathu
Chathu el 28 de Feb. de 2015
Comentada: Image Analyst el 28 de Feb. de 2015
I want to get all my images(which located in 1 file) processed. This is the code i used(attached,herewith).
1st problem is once the 1st image is processed,how to make it to jump to the next image for processing.
2nd problem is how to change the name of the saved figure at each cycle(eg:S3-Pic1, S3-Pic2, S3
-Pic3 ..etc). Appreciate your feedback.

Respuesta aceptada

Image Analyst
Image Analyst el 28 de Feb. de 2015
Both of these questions are explained well in the FAQ entry: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
  2 comentarios
Chathu
Chathu el 28 de Feb. de 2015
@ Image Analyst-thank you so much for your quick response.Really appreciate it. Everything works out well. Except saving the figure didn't work-pls see one before the last line as follows: hgsave(gcf,'Line detection\S3-Pic(k). How to save figures accordingly?
clc
clear all
myFolder = 'E:\2. Cropped imgs\S3- crops';
if ~isdir(myFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder);
uiwait(warndlg(errorMessage));
return;
end
filePattern = fullfile(myFolder, '*.jpg');
jpegFiles = dir(filePattern);
for k = 1:45
baseFileName = jpegFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
imshow(imageArray); % Display image.
[x,y]=ginput(4); line(x,y)
hold on
[x,y]=ginput(4); line(x,y)
hold on
[x,y]=ginput(4); line(x,y)
hold on
[x,y]=ginput(4); line(x,y)
hgsave(gcf,'Line detection\S3-Pic(k)')
end
Image Analyst
Image Analyst el 28 de Feb. de 2015
Try export_fig() instead. See the File Exchange.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by