Search topics and sections

A fiducial marker is an object or pattern placed in the view of a camera or other imaging system to act as a known reference point. The system knows the marker's shape in advance, so it can use the marker to work out position, orientation, scale, or how one image lines up with another.[1]

In computer vision and robotics, a common type of fiducial marker is a printed black-and-white square that looks like a simple barcode. Software finds the square in a camera image, reads its ID number, and works out where the camera is relative to it. Common uses include:

What a fiducial marker does

Fiducial markers make it easy for a computer to match points in the real world to points in an image. Finding these matches using natural features of a scene is often hard, so people add markers that are easy to find.[6]

The word fiducial comes from the Latin fiducia, meaning trust.[1]

A fiducial marker system usually has three parts.[7]

  • Markers. Patterns printed or fixed in the scene, with a known size and shape.
  • A detection algorithm. Software that finds the markers in each image.
  • A coding system. Rules that give each marker an ID and catch reading errors.

From one image, a visual fiducial system reports which marker it sees and the marker's position and orientation relative to the camera. It can also find several markers in the same image.[2]

Parts of a square marker

Many modern markers are squares with a wide black border around a grid of black and white cells. The border lets software find the marker fast, and the inner grid holds the marker's ID as binary bits.[6] A marker with a 4 by 4 inner grid holds 16 bits.[6]

Anatomy of a square binary fiducial marker white margin black border data bits (4 × 4 = 16 bits) four corners (used for pose) ID = position in the dictionary
A square binary fiducial marker is a 6 by 6 grid. A one-cell black border surrounds a 4 by 4 grid of data bits, and a white margin surrounds the whole marker. The four outer corners give the camera pose, and the marker's ID is the position of its bit pattern in the dictionary.

The set of markers an application uses is called a dictionary.[6]

A marker's ID is its position in the dictionary list, not the binary number its bits spell out. So the first five markers have IDs 0 to 4.[6]

In OpenCV, for example, the dictionary DICT_6X6_250 holds 250 markers with IDs 0 to 249.[6]

Each AprilTag design has both a black border and a white border. AprilTag measures a tag's size between the corners where these two borders meet, not from the outer edge.[8]

Markers compared with QR codes

Fiducial markers are related to 2D barcodes such as QR codes, but they are built for a different job.[2] A QR code carries data to a person who aims a phone at it. A fiducial marker carries little data but must be found automatically, from far away, and at an angle.

Property QR code Visual fiducial marker
Typical data Hundreds of bytes, such as a web address A few bits, perhaps 12
How it is read A person aims the camera and takes a fairly sharp image Found automatically, even when small, unevenly lit, rotated, or in a cluttered image
Position output Position in the image does not matter Gives the marker's position and orientation relative to the camera

Source for the table: Olson (2011).[2]

How detection works

Detection turns a raw camera image into a list of markers, each with an ID and four corner positions. OpenCV's ArUco module works in these steps.[6]

  1. Threshold. Adaptive thresholding turns the image into black and white regions. It uses a black-and-white cutoff that changes across the image to follow local brightness.
  2. Find candidate squares. The software traces region outlines and keeps only those that are convex (no part of the outline bends inward) and close to a four-sided shape. It drops shapes that are too small, too large, or too close to others.
  3. Remove perspective. A perspective transformation maps each candidate to a flat, front-on square.
  4. Read the bits. The flat square is split into a grid of cells, and each cell becomes a 0 or 1 by majority of its black or white pixels.
  5. Check the code. The border cells must be black, and the inner bits are looked up in the dictionary, with error correction when needed.
Fiducial marker detection pipeline 1011 0100 1101 0010 Corners ID found in dictionary Camera image Threshold Find candidate squares Remove perspective Read bits and look up
Detecting a square marker: threshold the image, keep four-sided outlines as candidates, warp each candidate to a front-on 6 by 6 grid, then read its inner 4 by 4 bits and match them against a dictionary to find the ID. The four-sided outline gives the four corner points.

