how to write multiple images into a folder
이전 댓글 표시
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.
채택된 답변
추가 답변 (1개)
Image Analyst
2016년 11월 6일
2 개 추천
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
카테고리
도움말 센터 및 File Exchange에서 Image Preview and Device Configuration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!