how to overcome overwrite of the saved images in a folder

11 views (last 30 days)
hi sir, can I know how to overcome the overwrite file that have been save in a folder? for instance, it can save a 001.jpg image in a file. however, when I run program for another image , it will overwrite 001.jpg as another image. I want the second image save as 002.jpg in a same folder and make it for the next image.. pls advice and help!

Answers (1)

Image Analyst
Image Analyst on 15 Oct 2012
  4 Comments
Image Analyst
Image Analyst on 15 Oct 2012
Code given in the FAQ almost always needs to be adapted to fit the individual user's situation. The code in the FAQ just reads images. If you want to write images you need to use a similar concept of using sprintf() to create an output file name, which may be in a different folder or the same folder, and then use imwrite().

Sign in to comment.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!