public static cvPointPolygonTest ( IntPtr contour, PointF pt, bool measureDist ) : double | ||
contour | IntPtr | Input contour |
pt | PointF | The point tested against the contour |
measureDist | bool | If true, the function estimates distance from the point to the nearest contour edge |
리턴 | double |
/// <summary> /// Determines the distance from the point to the contour /// </summary> /// <param name="point">The point to measured distance</param> /// <returns>positive distance if inside; negative distance if outside; 0 if on the contour</returns> public double Distance(PointF point) { return(CvInvoke.cvPointPolygonTest(Ptr, point, 1)); }
/// <summary> /// Determines whether the point is inside contour, outside, or lies on an edge (or coinsides with a vertex) /// </summary> /// <param name="point">The point to be tested</param> /// <returns>positive if inside; negative if out side; 0 if on the contour</returns> public virtual double InContour(PointF point) { return(CvInvoke.cvPointPolygonTest(Ptr, point, 0)); }