我已经编译了 aruco 库,如此处所述的 aurco 库的github 链接
我已经检查它是否已成功编译,因为我可以在 python 中导入它而不会出现任何错误,并检查我是否运行了 example.py 脚本,它也可以正常工作,但是当我编写这段代码时
import cv2
import numpy as np
import aruco
Dictionary = aruco.getPredefinedDictionary(aruco.PREDEFINED_DICTIONARY_NAME(DICT_5X5_250=6))
aruco.drawMarker(Dictionary,5,250,markerImage,1)
aruco.drawMarker(Dictionary,10,250,markerImage,1)
aruco.drawMarker(Dictionary,20,250,markerImage,1)
aruco.drawMarker(Dictionary,25,250,markerImage,1)
aruco.drawMarker(Dictionary,50,250,markerImage,1)
aruco.drawMarker(Dictionary,100,250,markerImage,1)
aruco.drawMarker(Dictionary,200,250,markerImage,1)
cv2.imshow("markers",markerImage)
cv2.waitKey(0)
cv2.imgwrite(marker.jpg,markerImage)
它抛出错误
回溯(最后一次调用):文件“drawmarker.py”,第 7 行,在 Dictionary = aruco.getPredefinedDictionary(aruco.PREDEFINED_DICTIONARY_NAME(DICT_5X5_250=6)) AttributeError: 'module' object has no attribute 'getPredefinedDictionary'
有人可以让我知道我在做什么错吗,这个模块不是在 python 版本的 aruco 中导入的吗?