An optional extra step moves each corner to sub-pixel accuracy, meaning a position finer than one pixel. It takes time, so OpenCV turns it off by default.[6] It matters mainly when corners must be accurate, as in pose estimation (finding an object's position and orientation from an image).[6]

Other detectors find the square's edges differently. The image gradient is the direction and strength of brightness change at each pixel.[2]

Detector How it finds edges Changes in lighting
ARToolKit One fixed brightness cutoff set by the user Not robust
ARTag Image gradient Robust
AprilTag Image gradient Robust

Source for the table: Olson (2011).[2]

Olson notes that ARToolKit's fixed cutoff is very fast.[2]

Codes and error correction

A marker's bits can be misread because of blur, glare, or a partly hidden marker. The coding system makes sure a few wrong bits do not turn one marker into another, or turn a random pattern into a false detection.

Hamming distance

The Hamming distance between two bit strings is the number of positions where they differ.[9] The minimum Hamming distance of a dictionary is the smallest such distance between any two of its markers.[6]

Hamming distance between two 4 by 4 marker codesCode ACode BHamming distance = 3
Two 4 by 4 marker codes, with dark cells as 1 and white cells as 0. They differ in three cells, marked with orange rings, so their Hamming distance is 3.

A code with minimum distance dd can be used in two separate ways.[9]

detect only: up to d−1 errorsorcorrect: up to ⌊d−12⌋ errors\text{detect only: up to } d - 1 \text{ errors} \qquad \text{or} \qquad \text{correct: up to } \left\lfloor \frac{d-1}{2} \right\rfloor \text{ errors}

Here dd is the minimum Hamming distance, and ⌊⋅⌋\lfloor \cdot \rfloor means rounding down to a whole number. A codeword is one of the bit patterns the coding system accepts. Correction works by decoding a misread pattern to the nearest valid codeword, while detection only flags that something is wrong.[9]

For example, a dictionary with d=10d = 10 can correct up to 4 wrong bits, and one with d=4d = 4 can correct up to 1.

Correcting more bits raises the risk of false detections. The AprilTag code warns that accepting many corrected bits greatly increases false positives, and OpenCV gives the same warning for its maximum number of corrected bits.[10][6] AprilTag lets the user set this threshold to trade false positives against missed markers.[2]

Rotation and false positives

A camera can see a square marker turned by 90, 180, or 270 degrees, and each turn reads as a different bit string. AprilTag's code generator therefore checks that all four rotations of each code keep the required Hamming distance from every other code.[2]

One fiducial marker data grid in four rotations0°90°180°270°1100 1010 0011 10001011 0001 0110 01000001 1100 0101 00110010 0110 1000 1101same marker, four different bit strings
The same 4 by 4 marker data grid turned clockwise in 90° steps. Dark cells are 1 and white cells are 0. Read row by row, each rotation gives a different 16-bit string, so a detector has to check all four orientations.

Some codes are poor choices even when their distances are large. An all-zero code would look like a plain black square, a shape that often appears by chance in real scenes. AprilTag rejects codes whose patterns are too simple, and ARTag forbids two codes for the same reason.[2]

Code families

Different systems pick their codes in different ways. A checksum is a set of extra bits computed from the data that reveal a misread.

System How codes are built Error protection or design goal
ARTag A 36-bit word stored in each marker[11] Checksums and forward error correction protect the ID[11]
AprilTag Lexicode method that tests candidate codes one by one and keeps each one far enough from all codes already kept[2] Keep the minimum distance under all four rotations and reject overly simple patterns[2]
ArUco Generated dictionaries[12] Maximize the distance between markers and the number of bit changes inside each marker[12]

The 2011 AprilTag paper compared several 36-bit codes. AprilTag names a family by its bit count and minimum distance, so 36h10 has 36 bits and a minimum Hamming distance of 10.[2]

Code Bits Unique codes Minimum Hamming distance
ARToolKitPlus (simple) 36 512 4
ARToolKitPlus (BCH) 36 4,096 2
ARTag 36 2,046 4
AprilTag 36h9 36 4,164 9
AprilTag 36h10 36 2,221 10

More bits give better coding but cost range, because each bit cell is smaller on a printed marker of the same size. Olson estimated that 16-bit tags give only about 25% more detection range than 36-bit tags, because the border adds a fixed overhead.[2]

Finding the camera pose

The pose of a marker is its position and orientation relative to the camera. This takes six numbers: three for position and three for rotation. A single square marker is enough to find it, because its four corners give enough matched points.[6][2]

Camera pose relative to a square fiducial marker zc xc yc Image plane u, v x y z Marker (known side length) R (rotation) t (translation) Pose = R, t
The pose of a square marker relative to a camera is a rotation RR and a translation tt. Dashed rays run from the optical center (the point in the camera where image rays are treated as starting) through the corner points (u,v)(u, v) on the image plane (the flat surface where the image forms) to the marker's corners, and with the camera's calibration and the marker's known side length these four matched corner pairs give the pose.

What the camera must know

Pose estimation needs two facts besides the image.[2][6]

  • The camera's calibration. This is a 3 by 3 camera matrix holding the focal lengths (lens values that set how wide the camera sees) and image center, plus lens distortion values (which describe how the lens bends or warps the image). It is found once by camera calibration and stays valid unless the optics change, for instance when the focus changes.
  • The marker's real size. The side length sets the scale. The computed position comes out in the same units, such as meters.

The homography

A homography is a 3 by 3 matrix that maps points on a flat surface to points in an image. For a marker, it maps marker-plane coordinates (x,y)(x, y) to pixel coordinates (u,v)(u, v) up to an unknown scale.[2]

[uv1]≃H[xy1],H=s K[r1r2t]\begin{bmatrix} u \\ v \\ 1 \end{bmatrix} \simeq H \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}, \qquad H = s\,K \begin{bmatrix} \mathbf{r}_1 & \mathbf{r}_2 & \mathbf{t} \end{bmatrix}
  • HH is the homography, computed from the four corners with the direct linear transformation.
  • ≃\simeq means equal up to a scale factor.
  • KK is the camera matrix from calibration.
  • r1\mathbf{r}_1 and r2\mathbf{r}_2 are the first two columns of the rotation matrix, a matrix that represents the rotation between the camera and the marker.
  • t\mathbf{t} is the translation vector, which represents the offset in position between the camera and the marker.
  • ss is an unknown scale factor.

