Poor Sub-pixel Corner Detection in Charuco (too noisy?)

asked 2019-01-30 08:45:42 -0600

mfischer-gundlach gravatar image

I am using Charuco board for camera calibration. I discovered that the corner detection (incl sub-pixel accuracy) returned by aruco.interpolateCornersCharuco is very poor. In the image below, I purely drew the detected charuco corners (white squares).


I used the code below:

dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_4X4_1000)
board = cv2.aruco.CharucoBoard_create(15, 25, 8, 5, dictionary)

foldername  = "C:/Users/mfischer-g/Documents/Calibration/Data/MssCalibrationTests/DeviationsiPhone/"
filename = "charuco2_ps1.jpg"

gray = cv2.cvtColor(cv2.imread(foldername + filename), cv2.COLOR_BGR2GRAY)
if gray is None:
    print("Can not read image file.")

corners, ids, rejectedImgPoints = cv2.aruco.detectMarkers(gray,dictionary)
_, charucoCorners, ids = cv2.aruco.interpolateCornersCharuco(corners, ids, gray, board)
cv2.aruco.drawDetectedCornersCharuco(gray, charucoCorners)

_ = cv2.imwrite(foldername + "detectedMarkers.jpg", gray)

How comes that the detected corners are so far off?

edit retag flag offensive close merge delete