AR Tag Detection

DISCLAIMER:- If you want to run it in your system follow my blog.

Technologies used:- ROS, OpenCV, C++, Turtlebot3

Objective

Determining spatial relationships using a single camera has always been a big challenge in computer vision. There are several applications where calculating distance in real-time is absolutely essential. Especially in Mobile Robotics, knowing the environment plays a key role during navigating the robot. To get around this problem our project uses predefined set of fiducial markers to calculate the spatial relationship between camera and fiducial markers.

As the name suggests objective of the project is to detect and track custom AR tags in webcam or gazebo simulator. We used the ROS package named ar_track_alvar to achieve detection and tracking of AR tags. Following were the steps needed to proceed.

  1. Generating AR tags of varying size, resolution, and data/ID encoding
  2. Customising the generated AR tags for Gazebo environment (optional)
  3. Identifying and tracking the pose of individual AR tags using webcam or in Gazebo
  4. Identifying and tracking the pose of “bundles” consisting of multiple tags. This allows for more stable pose estimates, robustness to occlusions, and tracking of multi-sided objects. (optional)
  5. Using camera images to automatically calculate spatial relationships between camera and tags in Rviz.

AR Tags

An ARTag (Augmented Reality Tag) is a fiducial marker. There are many different types of AR tags, generated by different algorithms. Not all AR tag algorithms are equal as each have their own pros and cons. Some are less computationally intensive to generate and detect than others, while some are harder to detect than others at a distance. Some are not limited to black and white squared patterns, allowing some creativity in designing the looks of each tag.

AR tags are generally used in Augmented Reality applications, Robotics, UAVs, etc. For robotics applications, given the camera is calibrated and ARTag features are known, It’s very easy to calculate the position and orientation relative to camera in real-time.

Fiducial Markers
Fiducial Markers

I used April Tags in my application, which can be seen below.

April Tags
Examples of April Tags

Generating AR Tags

ROS package ar_track_alvar contains clear instructions on how to create custom AR Tags for your application. You can also download some default marker files from the above ROS wiki.

Converting AR Tags to AR Tag gazebo models (optional).

To generate AR Tag gazebo models from AR Tag images, follow readme file of this folder of the repo.

Challenges

image-1

image-2

As you can see in the video, the AR Tags are being tracked in space, with an RGB (xyz) Coordinate System applied to each square. Pretty cool!

References

ROS wiki for ar_track_alvar :- http://wiki.ros.org/ar_track_alvar

AR Tag models for gazebo :- https://github.com/mikaelarguedas/gazebo_models

https://nusit.nus.edu.sg/technus/ar-tags-and-their-applications-in-computer-vision-tasks/

Madhu Korada
Madhu Korada
MRSD Student

My research interests include Computer Vision, EdgeAI algorithms, ADAS and robotics.

Related