Hand Tracking
Tracks hands in real time from the camera video and provides the coordinates of 21 key points (finger joints). Includes left/right handedness, finger extension state, and gesture recognition.
Commands
| Command | Description |
| Hand Detected? | Checks whether a hand is detected. |
| Get Keypoint | Writes the X, Y, and Z coordinates of the specified key point. |
| Get Handedness | Writes whether the detected hand is the left or the right hand. |
| Get Finger State | Writes whether the specified finger is extended or bent. |
| Hand Exists in Zone | Checks whether a hand lies inside the Detection Zone. |
| Keypoint Exists in Zone | Checks whether the specified key point lies inside the Detection Zone. |
| Distance Between Keypoints | Writes the pixel distance between two key points. |
| Get All Keypoints | Writes the coordinates of all 21 key points as JSON. |
| Recognize Gesture | Classifies the hand gesture (e.g. fist, victory, thumbs-up) from the layout of the 21 key points and writes its name and ID. |
Settings
| Setting | Description |
| Confidence (%) | 0 to 100, default 50. |
| Key Point | The key point whose coordinates are read or whose presence in the zone is checked. One of 21. |
| Key Point 1 / Key Point 2 | The two key points whose distance is computed. |
| Finger | The finger whose state is checked: Thumb, Index, Middle, Ring, or Pinky. |
| Detection Zone | See Common Items. |
Output Variables
| Field | Type | Value |
| Detected | Digital | Result of Hand Detected?, Get Keypoint, Hand Exists in Zone, and Keypoint Exists in Zone. |
| Key Point X / Key Point Y / Key Point Z | Number | Coordinates of the specified key point. X and Y are pixel coordinates; Z is the depth value estimated by the model. |
| Handedness Value | Number | 0 for the left hand, 1 for the right hand, -1 when it cannot be determined. |
| Handedness Label | Text | left or right; an empty string when it cannot be determined. |
| Distance (pixels) | Number | Distance between the two key points. |
| Detected | Digital | For Distance Between Keypoints: true when both key points were detected and the distance was computed. |
| Finger State | Number | 0 for bent, 1 for extended, -1 when it cannot be detected. |
| Output (JSON Text) | Text | Array of the 21 key points. |
| Gesture Name | Text | English name of the recognized gesture; none when not detected. |
| Gesture ID | Number | Gesture number; -1 when not detected. |
JSON Output
An array with, per key point, id, name, x, y, and z. The sample shows only a few entries.
[
{ "id": 0, "name": "wrist", "x": 320, "y": 350, "z": 0 },
{ "id": 4, "name": "thumb_tip", "x": 280, "y": 310, "z": -15 },
{ "id": 8, "name": "index_tip", "x": 310, "y": 260, "z": -25 },
{ "id": 12, "name": "middle_tip", "x": 330, "y": 255, "z": -22 }
]
The 21 key points
| ID | JSON name | Shown as |
| 0 | wrist | Wrist |
| 1 | thumb_cmc | Thumb Wrist Joint |
| 2 | thumb_mcp | Thumb Knuckle |
| 3 | thumb_ip | Thumb Joint |
| 4 | thumb_tip | Thumb Tip |
| 5 | index_mcp | Index Knuckle |
| 6 | index_pip | Index 1st Joint |
| 7 | index_dip | Index 2nd Joint |
| 8 | index_tip | Index Tip |
| 9 | middle_mcp | Middle Knuckle |
| 10 | middle_pip | Middle 1st Joint |
| 11 | middle_dip | Middle 2nd Joint |
| 12 | middle_tip | Middle Tip |
| 13 | ring_mcp | Ring Knuckle |
| 14 | ring_pip | Ring 1st Joint |
| 15 | ring_dip | Ring 2nd Joint |
| 16 | ring_tip | Ring Tip |
| 17 | pinky_mcp | Pinky Knuckle |
| 18 | pinky_pip | Pinky 1st Joint |
| 19 | pinky_dip | Pinky 2nd Joint |
| 20 | pinky_tip | Pinky Tip |
The 33 gestures and their IDs
Gesture ID is the number in this table; Gesture Name is the English name.
| ID | Name | Meaning |
| 0 | call | Phone gesture (thumb and pinky extended) |
| 1 | dislike | Thumbs down |
| 2 | fist | Closed fist |
| 3 | four | Number 4 (thumb folded) |
| 4 | grabbing | Grabbing |
| 5 | grip | Grip |
| 6 | hand_heart | Finger heart (thumb and index) |
| 7 | hand_heart2 | Finger heart (alternate form) |
| 8 | holy | Prayer hands |
| 9 | like | Thumbs up |
| 10 | little_finger | Pinky extended |
| 11 | middle_finger | Middle finger extended |
| 12 | mute | Shush (index finger to lips) |
| 13 | ok | OK sign (thumb and index circle) |
| 14 | one | Number 1 (index extended) |
| 15 | palm | Open palm |
| 16 | peace | Peace / victory |
| 17 | peace_inverted | Inverted peace |
| 18 | point | Pointing (index finger) |
| 19 | rock | Rock (index and pinky) |
| 20 | stop | Stop (palm forward) |
| 21 | stop_inverted | Inverted stop |
| 22 | take_picture | Take-picture gesture |
| 23 | three | Number 3 |
| 24 | three2 | Number 3 (alternate form) |
| 25 | three3 | Number 3 (third form) |
| 26 | three_gun | Finger gun (three fingers) |
| 27 | thumb_index | Thumb and index extended |
| 28 | thumb_index2 | Thumb and index extended (alternate form) |
| 29 | timeout | Timeout (T shape) |
| 30 | two_up | Number 2 (two fingers up) |
| 31 | two_up_inverted | Inverted number 2 |
| 32 | xsign | X sign (two index fingers crossed) |