How to save multiple outputs of segmented in a different folder
3 views (last 30 days)
I have segmented 104 images, I need those segemted images to be saved in separate folder. How do I do that. Could you please help me with that.
The code used as follows
filenames = dir(fullfile(image_folder,'*.png'));
total_images = numel(filenames);
for n = 1:total_images
I = imread(f);
s = rgb2gray(I);
imshow(s>115 & s<210);
path = strcat('C:\Users\Abinaya Giri\OneDrive\Desktop\Segmentation\Segmented',image_folder.name);
Thanks in advance.
Shubham Rawat on 15 Mar 2021
For saving a particular file in different folder you may use this:
save(['C:\Users\Abinaya Giri\OneDrive\Desktop\Segmentation\Segmented' filenames(1).name])
By this you will save a file of name filenames(1).name to the existing folder 'C:\Users\Abinaya Giri\OneDrive\Desktop\Segmentation\Segmented'
Note: Folder should already exist
Hope this helps!