Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

approxPolyDP() is not an alternative function to cvApproxPoly(), it is the same function with different API. Much simpler API actually. All you need to provide is input contour, container for output contour, epsilon (same one you used in cvApproxPoly), and flag whether the contour is open or closed. You still can provide your contour as CvSeq but vector of points is much more convenient and safer from memory leaks. Read rest of details here.

Use arcLength to calculate perimeter.