| ||||||||||||||||||||||||
Phase 4: April Tag ResearchApril Tag FamiliesApril Tags are a kind of fiducial marker, namely something that an imaging system can identify. They resemble QR codes. OpenCV has a built-in set of ArUco dictionaries and markers of various pixel sizes. These work well for small fast-recognition tags, ideal for indoor environments. However, they do not contain any error-correction capabilities (ie a hamming distance built into the tag set), and I think this is something I will need for an outdoor environment. April tags come in several families. They differ by the number of bits they use and the hamming distance used during the code families creation. Here are three examples:
correctable bits = (hamming distance -1)/2 The higher the number of bits, the better the reliability so the tag36h11 family is the most resilient to errors. I'm unclear about the extra processing overhead so I will go with tag25h9 initially, knowing it is possible to upgrade later if reliability becomes an issue. Sizing of April TagsThe larger the physical tags, the easier they are to detect at a distance. The chances of error are also smaller as blade of grass obscuring a large white square will be less likely to cause a problem than the same grass in fron of a small white square. From reading around, I believe a 10-15cm tag would be suitable for detection at a couple of metres. I will start with 10cm tags in the tag25h9 family. This gives options to increase the tag size or move to a more resilient family, but this seems a good compromise as an intial starting point. Generation of April TagsIt is possible to download pre-generated tags. (See: https://github.com/AprilRobotics/apriltag-imgs/tree/master) but I will endevour to create them with openCV, as its all part of the learning process! See directory src/tools/april_tags. Using the april_tag_generator.py, you can genarate a single tag like this: python april_tag_generator.py --family 25h9 --tagid 2 Currently, the only families supported are 16h5, 25h9 and 36h1. You can allocate any id you choose. This generates two directories, one saves a small png, the other an associated svg file. These will be named according to the family and id supplied: apriltag_25h9_2.png|svg. Svgs allow for scaling without loss of resolution so you can use the SVG to create an april tag of any physical dimension required. Scaling and Resizing apriltags for PrintingI decided to use 12cm apriltags which include the white border giving a 10cm actual tag. To generate this use: python resize_svg svg/file.svg --size=12cm This creates a 12cm directory with the scaled SVG file. Open this is a browser to print it. Bulk creation/resizingThere are two wrapper scripts that print then resize 16 apriltags. The family and size can be adjusted accordingly: bulk_tag_creation.sh bulk_resize.sh I 3D printed some adjustable tag stands, printed a few april tags and we are good to go. ![]() With April Tag generation and production, in hand, we can move on to using them. June 2026 | ||||||||||||||||||||||||
| ||||||||||||||||||||||||