Get Started
Hand Tracking
On this page
  1. Commands
  2. Settings
  3. Output Variables
  4. JSON Output

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

CommandDescription
Hand Detected?Checks whether a hand is detected.
Get KeypointWrites the X, Y, and Z coordinates of the specified key point.
Get HandednessWrites whether the detected hand is the left or the right hand.
Get Finger StateWrites whether the specified finger is extended or bent.
Hand Exists in ZoneChecks whether a hand lies inside the Detection Zone.
Keypoint Exists in ZoneChecks whether the specified key point lies inside the Detection Zone.
Distance Between KeypointsWrites the pixel distance between two key points.
Get All KeypointsWrites the coordinates of all 21 key points as JSON.
Recognize GestureClassifies the hand gesture (e.g. fist, victory, thumbs-up) from the layout of the 21 key points and writes its name and ID.

Settings

SettingDescription
Confidence (%)0 to 100, default 50.
Key PointThe key point whose coordinates are read or whose presence in the zone is checked. One of 21.
Key Point 1 / Key Point 2The two key points whose distance is computed.
FingerThe finger whose state is checked: Thumb, Index, Middle, Ring, or Pinky.
Detection ZoneSee Common Items.

Output Variables

FieldTypeValue
DetectedDigitalResult of Hand Detected?, Get Keypoint, Hand Exists in Zone, and Keypoint Exists in Zone.
Key Point X / Key Point Y / Key Point ZNumberCoordinates of the specified key point. X and Y are pixel coordinates; Z is the depth value estimated by the model.
Handedness ValueNumber0 for the left hand, 1 for the right hand, -1 when it cannot be determined.
Handedness LabelTextleft or right; an empty string when it cannot be determined.
Distance (pixels)NumberDistance between the two key points.
DetectedDigitalFor Distance Between Keypoints: true when both key points were detected and the distance was computed.
Finger StateNumber0 for bent, 1 for extended, -1 when it cannot be detected.
Output (JSON Text)TextArray of the 21 key points.
Gesture NameTextEnglish name of the recognized gesture; none when not detected.
Gesture IDNumberGesture 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
IDJSON nameShown as
0wristWrist
1thumb_cmcThumb Wrist Joint
2thumb_mcpThumb Knuckle
3thumb_ipThumb Joint
4thumb_tipThumb Tip
5index_mcpIndex Knuckle
6index_pipIndex 1st Joint
7index_dipIndex 2nd Joint
8index_tipIndex Tip
9middle_mcpMiddle Knuckle
10middle_pipMiddle 1st Joint
11middle_dipMiddle 2nd Joint
12middle_tipMiddle Tip
13ring_mcpRing Knuckle
14ring_pipRing 1st Joint
15ring_dipRing 2nd Joint
16ring_tipRing Tip
17pinky_mcpPinky Knuckle
18pinky_pipPinky 1st Joint
19pinky_dipPinky 2nd Joint
20pinky_tipPinky Tip
The 33 gestures and their IDs

Gesture ID is the number in this table; Gesture Name is the English name.

IDNameMeaning
0callPhone gesture (thumb and pinky extended)
1dislikeThumbs down
2fistClosed fist
3fourNumber 4 (thumb folded)
4grabbingGrabbing
5gripGrip
6hand_heartFinger heart (thumb and index)
7hand_heart2Finger heart (alternate form)
8holyPrayer hands
9likeThumbs up
10little_fingerPinky extended
11middle_fingerMiddle finger extended
12muteShush (index finger to lips)
13okOK sign (thumb and index circle)
14oneNumber 1 (index extended)
15palmOpen palm
16peacePeace / victory
17peace_invertedInverted peace
18pointPointing (index finger)
19rockRock (index and pinky)
20stopStop (palm forward)
21stop_invertedInverted stop
22take_pictureTake-picture gesture
23threeNumber 3
24three2Number 3 (alternate form)
25three3Number 3 (third form)
26three_gunFinger gun (three fingers)
27thumb_indexThumb and index extended
28thumb_index2Thumb and index extended (alternate form)
29timeoutTimeout (T shape)
30two_upNumber 2 (two fingers up)
31two_up_invertedInverted number 2
32xsignX sign (two index fingers crossed)