Pose Recognition Example
HuskyLens 2 pose recognition lets micro:bit read how many poses are on screen and detailed data for each pose. It’s like turning every person into a labeled stick figure with coordinates. You can get total detected and learned poses, the center-closest pose, or the nth pose with a given ID, including box size and joint positions such as eyes, shoulders, elbows, wrists, hips, knees and ankles.
1. Pose Recognition Project Example
Before You Start:
1.1 Pose Recognition and Output Related Data
When pose recognition is enabled, human poses appearing on the HuskyLens 2 screen will be detected and framed, allowing you to access key data: total detected poses, total trained poses, center-closest pose, nth detected pose, and specified ID pose. This data includes the pose's ID, name, center coordinates (XY), width, and height.
Example program:
Connect to micro:bit and click Download to transfer the program. After successful download, click Show Data to activate data output mode. Align the HuskyLens 2 camera with a human pose to observe the output.
As shown, when HuskyLens 2 detects one previously trained poses named "pose" , the following data will display:
How to learn poses, please refer to the Pose Recognition.
Result: The serial port will output: total detected poses, ID of the center-closest pose, name of the first detected pose, and total the learned poses.
There are 2 detected poses, so the dot matrix display shows "2".
1.2 Obtaining Pose Recognition Feature Data
The system can capture pose feature and body keypoint data for any detected human pose. Key readable information includes: pose ID, name, width, height, center coordinates (X/Y), and coordinates for body joints including eye,ear,shoulders, elbows, wrists, hips, knees, and ankles.
For instance, the sample program below retrieves pose feature data of human poses positioned near the camera's center; this functionality works even for poses not previously learned.
Result: As shown, click "Download" to transfer the program to micro:bit. After successful download, click "Show Device" to activate data output. Align HuskyLens 2 with a human pose, and the serial port will display the pose ID along with coordinates of its key body joints.
1.3 Obtaining Data of a Specific Pose
When multiple human poses with the same ID appear simultaneously, the program can count their occurrences and retrieve data for the nth pose in the detected sequence.
Example program:
Result: As shown, click "Download" to transfer the program. Align HuskyLens 2 with two poses labeled ID 1. After activation, the serial port will output data statistics for these two poses, including their individual positions, dimensions, and body joint coordinates.
1.4 Pose Recognition Blocks Description
| block | Description |
|---|---|
|
Used to obtain one set of Pose Recognition data under the Pose Recognition function of HUSKYLENS 2. |
|
Determine if a human pose is present in the current frame. |
|
Retrieves data of the pose closest to the screen cross cursor, including pose ID, pose name, center X/Y coordinates, width, height, anddetailed body keypoint coordinates including eye, ear, shoulders, elbows, wrists, hips, knees, and ankles. |
|
Get the total number of poses detected on the screen, including both unregistered and registered poses. |
|
When multiple poses are detected, retrieves data for a specified pose. |
|
Get the total number of learned poses, regardless of whether they appear in the current frame. |
|
Determine if a pose with the specified ID exists in the frame. Unlearned IDs are uniformly set to 0, and learned IDs are sorted in learning order. |
|
Gets the total number of detected poses with a specified ID on the screen. |
|
When multiple poses are detected, retrieve the relevant data of a specified pose. |
|
When multiple poses with the same ID are detected, retrieve the relevant data of a specified pose. |
Was this article helpful?
