python - 属性错误 : 'module' object has no attribute 'drawAxis'

标签 python opencv ubuntu ros aruco

我正在使用 ros melodic、opencv 4.5.5、ubuntu 18.04。我绘制了标记 aruco 的 3 轴以显示在 rqt_image_view 上。运行时出现此问题 AttributeError: 'module' object has no attribute 'drawAxis'
这是我的轴图的代码:

 ......................
    frame_out = aruco.drawAxis( img, self.K, self.distCoeffs, rvecs, tvecs, axisLength)
    ...................
    self.aruco_marker_img_pub.publish(self.bridge.cv2_to_imgmsg(frame_out, "bgr8"))
    ....................... 
当我在没有 ros 的情况下做 aruco aruco 这是正常的,当它正确时它看起来像这样
enter image description here

最佳答案

我想你的意思是使用 cv2.drawFrameAxes而不是 cv2.drawAxes .

关于python - 属性错误 : 'module' object has no attribute 'drawAxis' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72466209/

相关文章:

python - wkhtmltopdf 错误 "No such file or directory"(Django)

python - 是否可以在 Python 2 中使用 'print >>' 而不使用换行符和空格?

python - 获取不规则形状的中心

c++ - 链接OpenCV库时出错

ubuntu - 使用 EC2 Ubuntu 13 设置 Sublime SFTP

c++ - 在 Qt Creator 中进入 Qt 源代码(在 Ubuntu Linux 中)

python - 按字典顺序查找最小的数字

python - 通过环境变量将参数传递给Docker容器是一种好习惯吗?

VideoWriter.write 中的 Python OpenCV 错误 (-215)

Bash - 添加包含变量的新行