Hand Recognition Example
HUSKYLENS 2 hand recognition reads, counts and tracks learned or unlearned gestures by ID and coordinates, like a smart camera tagging every hand pose in view.
1. Hand Recognition Example Program
Before You Start:
1.1 Recognizing Hand Gestures and Outputting Related Data
Under the Hand Recognition function, HUSKYLENS 2 can detect hands in the frame and mark key points. Through the program, gesture-related data can be obtained. The readable data include: whether a hand is present in the current frame, the total number of detected gestures in the frame, the total number of learned gestures, as well as the ID, name, center point coordinates, width, and height of the gesture closest to the center of the HUSKYLENS 2 camera view and the N-th detected gesture.
The example program is shown below.
Upload the program and wait for the upload to complete.
HUSKYLENS 2 enters the Hand Recognition function. Point the Camera of HUSKYLENS 2 at the gestures in the frame to perform learning. For detailed instructions on how to learn gestures, please refer to the Hand Recognition.
Running Result: When one learned gesture and one unlearned gesture appear in the frame, the total number of detected gestures can be output. Regardless of whether the gesture has been learned, as long as a gesture is detected (i.e., framed), it will be counted. The corresponding gesture ID can be output as required. Learned gestures are assigned IDs in the order of learning, while unlearned gestures have an ID of 0.
1.2 Obtaining Related Data of a Specified Gesture in the Frame
You can determine whether a gesture with a specified ID exists in the frame, and obtain data such as the number of gestures with the specified ID, the name, and the center point coordinates, width, and height of the N-th gesture with that specified ID.
The example program is shown below.
Running Result: As shown in the figure below, when the program is running, the related data of the gesture with ID 1 can be observed in the output.
1.3 Hand Gesture Recognition Blocks Description
| block | Description |
|---|---|
|
Used to obtain one set of gesture recognition data under the Gesture Recognition function of HUSKYLENS 2. |
|
Determines whether gestures exist in the current frame. |
|
Gets data for the gesture closest to the on-screen crosshair, including Gesture ID, Gesture Name, X/Y coordinates of the gesture's center point, Width, Height, Wrist X/Y coordinates, and the X/Y coordinates for the base, joint, and tip of each finger. |
|
Gets the total number of gestures detected on the screen. |
|
When multiple gestures are detected, obtains the data of a specified gesture. |
|
Get the number of hand gestures that have been learned by HuskyLens 2, regardless of whether they appear in the current frame. |
|
Obtains the total number of gestures with a specified ID in the current frame. |
|
Obtains data for a gesture with a specified ID. |
|
When multiple gestures share the same ID, obtains the data of a specified gesture. |
|
Determines whether a gesture with the specified ID exists in the image. (After HUSKYLENS 2 learns gestures, IDs are assigned sequentially.) |
Was this article helpful?
