模块“cv2.cv2”没有属性“aruco”;

发布于 2025-01-12 18:05:54 字数 706 浏览 2 评论 0原文

我的Python脚本使用opencv-contrib-python中的aruco库来检测图像中的ArUco代码。它运行了近一年,但上周突然开始出现此错误。

回溯(最近一次调用最后):

文件“j:/Neil/colorimetric/patterns/detect_track_guide.py”,第586行,在

dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_100)

AttributeError中:模块“cv2.cv2”没有属性“aruco”

错误conda.cli.main_run:执行(33): 'conda run ['python', 'j:/Neil/colorimetric/patterns/detect_track_guide.py']' 命令失败。 (请参阅上面的错误)'

我使用 VSCode 并且 opencv 是最新的。我只安装 opencv-contrib-python。我尝试了很多方法,例如重新安装或同时安装 opencv-contrib-python 和 opencv-contrib。但没有人为我工作。

我的 IOS 应用程序还有一个 C++ 版本代码,它仍然运行良好。

点值列表

My Python script uses aruco library in opencv-contrib-python to detect ArUco code in the image. It has worked well for nearly one year, but suddenly start to pop this error in last week.

Traceback (most recent call last):

File "j:/Neil/colorimetric/patterns/detect_track_guide.py", line 586, in

dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_100)

AttributeError: module 'cv2.cv2' has no attribute 'aruco'

ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['python', 'j:/Neil/colorimetric/patterns/detect_track_guide.py']' command failed. (See above for error)'

I use VSCode and the opencv is up-to-date. I only install opencv-contrib-python. I tried many ways, like reinstalling or installing both opencv-contrib-python and opencv-contrib. But no one works for me.

I also have a c++ version code for my IOS APP which still works well.

pip list

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独闯女儿国 2025-01-19 18:05:55

目前尚不清楚遇到该错误时您运行的是哪个版本的 OpenCV。

似乎 aruco.drawAxis 已替换为 cv2.drawFrameAxeshttps://docs.opencv.org/4.6.0/d9/d0c/group__calib3d.html#gab3ab7bb2bdfe7d5d9745bb92d13f9564

比较 cv2.drawFrameAxes .6.0 与 aruco.drawAxis 来自 v4 .1.2(我在出现错误之前运行的版本)。

It's not clear what version of OpenCV you were running when you encountered the error.

It seems that aruco.drawAxis was replaced with cv2.drawFrameAxes: https://docs.opencv.org/4.6.0/d9/d0c/group__calib3d.html#gab3ab7bb2bdfe7d5d9745bb92d13f9564

Compare cv2.drawFrameAxes in v4.6.0 with aruco.drawAxis from v4.1.2 (the version I was running before encontouring the error).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文