Thursday, 19 April 2012

Matlab connected components Example code | Matlab bwlabel example code

Image connected components labeling is used for extract the region and calculating the total region of Images.It is support on matlab using bwlabel predefined function.This function find the connected components on Black and white images.So RGB images are converted into Black and white.Then apply bwlabel .Finally you got the Labeling Matrix.This matrix support for extract the Region of Images.

In below we give some examples of connected components labeling.

Input_Img = rgb2gray(imresize(imread('vivekananda.jpg'),[256 256]));
figure, imshow(Input_Img), title('original image')
BW_img = im2bw(Input_Img, graythresh(Input_Img));
Label_img = bwlabel(BW_img);
RGB = label2rgb(Label_img);
figure;
imshow(RGB);
disp(['Total Region :' num2str(max(max(Label_img)))]);

Output as below


Related Search : Matlab connected components Example code , Matlab bwlabel example code,connected components labeling example on Matlab,Matlab Image Region Extraction example.

Kindly Bookmark and Share it:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...