hello everyone. I would like to ask how to use the loop statement batch save picture and import pictures. The names of the pictures are: 1.jpg; 2.jpg; 3.jpg;... Thank you very much.

조회 수: 1 (최근 30일)
Save picture:
Folder = 'C:\Users\wenhuaiyu\Desktop\';
for k=1:numel(s)
Obj=(L==k);%
imwrite(Obj, fullfile(Folder, sprintf('%02d.jpg',k)));
end
import pictures:
for i=1:numel(s) %suppose there are 10 image
im=imread('%02d.jpg',i');
imtool(im);
end

채택된 답변

Image Analyst
Image Analyst 2021년 5월 21일
This is a FAQ, so see the FAQ:
In the loop have imread() to import, then do your stuff, then use imwrite() to save any changes to a new image file.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by