Hand Recognition Example

HuskyLens 2 gesture blocks detect, count, and label hand poses, then expose rich keypoint data for wrists and fingers. It’s like giving the camera a map of every hand in view, with IDs for learned gestures and 0 for unknown ones.

1.Hand Gesture Recognition Blocks

Before You Start:

1.1Hand Gesture Recognition - Output Relevant Data

It can detect hand gestures within the HuskyLens 2 field of view and acquire gesture-related data. Readable data includes: the total number of gestures detected in the frame, the ID of the gesture closest to the center of the HuskyLens 2 camera frame, and the ID of the first detected gesture.

Example Program:

Interface Diagram

Click to upload the program to the device in Mind+, and wait for the upload to complete.
Point the HuskyLens 2 camera at the gesture in the frame to learn it. For detailed instructions on how to learn gestures, refer to Hand Recognition.

Once learning is complete, aim at the gesture and observe the output results on the UNIHIKER K10 screen.

Output Result:It can output the total number of detected gestures. All detected gestures will be counted (i.e., framed by a box), whether they have been learned or not. It can output the corresponding gesture ID as required. Learned gestures are assigned IDs in learning order, while unlearned gestures have an ID of 0.

Interface Diagram

1.2 Get Data for a Specific Gesture

It can acquire keypoint data for a specific gesture, such as its ID, Name, fingers, and wrist. Detailed data includes: Gesture ID, Gesture Name, X and 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. For details, please see the Hand Gesture Recognition Blocks Description.

The example program below shows how to get the X/Y coordinate data for the wrist and the tips of all five fingers for the gesture closest to the center of the camera frame. This data can also be obtained for unlearned gestures.

Interface Diagram

Output Result: As shown below, after running the program, the UNIHIKER K10 screen displays the Gesture ID and the keypoint data for that gesture. Since this gesture has not been learned, the Gesture ID is 0.

Interface Diagram

In addition to the data above, more data for a specific gesture can be acquired. For example, determining if a specific gesture is in the frame, the name of a specific gesture, or the count of identical gestures in the frame.

When multiple identical gestures appear, it's possible to specify and acquire parameters for one of them, including Name, gesture center X/Y coordinates, Width, Height, fingertip coordinates, wrist coordinates, and more.

Example Program:

Interface Diagram

Output Result: As shown, it can acquire the count and name of Gesture ID 1 in the frame, and the coordinate position of the first detected Gesture ID 1.

Interface Diagram

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?

TOP