python - Python错误:SystemError:新样式getargs格式但参数不是元组
问题描述
我正在尝试运行这段代码(我没有这样做),但它抛出了这个错误,我不知道,有什么建议吗?
inFloor = np.array([cv.pointPolygonTest(floorPoly_m, pt, False) for pt in self.xyz[:,:2]]) >= 0
错误:SystemError:新样式 getargs 格式但参数不是元组
显然错误出现在 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
解决方案
通过更新opencv库解决:
pip3 install opencv-python --upgrade
推荐阅读
- android - 登录后如何始终保持有效的 FireBase 令牌
- swift - 有没有办法使用来自安全飞地的私钥来生成 TOTP?
- google-my-business-api - 获取帐户列表时出现 RATE_LIMIT_EXCEEDED 异常(Google My Business API)
- javascript - “431 请求标头字段太大”
- android - 使用 QR 码注册 EMM 期间不必要的设置向导
- python - 如何获得正确的权重?
- python - for循环中Faker库的exec()方法调用| Python
- docusignapi - DocuSign 管理 API OpenAPI / SDK
- swift - 在模态中获取特定的 id
- node.js - 使用 Github Runner(自托管)部署 Node 应用程序的最佳实践是什么