Module: aprilTags

Module to identify AprilTags in an image.

This code uses AprilTags Java code found in $PTII/edu/umich/eecs/april.

The AprilTags code developed by the APRIL robotics lab under the direction of Edwin Olson (ebolson@umich.edu).

The Java implementation of the AprilTags detector is provided for convenience as a demonstration. It is an older version implemented in Java that has been supplanted by a much better performing C version. If your application demands better performance, you will need to replace this implementation with the newer C version and using JNI or JNA to interface the C version to Java.

For details about the C version, see https://april.eecs.umich.edu/wiki/index.php/AprilTags-C

https://april.eecs.umich.edu/software/apriltag.html contains a set of pregenerated tags as png and PostScript files. However, these are of low resolution. To scale them, use linear interpolation to avoid blurring.

For example, with ImageMagik, use:

mogrify -scale 1000x1000 .png; convert .png tag36h11.pdf

Or, search the web for "tag 36H11".

In the Ptolemy tree, a sample file may be found at $PTII/ptolemy/actor/lib/jjs/modules/aprilTags//demo/AprilTags/tag36_11_00586.pdf

Author:
  • Edward A. Lee
Source:

Methods

(static) filter(image, options)

Invoke the AprilTag detector on the specified image with the specified options and return the result. Any unrecognized options are ignored. Note that previously applied options for a given filter will still be used, even if they are not set in this call.

Parameters:
Name Type Description
image

The image to filter.

options

An object whose fields specify filter options.

Source:
Returns:

The filtered image.

(static) tags()

Return an array of tags detected by the most recent call to filter(). The returned value is null if there has been no call to filter(). Otherwise, it is an array of objects with the following fields:

  • id: The ID of the detected tag.
  • center: An array with two doubles giving the center of the tag in pixel coordinates.
  • perimeter: An array with four arrays, each of which gives the x and y coordinates of a corner of the AprilTag, listed in a counter-clockwise direction.

Source:
Returns:

The detected tags.