The third rotation column drops out because every point on the marker has z=0z = 0 in the marker's own coordinates.[2] Once HH and KK are known, the rotation and translation can be recovered from HH.

Solving in practice

Libraries usually treat the four corners as a Perspective-n-Point problem, which finds the pose from known 3D points and their image positions. OpenCV does this with its solvePnP function and returns a rotation vector and a translation vector for each marker.[6]

A flat marker can give two different poses that fit the image almost equally well. Schweighofer and Pinz showed that this ambiguity exists even with wide-angle lenses and close targets.[13] It is hardest to resolve when the corner positions are noisy.[14]

Accuracy

The main factor in accuracy is how large the marker appears in the image, which depends on its distance and its angle to the camera.[2]

In the 2011 paper's simulated tests, AprilTag kept working at more than twice the range of ARToolKitPlus. Real-world results are lower than simulated ones because of noise, lighting, lens distortion, and markers that are not perfectly flat.[2]

Marker boards

Several markers can be printed in a fixed layout, called a board, and used together to find one pose. A board still works when some of its markers are hidden.[6]

A ChArUco board combines ArUco markers with a chessboard pattern. The markers identify each corner and allow partial views, while chessboard corners can be located more precisely because each one sits between two black squares.[5] OpenCV recommends ChArUco boards over plain marker boards when high precision is needed, as in camera calibration.[5]

A ChArUco boardArUco marker (gives ID)chessboard corner (precise point)
A ChArUco board is a 5 by 4 chessboard with a distinct ArUco marker in each white square. The markers give each square an ID, and the 12 interior chessboard corners (red dots) give precise points.

