HUSKYLENS 2 Tag Recognition Function Description
The article details HUSKYLENS 2's capability to recognize AprilTag labels, providing insights into setup and usage. It explains how to select tag recognition functions, observe detection effects, learn and name tags, and adjust parameters. It also covers exporting and importing models to facilitate tag recognition across devices.
1.Introduction to Tag Recognition
AprilTag is a Visual Fiducial System developed by the APRIL Laboratory of the University of Michigan, consisting of black and white square patterns. Each tag contains a unique ID and is widely used in augmented reality (AR), robot navigation, camera calibration, drone positioning, and other fields. AprilTag labels are divided into multiple types, each with different coding structures and capacities. Common types include: TAG16H5, TAG25H7, TAG25H9, TAG36H10, TAG36H11, and ARTOOLKIT.
Under the Tag Recognition function, HUSKYLENS 2 can detect four types of AprilTag labels: AprilTag 16h5, AprilTag 25h9, AprilTag 36h10, AprilTag 36h11, enabling you to learn, recognize, and track specified tags.
2.Tag Recognition Instructions
In this section, we will learn to use HUSKYLENS 2 to detect AprilTag labels in images and recognize specific AprilTag labels.
Note: When using the tag recognition feature, HUSKYLENS 2 defaults to recognizing the tag type as APRIL_TAG36H11. You can manually configure other tag types in the Dict parameter (tag type configuration dictionary). The actual tag type used during recognition must match the type set in the Dict parameter.
2.1 Select Tag Recognition Function
Power on HUSKYLENS 2 and after successful startup, swipe the screen to find the "Tag Recognition" function.
2.2 Observe Tag Detection Effect
Direct HUSKYLENS 2 toward the image containing AprilTag labels. All detected tags will be enclosed by white bounding boxes, and the information contained in each tag will be displayed on the bounding box.
2.3 Learn a Tag and Observe the Result
Align HUSKYLENS 2 with the specified AprilTag label you want to learn. Adjust the angle of HUSKYLENS 2 so that the "cross" in the middle of the screen is within the white bounding box, then press the A key in the upper right corner of HUSKYLENS 2 to learn this tag.
After learning an AprilTag, if a previously learned AprilTag is detected, the screen will enclose it with a colored bounding box and display "name: IDx" above it, where "name" defaults to the text content inside the tag. To learn more AprilTag markers, repeat the same process.
3.Tag Recognition Parameter Settings
HUSKYLENS 2's factory default parameters already meet basic functional requirements. For more detailed functionality, individual parameters can be adjusted manually. The following parameters all apply to the "Tag Recognition" feature, so first ensure you have entered the "Tag Recognition" interface, as shown in the figure.
To modify a parameter, slide left or right on the parameter text below the screen to select it.
3.1 Forget ID
To forget all previously learned AprilTag tags: Step 1: Tap "Forget ID" on the screen; Step 2: When the "Forget all IDs and names" pop-up is displayed, tap "Yes".At this point, align the "crosshair" in the center of the HUSKYLENS 2 screen with the previously learned but forgotten tag. A white box will appear on the screen, displaying the tag's information without showing its ID number. This indicates that the "forget" operation is completed.
3.2 Dict
When using the Tag Recognition function, the Dict parameter is used to select the type of AprilTag to detect. Currently, the supported tag types include: AprilTag 16h5, AprilTag 25h9, AprilTag 36h10, and AprilTag 36h11.
The actual tag type used for recognition must match the type set in the Dict parameter. As shown in the figure, the example tag is of the "AprilTag 36h11" type. If the actual tag type during detection does not match the target tag type set in Dict, HUSKYLENS 2 will fail to frame the tag in the screen.
3.3 Set Name
This parameter allows you to set names (both Chinese and English) for learned AprilTag tags.
Settings Steps:
- Tap "Set Name".
- Scroll up/down using the number display on the top-left to select which ID to name.
- Tap the on-screen keyboard to input the name (see the left image for an example).
- Once entered, tap the checkmark icon on the bottom-right to save. A green checkmark will appear on the top-right if saved successfully.
Note: After setting a name, the recognized tag information will no longer display in the top-left corner of the recognition frame; instead, the set name will show. To re-display the tag information, you need to "Forget ID".
3.4 Display Name
This parameter controls whether to display the name when a learned AprilTag is recognized, with the default being "On".
Setting Steps: Tap "Display Name". If the switch above is blue, it is in the "On" state—the name of the learned AprilTag will be displayed (as shown in the left figure). Tap the switch, which will turn white, entering the "Off" state, and the name will not be displayed when the learned AprilTag is recognized (as shown in the right figure).
3.5 Restore Default
This parameter restores all settings to their default state and clears the learned IDs, while preserving the exported models (see Exporting Models below for details).
Setting Steps: Click "Restore Default", then click "Confirm" in the "Restore Default Configuration" pop-up.
3.6 Export Model
This parameter saves and exports the current settings, learned IDs, and configured names to the local memory of the HUSKYLENS 2. It is applicable to scenarios such as migrating parameters to another HUSKYLENS 2. This operation does not require a TF card.
Export Steps: Click "Export Model". When the "Save Configuration To" pop-up window appears, scroll the number up and down to select which model number to save it as (up to 5 models can be saved). Then click the "Confirm" button at the lower-left corner of the pop-up to save. After confirmation, the export proceeds automatically, as shown in the figure.
View Exported Model: After the "Exporting" pop-up disappears, you can view the exported model files via your computer.
First, connect the HUSKYLENS 2 to your computer's USB port.
Next, use the path shown in the following figure to access the memory of HUSKYLENS 2 via your computer. You can view two model-related files with file extensions .json and .bin. The number preceding the extension indicates the "model number" selected when saving the configuration. Both files can be copied and pasted to other locations.
3.7 Import Model
This parameter allows importing the model exported by HUSKYLENS 2 (referred to as "Husky A" hereafter) to another HUSKYLENS 2 (referred to as "Husky B" hereafter), enabling Husky B to recognize the IDs of AprilTag markers learned by Husky A without needing re-learning.
Import Steps:
Step 1: Connect Husky A to the computer and copy the exported two files to the computer desktop.
Step 2: Connect Husky B to the computer and paste the two files from the previous step into the specified folder of Husky B, as shown in the figure. (If the "apriltag" folder cannot be found, please first perform Step 3; after the model is imported, this folder will be automatically created, and you can then return to Step 2.)
Step 3: First, confirm you have entered the "Tag Recognition" function. Then click "Import Model". Once the "Load Configuration" pop-up appears, slide the number slider up and down to select which model to load. This should match the model number saved in the previous step. For example, if the model files pasted into HUSKYLENS 2 are config1.json and repo1.bin, select number 1. Finally, click "Confirm" to import. Step 4: Wait until the "Loading" pop-up disappears, indicating the import is finished.
Then, you can perform tag recognition tests. The left image below shows the tag recognition status of HUSKYLENS B before model import, and the right image shows the status after importing the model.
Was this article helpful?
