OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Mon, 26 Oct 2015 06:08:43 -0500OpenCV most efficient way to find a point in a polygonhttp://answers.opencv.org/question/74303/opencv-most-efficient-way-to-find-a-point-in-a-polygon/I have a dataset of 500 cv::Point.
For each point, I need to determine if this point is contained in a ROI modelized by a concave polygon. This polygon can be quite large (most of the time, it can be contained in a bounding box of 100x400, but it can be larger)
For that number of points and that size of polygon, what is the most efficient way to determine if a point is in a polygon?
using the pointPolygonTest openCV function?
building a mask with drawContours and finding if the point is white or black in the mask?
other solution? (I really want to be accurate, so convex polygons and bounding boxes are excluded).Mon, 26 Oct 2015 05:31:44 -0500http://answers.opencv.org/question/74303/opencv-most-efficient-way-to-find-a-point-in-a-polygon/Comment by theodore for <p>I have a dataset of 500 cv::Point.</p>
<p>For each point, I need to determine if this point is contained in a ROI modelized by a concave polygon. This polygon can be quite large (most of the time, it can be contained in a bounding box of 100x400, but it can be larger)</p>
<p>For that number of points and that size of polygon, what is the most efficient way to determine if a point is in a polygon?</p>
<p>using the pointPolygonTest openCV function?
building a mask with drawContours and finding if the point is white or black in the mask?
other solution? (I really want to be accurate, so convex polygons and bounding boxes are excluded).</p>
http://answers.opencv.org/question/74303/opencv-most-efficient-way-to-find-a-point-in-a-polygon/?comment=74309#post-id-74309I think pointPolygonTest will make the job ;-)Mon, 26 Oct 2015 06:08:43 -0500http://answers.opencv.org/question/74303/opencv-most-efficient-way-to-find-a-point-in-a-polygon/?comment=74309#post-id-74309