I’m writing some code to test if a point is inside the contour of a polygon.
I have started writing my own code but i see this function is defined. The problem is I don’t understand why the contour is a Mat. I have the contour of the polygon into a vector of CvPoint.
Function declaration:
double pointPolygonTest(const Mat& contour, Point2f pt, bool measureDist)
Anyone have an example of how to work with this function or know how to convert a vector of CvPoint to a const Mat& contour
The documentation shows the first argument as an array:
double pointPolygonTest(InputArray contour, Point2f pt, bool measureDist). The sample code insamples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpppasses a vector of Point vectors.Perhaps you’re looking at outdated documentation?