Pose Recognition Example

HUSKYLENS 2 pose recognition detects human bodies, assigns IDs, and returns coordinates and size for each pose; it’s like a smart camera that tags every joint on a person and lets your program query total detected bodies, learned pose count, whether a specific ID is in view, and detailed data for the closest or N‑th pose by index.

1. Pose Recognition Example

Before You Start:

1.1 Recognizing Human Poses and Outputting Related Data

Under the Pose Recognition function, HUSKYLENS 2 can recognize human bodies appearing in the frame and mark key body points. Through the program, the following data can be read: whether a human body is detected, the total number of detected human bodies, the total number of learned human bodies, as well as the ID, name, center point coordinates, width, and height of the N-th detected human body and the human body closest to the center of the frame.

The example program is shown below.

Interface Diagram

Upload the program. After the program is successfully uploaded, HUSKYLENS 2 enters the Pose Recognition function. Point the Camera of HUSKYLENS 2 at the human pose in the frame to perform learning. For detailed instructions on how to learn poses, please refer to the Pose Recognition.

Running Result: When one learned pose and one unlearned pose appear in the frame, the total number of detected human bodies can be output. The ID of a specified human pose can also be output. Learned poses are assigned IDs in the order of learning, while unlearned poses have an ID of 0.

Interface Diagram

1.2 Obtaining Data of a Specified Pose

When multiple poses with the same ID appear in the frame, the related data of a specified pose can be obtained. For example, you can determine whether a pose with a specified ID is present in the frame, obtain the number of poses with the same ID in the frame, and when multiple identical poses appear, specify and retrieve the related data of the N-th pose with that specified ID, including its name, X/Y coordinates, width, and height.

The example program is shown below:

Interface Diagram

Running Result: As shown in the figure, the number of poses with ID 1 in the frame, their name, and the coordinate position of the first detected pose with ID 1 can be obtained.

Interface Diagram

1.3 Pose Recognition Blocks Description

block Description
Used to obtain one set of pose recognition data under the Pose Recognition function of HUSKYLENS 2.
Determines whether human bodies exist in the current frame.
Get the related data of the human posture closest to the crosshair on the screen, including: Human posture ID, Human posture name, X coordinate of the center of the human posture, Y coordinate of the center of the human posture, Width, Height, X/Y coordinates of both eyes, ears, and nose, X/Y coordinates of both shoulders, elbows, wrists, hips, knees, and ankles.
Gets the total number of detected human bodies on the screen.
When multiple human bodies appear, obtain the data of a specified body by index.
Detect the number of poses that have been learned by HuskyLens 2, regardless of whether they appear in the current frame.
Determines whether a learned pose with a specified ID exists in the image. (After HUSKYLENS 2 learns poses, IDs are assigned sequentially.)
Obtains the number of learned poses with a specified ID in the current frame.
Obtains the data of a learned pose with a specified ID.
When multiple identical learned poses appear, obtain the data of a specified one by index.

Was this article helpful?

TOP