Aruco detector giving false positive

For some reason Aruco detector is giving a false positive (id 37 in the picture). I can see that there’s some white spots in that black square so I am assuming it makes the cut to be counted as marker. Is there a way to make the aruco detector more pedantic for this case? seems like by default is a little relaxed.

snippet used (pretty much same as the OpenCV Aruco Tutorial)

cv::aruco::Dictionary dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_5X5_1000);
cv::aruco::DetectorParameters params = cv::aruco::DetectorParameters();
cv::aruco::ArucoDetector detector(dictionary, params);
detector.detectMarkers(image, marker_corners, marker_ids, rejectedMarkers);

This code was used to generate the Charuco board. The Charuco paremeters 19x54, 0.05, 0.04, DICT_5X5_1000, legacy_charuco = true

cv::Ptr<cv::aruco::CharucoBoard> board = cv::makePtr<cv::aruco::CharucoBoard>(cv::Size(19, 34), 0.05f, 0.04f, dictionary);
board->setLegacyPattern(true);

that’s an implausible detection. no border, no white modules… potentially a bug.

you should present a MRE (input data…) if you want others to debug this.

if there is some measure of reproducibility to this, i.e. it’s not just one frame from your camera causing this detection, but it shows up in multiple frames, then this might be worth a bug report.

I have the exact same issue, reproducable with multiple images. My images are often quite bad (difficult to control my environment, bad cameras), but I still find these detections surprisingly bad (note how it detects the markers in entirely black areas):

Here are the original images:

I use mainly the default parameters. Relevant code:

square_size = 0.01693
marker_size = 0.0105

num_squares_x = 10
num_squares_y = 14

dictionary = cv2.aruco.getPredefinedDictionary( dict_id_for_name( cv2.aruco.DICT_4X$_250 ) )
board = cv2.aruco.CharucoBoard(
                        ( num_squares_x, num_squares_y ),
                        square_size,
                        marker_size,
                        dictionary )
board.setLegacyPattern( True )

charuco_params = cv2.aruco.CharucoParameters()
detector_params = cv2.aruco.DetectorParameters()

detector = cv2.aruco.CharucoDetector( board, charuco_params, detector_params )

...

charuco_corners_l, charuco_ids_l, marker_corners_l, marker_ids_l = detector.detectBoard( left )

Opencv version: Python, ‘4.10.0’

Edit: I should mention that the detected chessboard corners are correct, i.e. the wrong markers seem to be pruned out correctly before determining chessboard corners.

might be worth discussing on opencv’s github, as an issue. bugs in the aruco/charuco implementation in opencv are best discussed there.

I’ve been meaning to contribute an algorithm that doesn’t require these silly charuco boards, but instead will recover the grid indices of points of a partially detected regular grid. you can try hounding me about this.

1 Like