Hand Tracking
- AI Developer
- February 2022
- Completed
In numbers
- Landmarks per hand, wrist to fingertips
- 21
- Training images needed: the model comes pretrained
- 0
About the Project
Hand Tracking follows hands on a live webcam feed. MediaPipe Hands finds each hand anywhere in the frame and returns 21 landmarks, from the wrist to each fingertip, which the script draws as a skeleton over the image.
From those landmarks it builds a box around the hand: the outer edges of the five fingers, the wrist as the bottom, and a margin on every side. The box is then squared by padding its shorter side, so the hand keeps its proportions, and it is drawn only when it sits fully inside the frame. A square, centered crop is exactly what an image classifier expects as input.
I wrote it in February 2022, the same month as my sign-language app, which needed the hand inside a fixed box on screen. This takes the opposite approach: find the hand wherever it is, with no training data of my own.
How it works
The path a request takes, step by step.
- CameraOpenCV reads the live feed
- MediaPipe Hands21 landmarks per hand
- BoxOuter edges of the fingers and the wrist
- Square cropPadded on its short side, drawn when it fits
Decisions
The choices that shaped it, and what each one cost.
Square the box around the hand
- Image classifiers take square inputs; padding the shorter side keeps the hand in proportion instead of stretching it.
- A long, narrow hand brings more background into the crop.
Use a pretrained landmark model
- MediaPipe finds the hand anywhere in the frame with no training data of my own.
- Accuracy and speed are whatever the model gives; there is nothing to tune.
