How to process a folder of Images?

1 view (last 30 days)
MJ Thangaraj
MJ Thangaraj on 29 Mar 2016
Answered: Stephen23 on 29 Mar 2016
I have this code for a single image..now I have to apply this to a Folder of Images,How do I do it?
I=imread('two.jpg');
figure,imshow(I)
title('Original image')
%% Image adjust
Istrech = imadjust(I,stretchlim(I));
figure,imshow(Istrech)
title('Contrast stretched image')
%% Convert RGB image to gray
Igray_s = rgb2gray(Istrech);
figure,imshow(Igray_s,[])
title('RGB to gray (contrast stretched) ')
%% Image segmentation by thresholding
%use incremental value to run this selection till required threshold 'level' is
%achieved
level = 0.08;
Ithres = im2bw(Igray_h,level);
figure,imshow(Ithres)
title('Segmented cracks')
%% Image morphological operation
BW = bwmorph(gradmag,'clean',10);
figure,imshow(BW)
title('Cleaned image')
BW = bwmorph(gradmag,'thin', inf);
figure,imshow(BW)
title('Thinned image')

Accepted Answer

Stephen23
Stephen23 on 29 Mar 2016

More Answers (0)

Categories

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

Products

Community Treasure Hunt

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

Start Hunting!