Table of Contents

Method PointPolygonTest

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

PointPolygonTest(InputArray, Point2f, bool)

Checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary

public static double PointPolygonTest(InputArray contour, Point2f pt, bool measureDist)

Parameters

contour InputArray
pt Point2f
measureDist bool

Returns

double

PointPolygonTest(IEnumerable<Point>, Point2f, bool)

Checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary

public static double PointPolygonTest(IEnumerable<Point> contour, Point2f pt, bool measureDist)

Parameters

contour IEnumerable<Point>
pt Point2f
measureDist bool

Returns

double

PointPolygonTest(IEnumerable<Point2f>, Point2f, bool)

Checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary.

public static double PointPolygonTest(IEnumerable<Point2f> contour, Point2f pt, bool measureDist)

Parameters

contour IEnumerable<Point2f>

Input contour.

pt Point2f

Point tested against the contour.

measureDist bool

If true, the function estimates the signed distance from the point to the nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.

Returns

double

Positive (inside), negative (outside), or zero (on an edge) value.