我正在try 检测图像上的ArUco标记,但OpenCV未检测到该标记.我认为这可能是因为分辨率低,但我不确定.
我用this tool生成了一个4x4 ID.
以下是我的代码:
aruco_dict = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_100)
def find_marker(img, x1, y1, x2, y2):
img = img[y1:y2, x1:x2]
img = imutils.resize(img, width=500)
cv2.imshow('result', img)
cv2.waitKey(0)
corners, ids, rej = cv2.aruco.detectMarkers(img, aruco_dict)
print(corners)
print(ids)
When running the code, this is the image that cv.imshow
is showing me:
如你所见,有一个较低分辨率的ArUco标签,但它应该仍然是可读的.但是,代码会打印出ID为None
,角点为空的()
.