我正在尝试pointPolygontest的功能,我想检查边界和内部和外部的点。在
形成功能的自由裁量权 双点多边形测试(输入阵列轮廓,点2F点,布尔测量列表)
参数:
contour – Input contour.
pt – Point tested against the contour.
measureDist – If true, the function estimates the signed distance from the point to the nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.
当measureDist=false时,返回值为+1、-1和0,相应地,t返回正(内部)、负(外部)或零(在边上)值。在
现在我测试了下面的代码来测试多边形的边,但没有得到ecpexted的结果。在
代码如下:
^{pr2}$输出是
[[0.0, 0.0], [0.0, 200.0], [200.0, 200.0], [200.0, 0.0]]
-1.0
-1.0
-1.0
1.0
也就是说3个肉汤在外面,最后一个在里面,但我的理解是所有的肉汤都应该是0.0
那么,什么是错误??在
我很想繁衍后代。您可以检查轮廓值以及-1.0和1.0的原因。在
试试看
^{pr2}$而不是
在pointPolygon(实例0,0或400400)中,边界通常被省略,不会像预期的那样返回0,而是返回-1
相关问题 更多 >
编程相关推荐