Home > Net >  ArUco Markers are not detected
ArUco Markers are not detected

Time:02-16

I'm trying to detect the ArUco markers in this image:

img

using this code:

import cv2
import cv2.aruco as aruco
import numpy as np

def findArucoMarkers(img, markerSize = 5, totalMarkers=250, draw=True):    
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
    key = getattr(aruco, f'DICT_{markerSize}X{markerSize}_{totalMarkers}')
    arucoDict = aruco.Dictionary_get(key)
    arucoParam = aruco.DetectorParameters_create()
    bboxs, ids, rejected = aruco.detectMarkers(gray, arucoDict, parameters = arucoParam)
    print(ids)
    if draw:
        aruco.drawDetectedMarkers(img, bboxs)
    return [bboxs, ids]

path = ""
imName= "test3.png"

img = cv2.imread(path imName)

arucofound = findArucoMarkers(img, markerSize = 5)

cv2.imshow('img',img)
cv2.waitKey(0)

Sadly, no marker is detected! can you please tell me how can I detect the markers correctly? thanks in advance.

Edit:

The markers are 5x5 generated online from this website, the IDs: 0, 2, 4, 12, 17

The camera used Asus Xtion Live Pro.

CodePudding user response:

The picture is a mirror image of the markers.

ArUco markers will not be decoded when they're mirrored.

Prevent/undo the mirroring. Find the device/driver setting that does this.

flipped = cv.flip(img, 1) flips the image around the Y-axis.

  • Related