how to write multiple images into a folder
Mostrar comentarios más antiguos
I have this code
[parentFolder deepestFolder] = fileparts('24x24');
output_folder = 'E:\Bismillah Wisuda 115\progress TA ku new\program';
for a=1:40
im=imread(['E:\Bismillah Wisuda 115\progress TA ku new\program\data training\citra training positif2\kendaraan' num2str(a) '.jpg']);
image=imresize(im,[24 24]);
imwrite(image,['kendaraan' num2str(a) '.jpg'],'jpg');
newSubFolder = sprintf(deepestFolder);
fullname = fullfile(output_folder,'output_folder',newSubFolder);
if ~exist(parentFolder, 'dir')
mkdir(parentFolder);
end
end
it can run, but my folder is still empty. Can you please fix it? Thank you.
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 6 de Nov. de 2016
2 votos
That code is not very robust at all. I can see at least 3 or 4 problems right off the bat. See the FAQ for two ways that it can be done. http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
Categorías
Más información sobre Image Preview and Device Configuration en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!