How to process a folder of Images?

1 visualizzazione (ultimi 30 giorni)
MJ Thangaraj
MJ Thangaraj il 29 Mar 2016
Risposto: Stephen23 il 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')

Risposta accettata

Stephen23
Stephen23 il 29 Mar 2016

Più risposte (0)

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by