Uses

  • Augmented reality. Markers on real objects let software overlay computer-generated images in the right place.[2] ARToolKit was first built for an augmented reality conferencing system, and also used markers to calibrate head-mounted displays.[15]
  • Robot localization (finding a robot's position). Markers can add to or replace satellite navigation, visual-inertial odometry (tracking motion from a camera combined with motion sensors), or SLAM when these are unavailable or not accurate enough.[3]
  • Drone landing. Markers mark landing platforms, including platforms on moving ground vehicles.[4]
  • Testing robots. Markers give ground-truth robot paths (reference paths known to be accurate, used to check other methods) and help evaluate SLAM algorithms under controlled conditions.[2]
  • Commands to robots. A person can show a robot a card that means "follow me" or "wait here".[2]
  • Motion capture. Markers can be used for basic motion capture.[2]
  • Camera calibration. Boards of markers give many precise, labeled points for calibrating a camera.[5]

History

Square markers with a black border and an inner pattern date to the late 1990s. Kato and Billinghurst's 1999 paper, which introduced ARToolKit, cites earlier work by Rekimoto on 2D matrix markers and by Klinker on square markers.[15] Olson describes ARToolKit as among the first tag tracking systems.[2]

Year System Main contribution
1999 ARToolKit (Kato, Billinghurst) Square marker with black border; ID found by matching the inner image, such as a letter, against stored templates[15][2]
2005 ARTag (Fiala) 36-bit digital code with checksums and forward error correction; edge-based detection that copes with lighting changes and partial hiding[16][11]
2011 AprilTag (Olson) Fully documented open system; codes that keep their distance under rotation; gradient-based line detection[2]
2014 ArUco (Garrido-Jurado and others) Configurable dictionaries that maximize distance between markers; a method for handling markers hidden by hands or objects[12]
2016 AprilTag 2 (Wang, Olson) Redesigned detector with better robustness and efficiency[17]
2019 AprilTag 3 (Krogius, Haggenmiller, Olson) Flexible layouts, including circular tags and tags with a hole; a detector more than twice as fast[18][8]

Fiala presented ARTag at the 2005 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).[16]

A National Research Council of Canada report from 2004 describes a revised version and further tests.[11]

ARTag's success led ARToolKit to adopt digital codes in ARToolKitPlus and later Studierstube Tracker.[2]

Other designs and limits

Other marker designs

Not every marker is a black-and-white square.

  • Colored markers. They can be faster to detect and give fewer false positives, but they are less robust at long distances and steep angles.[4]
  • Circular features. STag adds a circle inside a square border and fits an ellipse to it to refine the pose, which steadies the result.[4] AprilTag 3 includes circular tag families.[8]
  • Light-emitting diode (LED) markers. Overhead cameras can track robots fitted with blinking LEDs. Printed tags are cheaper and give a full pose without needing several LEDs.[2]
  • Retroreflective markers. Commercial motion capture systems track markers that reflect infrared light. They are more accurate than printed fiducials but need fixed cameras.[19]
  • Learned detectors. Systems such as DeepTag use deep learning (a computer method that learns patterns from many examples) to detect markers and to design new marker patterns.[7]

Limits

  • The marker must be in the camera's view, and accuracy drops as it appears smaller or at a steeper angle.[2]
  • ARToolKit's detector cannot handle even modest hiding of the marker's border.[2]
  • A single flat marker can give an ambiguous pose.[13]
  • Processing cost differs between systems. In a 2020 test on small computers, AprilTag used the most computing power, and ArUco was the most suitable choice for a Raspberry Pi.[4]

Fiducial marks in other fields

The same idea of a known reference mark appears outside computer vision.

Circuit boards

On a printed circuit board, fiducial marks are etched in the same step as the circuit pattern. Assembly machines such as pick-and-place machines locate them with cameras to find the circuit's exact position.[20]

  • Global fiducials locate the whole board. Two marks correct position and rotation, and three marks also correct scaling, stretch, and twist.
  • Local fiducials locate one component that needs extra precision, such as a fine-pitch chip (a chip whose pins are very closely spaced). Two marks are placed diagonally across its pads.
  • Shape and size. The best mark is a solid filled circle, 1 mm to 3 mm across, with a clear area around it.

