<< imcontour2label Structural Analysis and Shape Descriptors imconvexityDefects >>

IPCV >> Structural Analysis and Shape Descriptors > imconvexHull

imconvexHull

Finds the convex hull of a point set.

Syntax

H = imconvexHull(contours[, cw[, ind]])

Parameters

contours :

Contours in list

cw :

Return points in clockwise or counter-clockwise direction, 0 as CCW, 1 as CW

ind :

Return points in image rectangular coordinate pairs or the indices of contours, 0 to return coor pairs, 1 to return indexes

H :

Convex hulls in list in correspond to the contours

Description

The functions find the convex hull of all the contours in list using the Sklansky's algorithm.

Examples

S = imread(fullpath(getIPCVpath() + "/images/hand.jpg"));
Sbw = im2bw(~S,0.5);
imshow(Sbw);
Sc = imfindContours(Sbw);
H = imconvexHull(Sc);
implotContours(Sbw,lstcat(Sc, H),5)

See also

Authors


Report an issue
<< imcontour2label Structural Analysis and Shape Descriptors imconvexityDefects >>