ArUco 4x4_50 marker ID 0

arucogrid.com

ArUco & ChArUco marker generator — printable boards, exact to the millimetre

Border bits, and why detectMarkers finds nothing

This is the most common way a printed board fails silently. The markers look right, the code looks right, and detectMarkers returns nothing.

What the border is

Every ArUco marker sits inside a solid black border. The border is what the detector looks for first: it finds dark quadrilaterals, straightens each one, and only then reads the cells inside.

The border is measured in cells, not millimetres. One cell is the standard, and it is what cv2.aruco draws and expects.

Why a wider border breaks detection

The detector divides the straightened marker into a fixed number of cells, worked out from the dictionary and from markerBorderBits. If the print has a two cell border and the detector assumes one, every cell is sampled in the wrong place. The bits come out as noise, no dictionary entry matches, and the candidate is thrown away.

The result is zero markers found, with no error and no warning.

The fix

Tell the detector what you printed:

params = cv2.aruco.DetectorParameters()
params.markerBorderBits = 2   # match the printed sheet
detector = cv2.aruco.ArucoDetector(DICTIONARY, params)

Or print a one cell border, which is what almost everyone should do. This generator warns on screen whenever the border is not one cell, and writes the matching setting into the code it gives you.

The quiet zone is a separate thing

The black border is part of the marker. The white paper around the marker is not, but it still matters: the detector needs lighter surroundings to see the dark quadrilateral at all.

Markers printed hard against each other, or right up to a dark table edge, will not be found. Keep a gap. This generator refuses a separation of zero for the same reason.

Make one

Open the generator

Related