Source for the list: Fiducial Mark Design Guidelines.[20]

Fiducial markers on a printed circuit board Global fiducials Local fiducials Fine-pitch chip
Three global fiducials in an L at the lower-left, upper-left, and lower-right corners of a circuit board set the board's coordinate frame. Two local fiducials at opposite corners of a fine-pitch chip's pad area let the placement machine align that part more precisely.

Chip making

Chips are built on wafers, which are thin sheets of material. Wafers carry alignment marks used during photolithography. Each new patterning step locates these marks so that its layer lines up with the layers beneath.[1]

Radiation therapy

In image-guided radiation therapy for prostate cancer, small markers are implanted in the prostate to show its position. They have been used since the 1990s.[21]

Gold markers are used most often because they are widely available and show up on the X-ray images used for guidance.[21]

Most studies use three markers placed in a triangle.[21]

References

  1. Fiducial markers, IEEE Technology Navigator.
  2. AprilTag: A robust and flexible visual fiducial system, Edwin Olson, IEEE International Conference on Robotics and Automation, 2011.
  3. Fiducial Markers for Pose Estimation: Overview, Applications and Experimental Comparison of the ARTag, AprilTag, ArUco and STag Markers, Michail Kalaitzakis and others, Journal of Intelligent & Robotic Systems, 2021.
  4. Experimental Comparison of Fiducial Markers for Pose Estimation, Michail Kalaitzakis, Sabrina Carroll, Anand Ambrosi, Camden Whitehead, Nikolaos Vitzilaios, International Conference on Unmanned Aircraft Systems, 2020.
  5. Detection of ChArUco Boards, OpenCV documentation.
  6. Detection of ArUco Markers, OpenCV documentation.
  7. DeepTag: A General Framework for Fiducial Marker Design and Detection, arXiv, 2021.
  8. AprilTag 3 repository README, AprilRobotics, GitHub.
  9. Linear Error-Correcting Codes, course notes for MIT 18.310, Massachusetts Institute of Technology, 2015.
  10. apriltag.h source file, AprilRobotics, GitHub.
  11. ARTag Revision 1, A Fiducial Marker System Using Digital Techniques, Mark Fiala, National Research Council of Canada, 2004.
  12. Automatic generation and detection of highly reliable fiducial markers under occlusion, S. Garrido-Jurado, R. Muñoz-Salinas, F. J. Madrid-Cuevas, M. J. Marín-Jiménez, Pattern Recognition, 2014.
  13. Robust pose estimation from a planar target, Gerald Schweighofer and Axel Pinz, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2006.
  14. Resolving Marker Pose Ambiguity by Robust Rotation Averaging with Clique Constraints, arXiv, 2019.
  15. Marker Tracking and HMD Calibration for a Video-based Augmented Reality Conferencing System, Hirokazu Kato and Mark Billinghurst, 2nd IEEE and ACM International Workshop on Augmented Reality, 1999.
  16. ARTag, a Fiducial Marker System Using Digital Techniques, Mark Fiala, IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR), vol. 2, pp. 590 to 596, 2005.
  17. AprilTag 2: Efficient and robust fiducial detection, John Wang and Edwin Olson, IEEE/RSJ International Conference on Intelligent Robots and Systems, 2016.
  18. Flexible Layouts for Fiducial Tags, Maximilian Krogius, Acshi Haggenmiller, Edwin Olson, IEEE/RSJ International Conference on Intelligent Robots and Systems, 2019.
  19. Mobile MoCap: Retroreflector Localization On-The-Go, arXiv, 2023.
  20. Fiducial Mark Design Guidelines, Solutions Manufacturing.
  21. Fiducial marker guided prostate radiotherapy: a review, British Journal of Radiology, 2016.

Figure