How to test if a point is inside of a convex polygon in 2D integer coordinates?

后端 未结 8 697
青春惊慌失措
青春惊慌失措 2020-11-30 04:05

The polygon is given as a list of Vector2I objects (2 dimensional, integer coordinates). How can i test if a given point is inside? All implementations i found on the web fa

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 04:38

    The pointPolygonTest function in openCV " determines whether the point is inside a contour, outside, or lies on an edge": http://docs.opencv.org/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=pointpolygontest#pointpolygontest

提交回复
热议问题