Camera viewing a square geometric fiducial marker on a tilted metal workpiece.

What you need

Use a rigid, accurately measured marker, fixed camera calibration and saved images. Keep the marker flat and unobstructed.

Distance estimate versus configured marker size. Correct 40 mm: 400 mm; Incorrect 50 mm: 500 mm.
Distance estimate versus configured marker size. Original Academy diagram using illustrative values; not a measured hardware result.
Read the diagram as a data table
Values used in the illustration
Condition or componentmm
Correct 40 mm400
Incorrect 50 mm500

The calculation

Z ≈ f_pixels × L / p

For a front-facing marker, Z is distance, L is marker side length and p is apparent side length in pixels. This is a simplified scale check, not full pose estimation.

Worked example

Illustrative numbers. Replace them with your measured inputs.

A 40 mm marker spanning 80 pixels with f = 800 pixels gives approximately 400 mm distance. Entering 50 mm as the marker size would imply 500 mm instead: a 25% scale error from a printing or configuration mistake.

Try it step by step

  1. Measure the printed marker’s intended outer square and use the same dictionary and corner convention as the detector.
  2. Detect corners, estimate pose with the calibrated camera model and overlay axes on saved images.
  3. Define a measured marker-to-grasp transform rather than treating the marker origin as the tool target.
  4. Reject poor visibility, small apparent size and implausible pose jumps, then validate against known reference positions.

How to check the result

Check pose accuracy at different distances and tilts, including the smallest marker image expected in operation.

Common mistake to avoid

A marker ID is not an authentication mechanism. A copied marker or incorrect physical size can produce a valid detection with the wrong meaning.

Reference reading

Primary references for the underlying models, APIs or application context. The worked numbers and plots above are educational calculations, not results reported by these sources.

Read our methods, limitations and safety notes.