ArUco 4x4_50 marker ID 0

arucogrid.com

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

How big should an ArUco marker be?

The marker has to cover enough pixels in the image for the detector to find its outline and then read its cells. Everything else follows from that.

The formula

A marker of side S metres, seen straight on at D metres, covers P pixels:

P = f × S / D

f is the focal length in pixels, which is not the focal length in millimetres. If you have not calibrated the camera yet, work it out from the image width and the horizontal field of view:

f = width / (2 × tan(fov / 2))

Rearranged, the printed size you need is:

S = P × D / f

How many pixels the detector needs

OpenCV straightens each candidate marker and samples every cell. The default is four pixels per cell, set by perspectiveRemovePixelPerCell. A 6x6 marker with its border is eight cells across, so the sampling floor is 32 pixels.

That floor assumes a sharp, well lit, straight on marker. Take three times the floor as a working target, and more again if the camera or the marker moves.

Other things that cost you range

A marker seen at an angle is narrower in the image than its true size, roughly by the cosine of the angle. At sixty degrees off straight on you keep half of it.

Motion blur smears cell edges and costs more than distance does. A shorter exposure with more gain often reads better than a clean but blurred frame.

Rolling shutter bends a moving marker, which pushes the corners off and biases the pose. A global shutter camera is worth having if the target moves.

Worked example

A camera 1920 px wide, 60 degree horizontal field of view has a focal length of about 1663 pixels. For a 6x6 marker, which is eight cells wide with its border, the sampling floor is 32 pixels and a working target is 96 pixels.

DistanceWorking size Absolute floor
1 m58 mm 19 mm
2 m115 mm 38 mm
3 m173 mm 58 mm
5 m289 mm 96 mm
10 m577 mm 192 mm

Range by dictionary

The same 100 mm marker reaches different distances depending on how many bits it carries.

BitsPrinted widthCell at 100 mm Pixels wantedRange
4×46 cells 16.7 mm72 px 2.3 m
5×57 cells 14.3 mm84 px 2.0 m
6×68 cells 12.5 mm96 px 1.7 m
7×79 cells 11.1 mm108 px 1.5 m

Make one

Open the generator

Related