开发者

Use 'cv::pointPolygonTest'

开发者 https://www.devze.com 2023-03-24 03:57 出处:网络
I\'m writing some code to test if a point is inside the contour of a polygon. I have started writing my own co开发者_如何学Cde but i see this function is defined. The problem is I don\'t understand wh

I'm writing some code to test if a point is inside the contour of a polygon. I have started writing my own co开发者_如何学Cde 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 in samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp passes a vector of Point vectors.

Perhaps you're looking at outdated documentation?

0

精彩评论

暂无评论...
验证码 换一张
取 消