OpenCvSharp.Cv2.PointPolygonTest C# (CSharp) Method

PointPolygonTest() public static method

Checks if the point is inside the contour. Optionally computes the signed distance from the point to the contour boundary.
public static PointPolygonTest ( IEnumerable contour, Point2f pt, bool measureDist ) : double
contour IEnumerable 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.
return double
        public static double PointPolygonTest(IEnumerable<Point2f> contour, Point2f pt, bool measureDist)
        {
            if (contour == null)
                throw new ArgumentNullException(nameof(contour));
            Point2f[] contourArray = EnumerableEx.ToArray(contour);
            return NativeMethods.imgproc_pointPolygonTest_Point2f(contourArray, contourArray.Length, pt, measureDist ? 1 : 0);
        }
        #endregion

Same methods

Cv2::PointPolygonTest ( IEnumerable contour, Point2f pt, bool measureDist ) : double
Cv2::PointPolygonTest ( InputArray contour, Point2f pt, bool measureDist ) : double
Cv2