【发布时间】:2021-10-29 13:12:27
【问题描述】:
我正在尝试运行这段代码(我没有这样做),但它抛出了这个错误,我不知道,有什么建议吗?
inFloor = np.array([cv.pointPolygonTest(floorPoly_m, pt, False) for pt in self.xyz[:,:2]]) >= 0
error: SystemError: new style getargs format but argument is not a tuple
显然错误出现在 pointPolygonTest 函数的第一个参数中,但该参数是这个数组,
[[7.177778 1.4777777]
[6.711111 1.7333333]
[6.388889 1.2333333]
[6.8444443 0.62222224]]
我试图将它转换为元组,但这个函数只接受数组..这对我来说很困惑
完整的错误输出在这里:
File "/home/rsc/Desktop/GUI1_b/install/livox_detection/lib/python3.8/site-packages/livox_detection/pointCloudLib.py", line 419, in topView_measure
inFloor = np.array([cv.pointPolygonTest(floorPoly_m, pt, False) for pt in self.xyz[:,:2]]) >= 0
File "/home/rsc/Desktop/GUI1_b/install/livox_detection/lib/python3.8/site-packages/livox_detection/pointCloudLib.py", line 419, in <listcomp>
inFloor = np.array([cv.pointPolygonTest(floorPoly_m, pt, False) for pt in self.xyz[:,:2]]) >= 0
SystemError: new style getargs format but argument is not a tuple
【问题讨论】:
-
请显示完整的错误回溯。
-
尝试使用stackoverflow.com/questions/32673359/…中的示例解决您的问题
-
是的,我试过......在这里提问之前先搜索论坛