SwisTrack/Components/IDReaderRing

Description
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:

  0           0           0

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: The best match (highest correlation) is assigned to the particle.
 * 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.

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 ShotCode or some other  2D barcode?

Input


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.

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

Outer radius
The outer radius of the ring.

Inner radius
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 codes
XML file with the object list (see description above).