How to save different images in sequence ?

1 view (last 30 days)
babar zeb
babar zeb on 24 Sep 2019
Edited: babar zeb on 24 Sep 2019
hello every one, need your help
i have 144 images in my folder starting from image1 to image144. i want to apply different noise on these images and want to save them in sequence with in the same folder..for example i want to add salt & pepper so how it will be possible to save the noised images in the same folder starting from image 145 to image 288.
image_folder='D:\my work\data';
filenames = dir(fullfile(image_folder,'*.jpg'));
total_images = numel(filenames);
for n = 1:total_images
file=sprintf('%d.jpg', n);
f= fullfile(image_folder, file);
our_images = imread(f);
path= fullfile('D:\my work\traindata',['image', num2str(n),'.jpg']);
imwrite(our_images,path);

Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!