Approximates a polygonal curve(s) with the specified precision
approxCurve = cv.approxPolyDP(curve)
approxCurve = cv.approxPolyDP(curve, 'OptionName', optionValue, ...)
Input
- curve Input vector of 2D points stored in numeric array
(Nx2/Nx1x2/1xNx2) or cell array of 2-element vectors (
{[x,y], ...}
).
Supports integer (int32
) and floating-point (single
) classes.
Output
- approxCurve Result of the approximation. The type should match the
type of the input curve. The shape should also match the input curve
(numeric or cell array).
Options
- Epsilon Parameter specifying the approximation accuracy. This is the
maximum distance between the original curve and its approximation.
default 2.0
- Closed If true, the approximated curve is closed (its first and last
vertices are connected). Otherwise, it is not closed. default true
The function cv.approxPolyDP approximates a curve or a polygon with another
curve/polygon with less vertices so that the distance between them is less
or equal to the specified precision. It uses the
Douglas-Peucker algorithm.