A real-time computer vision application that tracks hand movements and detects proximity to virtual danger zones — built without deep learning frameworks like MediaPipe.
Uses pure OpenCV + NumPy with classical CV techniques.
-
Classical Computer Vision
- HSV color segmentation
- Morphological filtering
- Contour + convex hull extraction
- Fingertip detection (via hull analysis)
-
Safety Logic
- Detects 3 states:
- 🟢 SAFE
- 🟡 WARNING
- 🔴 DANGER
- Based on distance from hand to danger zone.
- Detects 3 states:
-
Analytics
- Tracks:
- Total session duration
- Time spent in danger
- Time spent in warning
- Tracks:
-
Visuals
- Real-time fingertip trails
- Distance ring guides
- Blinking danger alerts
- Optional mask/debug mode
- Python 3.x
- Webcam
- Install dependencies:
- Connect your webcam.
- Run the Python script:
| Key | Action |
|---|---|
| C | Auto-Calibrate (Hold hand in center box first) |
| Q | Quit |
| S | Save Configuration |
| M | Toggle Mask View (Debug) |
| D | Toggle Debug Info |
| T | Toggle Fingertip Trail |
| G | Toggle Zone Guides |
| R | Reset Stats |