<< dendrogram Image_Processing_Tool_3 hiseq >>

Image_Processing_Tool_3 >> Image_Processing_Tool_3 > findContour

findContour

It finds the contour of contours of coneected pixels in a binary image.

Calling Sequence

C = findContour(I)
C = findContour(I,k)

Parameters

I

A binary matrix in 0 and 1 representing a binary image.

k

A binary digit 0 or 1. By default its value is 1.

C

A binary matrix representing the countour of the input binary image.

Description

It computes the contour of the connected pixels in a given binary image. It can take one or two parameters as input. If only the first parameter is taken as input, the second parameter is taken as 1, which corresponds to the contour with black background. If the value of second parameter is 0, the computed contour has white background.

Examples

// Reading Lena image
x=imread('lena.png');
x=rgb2gray(x);
// Binary image of lena
x=x>125;
// Computing contour in black ground
yb=findContour(x);
imshow(yb)
// Computing contour in white background
yw=findContour(x,0);
imshow(yw)

See Also

Authors

<< dendrogram Image_Processing_Tool_3 hiseq >>