Method ApproxPolyDP
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
ApproxPolyDP(InputArray, OutputArray, double, bool)
Approximates contour or a curve using Douglas-Peucker algorithm
public static void ApproxPolyDP(InputArray curve, OutputArray approxCurve, double epsilon, bool closed)
Parameters
curveInputArrayThe polygon or curve to approximate. Must be 1 x N or N x 1 matrix of type CV_32SC2 or CV_32FC2.
approxCurveOutputArrayThe result of the approximation; The type should match the type of the input curve
epsilondoubleSpecifies the approximation accuracy. This is the maximum distance between the original curve and its approximation.
closedboolThe result of the approximation; The type should match the type of the input curve
ApproxPolyDP(IEnumerable<Point>, double, bool)
Approximates contour or a curve using Douglas-Peucker algorithm
[SuppressMessage("Maintainability", "CA1508: Avoid dead conditional code")]
public static Point[] ApproxPolyDP(IEnumerable<Point> curve, double epsilon, bool closed)
Parameters
curveIEnumerable<Point>The polygon or curve to approximate.
epsilondoubleSpecifies the approximation accuracy. This is the maximum distance between the original curve and its approximation.
closedboolThe result of the approximation; The type should match the type of the input curve
Returns
- Point[]
The result of the approximation; The type should match the type of the input curve
ApproxPolyDP(IEnumerable<Point2f>, double, bool)
Approximates contour or a curve using Douglas-Peucker algorithm
[SuppressMessage("Maintainability", "CA1508: Avoid dead conditional code")]
public static Point2f[] ApproxPolyDP(IEnumerable<Point2f> curve, double epsilon, bool closed)
Parameters
curveIEnumerable<Point2f>The polygon or curve to approximate.
epsilondoubleSpecifies the approximation accuracy. This is the maximum distance between the original curve and its approximation.
closedboolIf true, the approximated curve is closed (i.e. its first and last vertices are connected), otherwise it’s not
Returns
- Point2f[]
The result of the approximation; The type should match the type of the input curve