ArUco markers detected slightly too small

asked 2020-02-04 15:21:20 -0600

benf gravatar image

I've found that ArUco will detect markers as slightly smaller than they actually are unless I crank up the contrast on the image beforehand. Does anyone have a suggestion for a better way to solve this problem? If I have multiple markers and some are in shadowy areas of the image, I'm worried that cranking up the contrast will just make the darker markers disappear entirely.

Here's the relevant code (python 3.7):

aruco_dict = aruco.Dictionary_get(aruco.DICT_4X4_250)
file = "test_images/flat1_contrast.jpg"
frame = cv2.imread(file, cv2.IMREAD_COLOR)
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
parameters =  aruco.DetectorParameters_create()
parameters.cornerRefinementMethod = aruco.CORNER_REFINE_SUBPIX
corners, ids, rejectedImgPoints = aruco.detectMarkers(frame, aruco_dict, parameters=parameters)
frame_markers = aruco.drawDetectedMarkers(frame.copy(), corners, ids)

link to example images:


edit retag flag offensive close merge delete


I dont know - i would dig in this line

parameters.cornerRefinementMethod = aruco.CORNER_REFINE_SUBPIX
holger gravatar imageholger ( 2020-02-04 15:31:28 -0600 )edit

Or add some padding manually if its always these case

holger gravatar imageholger ( 2020-02-04 15:32:11 -0600 )edit

Try AprilTag to see if it is better?

There is also a ROS package.

Eduardo gravatar imageEduardo ( 2020-02-05 05:05:26 -0600 )edit