AI for Body Part Recognition
-
Introduction
You can use AI to recognize the key body parts of a person standing in front of the camera — such as their eyes, nose, shoulders, arms, and legs. This type of detection can be useful in many applications, especially for estimating a person’s pose (e.g., standing, sitting, or raising a hand).
The AI Block
To start detecting body parts, run this block:
This block turns on your computer’s front-facing camera and begins scanning for one or more people in the frame. Detected body parts are identified and their attributes are stored in a data table.Let’s break down the 3 input parameters:
Single Person
- If this is set to “Yes”, the AI will only track one person, even if there are multiple people in view.
- If set to “No”, the AI will report all detected people.
- In most cases — especially when the program is intended for a single user — choose “Yes”.
Result Table
This option determines where the detection results are stored. You can either:
- Use the default table (created automatically), or
- Select/create a custom table.
The table includes 6 columns and 21 rows per person: the first 17 rows correspond to individual body parts, and the last 4 rows represent the 4 limbs.
- First 17 Rows (Body Parts)
These rows store data only in the first 4 columns:-
The ID column is a unique identifier for each detected person. You can ignore it if your program only works with a single person.
-
The part column contains the name of the body part. Here is the full list: nose, left_eye, right_eye, left_ear, right_ear, left_shoulder, right_shoulder, left_elbow, right_elbow, left_wrist, right_wrist, left_hip, right_hip, left_knee, right_knee, left_ankle, right_ankle.
-
The X and Y values are the x and y positions of that part in the camera image. For example, if the nose is at the center of the image, then its x and y positions will both be 0.
||40
- Next 4 Rows (Limbs)
For each person that’s detected, the 4 rows below the 17 rows will use:
- Columns 1 & 2: ID and part
- Columns 5 & 6: curl and dir
The meanings of these columns:
-
The ID column is still the unique ID for each detected person.
-
The part column contains name of the limb: “left_arm”, “right_arm”, “left_leg”, “right_leg”.
-
The curl column (the 5th column) tells us the curling (bending) angle of that limb. If that limb is extended in a straight line, then its curling angle is close to 180 degrees. If that limb is curled at the elbow or knee, then this angle will be much smaller.
-
The dir column (the 6th column) tells us the direction of that limb. For arms, this is the direction of the line from the shoulder to the elbow (the wrist is not considered here). For legs, this refers to the direction from the hip to the knee (the ankle is not included).
For example, in this picture of Superman,- Both arms are bent ≈ 90°, both legs are straight ≈ 180°
- All limbs are pointing downward.
️ Debug Mode
If Debug is set to “yes”, visual markers (dots and lines) will be drawn over the camera image to show the detected body parts.
If “no”, the video feed is shown with no overlays.
Example - Two People from a Picture
If you set single-person to “no”, the AI will detect and track multiple people at the same time.
If you move the camera, both people will be recognized continuously in real-time.
Each person will generate 21 rows in the table — so with two people, the result table will contain 42 rows.