IVT
ContourHelper Namespace Reference

Collection of functions for contour processing. More...

Functions

void ComputeConvexHull (const Vec2d *pPoints, int nPoints, Vec2d *pResultPoints, int &nResultPoints)
 Computes the convex hull for a set of contour points. More...
 

Detailed Description

Collection of functions for contour processing.

Function Documentation

void ContourHelper::ComputeConvexHull ( const Vec2d pPoints,
int  nPoints,
Vec2d pResultPoints,
int &  nResultPoints 
)

Computes the convex hull for a set of contour points.

The algorithm used for computing the convex hull is Graham's scan.

The input points do not have to be sorted in any way. The result points will be sorted. The function PrimitivesDrawer::DrawPolygon(CByteImage*, const Vec2d*, int, int, int, int, int) can be used for visualizing the resulting contour.

Parameters
[in]pPointsThe input contour points.
[in]nPointsThe number of input contour points.
[out]pResultPointsThe result contour points. Memory for at least nPoints Vec2d entries must have been allocated by the user.
[out]nResultPointsThe number of result contour points.

Definition at line 133 of file ContourHelper.cpp.