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... | |
Collection of functions for contour processing.
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.
[in] | pPoints | The input contour points. |
[in] | nPoints | The number of input contour points. |
[out] | pResultPoints | The result contour points. Memory for at least nPoints Vec2d entries must have been allocated by the user. |
[out] | nResultPoints | The number of result contour points. |
Definition at line 133 of file ContourHelper.cpp.