Object Tracking Example
HUSKYLENS 2 object tracking lets you select a target with a bounding box, then upload a Mind+ program to read ID, name, center X/Y, width and height in real time, like giving each object a labeled GPS dot on screen.
1. Object Tracking Code Example
Before You Start:
1.1 Tracking Objects and Outputting Related Data
When HUSKYLENS 2 detects a trackable target object, related tracking data can be obtained. The available data include the object ID, name, center point X/Y coordinates, width, and height.
The example program is shown below.

In Mind+, click Upload to Device and wait for the program upload to complete.
Point the Camera of HUSKYLENS 2 at the object to be tracked (the tracking target must be selected by drawing a bounding box first; for details, refer to the Object Tracking.
After the selection is completed, aim the camera at the target object to be tracked and observe the output results.
Running Result: The tracked object’s ID, name, X/Y coordinates, width, and height can be output. The object name is "Object" by default and can be modified.
1.2 Object Tracking Blocks Description
| block | Description |
|---|---|
|
Used to obtain one set of Object Tracking data under the Object Tracking function of HUSKYLENS 2. |
|
Determines whether there is a trackable target in the current frame. |
|
Obtains data for the object closest to the crosshair on the screen, including object ID, name, center X coordinate, center Y coordinate, width, and height. |
Was this article helpful?
