python - Debian 9.5 上 Aruco 库的问题 - OpenCV
问题描述
我正在尝试在 Debian 9.5 上使用 OpenCV for Python 2.7 通过我的相机检测 Aruco 标记,但由于处理cv2.aruco.detectMarkers()
. 在 Windows 上运行它,它没有任何问题。特别是,我在我的代码中写道:
cv2.aruco.detectMarkers(image=gray, dictionary=aruco_dict, parameters=parameters,
cameraMatrix=camera_matrix, distCoeff=camera_distortion)
其中camera_matrix
和camera_distortion
分别是我通过相机校准得到的相机矩阵和相机畸变参数。
更准确地说,错误表明 function 没有cameraMatrix
输入参数cv2.aruco.detectMarkers
。我该如何解决这个问题?非常感谢您提前。
解决方案
Maybe your error is due to your opencv
version. Check it with:
cv2.__version__
Older versions of opencv
(such as 3.2.0, that is maybe your default version for Debian 9) do not have cameraMatrix
or distCoeff
as input parameters of cv2.aruco.detectMarkers
function.
If you are interested in getting newer versions of opencv
for your OS (such as 4.1.0.25), you have to do:
sudo pip install opencv-contrib-python==4.1.0.25
If you are not, just remove cameraMatrix
and distCoeff
from your inputs, it would run anyway.
推荐阅读
- javascript - 向下传递模块 - javascript
- c++ - 为什么我的代码打印 rvalue 2 次而不是 rvalue & lvalue?
- kotlin - 在 Ktor 中,如何将 InputStream 流式传输到 HttpClient 请求的正文中?
- java - 未找到处理 Intent android.media.action.VIDEO_CAPTURE 的活动(有附加功能)
- php - 如何在ajax过程中显示加载动画和禁用按钮
- google-apps-script - 我可以通过脚本删除复选框选项而不删除整个项目吗
- asp.net - Windows 10、IIS 10 和多个
- angular - Angular - 无法绑定属性,因为它不是“div”的已知属性
- onelogin - 当用户从 onelogin IDP 强制注销时,不调用服务提供者的 SLS 端点
- python - Python DataFrame:如何删除填充多列的行?