saving series of image
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
rohan
el 24 de Abr. de 2014
Comentada: Image Analyst
el 28 de Abr. de 2014
imwrite(imageArray,'C:\Users\Public\Videos\Sample Videos\pro\New','jpg');
this is my code to read series of image and save it to other directory
however i could not save it properly..
>> for k = 2 : 10
% Get the base file name.
baseFileName = sprintf('img%d.jpg', k);
% Combine it with the folder to get the full filename.
fullFileName = fullfile(folder, baseFileName);
% Read the image file into an array.
imageArray = imread(fullFileName);
figure,imshow(imageArray);
imwrite(imageArray,'C:\Users\Public\Videos\Sample Videos\pro\New','jpg');
end
0 comentarios
Respuesta aceptada
Image Analyst
el 24 de Abr. de 2014
See the FAQ for proper code that you can modify to do that: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
5 comentarios
Image Analyst
el 28 de Abr. de 2014
Rohan, you totally ignored the FAQ link I gave you. How do I know? If you had looked at it you would NOT have written this:
imwrite(b,'C:\Users\Public\Videos\Sample Videos\pro\Newr\im%d.jpg',k);
imwrite() is not like sprintf() - it does not embed "k" into the filename string. You need to do it in two steps like the FAQ shows:
fullFileName = sprintf('C:/Users/Public/Videos/Sample Videos/pro/Newr/im%d.jpg',k);
imwrite(b,fullFileName);
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Segmentation and Analysis 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!