Table of Contents

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

curve InputArray

The polygon or curve to approximate. Must be 1 x N or N x 1 matrix of type CV_32SC2 or CV_32FC2.

approxCurve OutputArray

The result of the approximation; The type should match the type of the input curve

epsilon double

Specifies the approximation accuracy. This is the maximum distance between the original curve and its approximation.

closed bool

The 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

curve IEnumerable<Point>

The polygon or curve to approximate.

epsilon double

Specifies the approximation accuracy. This is the maximum distance between the original curve and its approximation.

closed bool

The 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

curve IEnumerable<Point2f>

The polygon or curve to approximate.

epsilon double

Specifies the approximation accuracy. This is the maximum distance between the original curve and its approximation.

closed bool

If 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