【问题标题】:Problems with Aruco library on Debian 9.5 - OpenCVDebian 9.5 上 Aruco 库的问题 - OpenCV
【发布时间】:2021-12-15 02:48:37
【问题描述】:

我正在尝试在 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_matrixcamera_distortion分别是我通过相机标定得到的相机矩阵和相机畸变参数。

更准确地说,错误表明函数cv2.aruco.detectMarkers 没有cameraMatrix 输入参数。我该如何解决这个问题?非常感谢您。

【问题讨论】:

    标签: python python-2.7 opencv debian


    【解决方案1】:

    也许你的错误是由于你的opencv 版本。检查它:

     cv2.__version__
    

    opencv 的旧版本(例如 3.2.0,这可能是 Debian 9 的默认版本)没有 cameraMatrixdistCoeff 作为 cv2.aruco.detectMarkers 函数的输入参数。

    如果您有兴趣为您的操作系统(例如 4.1.0.25)获取更新版本的 opencv,您必须这样做:

    sudo pip install opencv-contrib-python==4.1.0.25
    

    如果不是,只需从输入中删除 cameraMatrixdistCoeff,它仍然会运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-27
      • 1970-01-01
      • 2018-02-08
      • 2014-07-20
      • 2011-02-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多