This component detects the ID and rotation of a marker by reading a circular barcode around previously detected particles. Both ID and rotation of a barcode are determined by correlating the barcode with all potential codes, which are defined in an XML file that looks as follows:

  <?xml version="1.0"?>
      <object id="1">
          <chips length="14" symbol="15" />
      <object id="2">
          <chips length="14" symbol="332" />
      <object id="3">
          <chips length="14" symbol="6822" />

The algorithm also determines a confidence level for each detection, which might be helpful to reject wrongly detected particles (false positives).

The algorithm proceeds in two steps:

  1. All pixels lying on a ring around the particle are indexed with their angle. Angle and radius of a pixel are calculated using the center of the pixel and the (potentially sub-resolution) particle position.
  2. The so indexed pixels are correlated with all IDs under all possible angles in 1 degree intervals.

The best match (highest correlation) is assigned to the particle.

Please refer to the IDReaderRing example for scripts to generate suitable markers.

Note that the algorithm assumes a perfectly circular barcode, and therefore doesn't perform very well under large deformations. In addition, even though the algorithm is near-optimal in a well-configured setup, a fairly high resolution (and a well-focussed lens) is required to read such codes. E.g., 14-chip codes should appear as 20-by-20 pixels at least on the image.

Is there a specific name for this kind of marker code? Is it maybe a Wikipedia: ShotCode or some other Wikipedia: 2D barcode?


File:SwisTrack IDReaderRingMarkers.png

A set of particles detected with e.g. the BlobDetectionCircularHough component, plus a grayscale image with the circular barcodes. Note that the particle center must lie in the center of the circular barcode.


The same set of particles, augmented with the ID, orientation and confidence value.


Outer radiusEdit

The outer radius of the ring.

Inner radiusEdit

The inner radius of the ring. Note that the inner radius should be chosen such as the blob in the center of the marker (if any) is not part of the ring.

Objects and codesEdit

XML file with the object list (see description above).