This is the single working reference for the current final script:
hand_tracking_sprint2.py
The system now uses MediaPipe hand landmarks (not YOLO) plus OAK-D depth processing and optional UDP transmission.
hand_tracking_sprint2.py runs a real-time hand-tracking pipeline with:
- OAK-D RGB + depth streams
- MediaPipe 21-landmark hand detection
- Depth-region extraction and normalization to 5x5
- Optional UDP transmission of the smoothed 5x5 matrix
- On-screen profiling and calibration controls
Core script:
hand_tracking_sprint2.py
Support modules used directly by sprint2:
src/depth_processor.pysrc/performance_profiler.pysrc/calibration_manager.pysrc/config_persistence.pysrc/optimized_renderer.py
Config file:
config_hand_tracking.py
Calibration reference (kept intentionally):
docs/CALIBRATION_GUIDE.md
Launcher:
run_hand_tracking_sprint2.ps1
Install in your virtual environment:
depthaiopencv-pythonnumpymediapipe
The script includes a compatibility hint for MediaPipe + NumPy:
mediapipe==0.10.14numpy<2
From project root:
.\.venv\Scripts\Activate.ps1
python hand_tracking_sprint2.pyor use:
.\run_hand_tracking_sprint2.ps1In the main app window:
qquitstoggle UDP on/offcauto-calibrate depth rangerreset depth range defaults+or=increase max depth-or_decrease max depth[decrease min depth]increase min depthppersist calibration toconfig_hand_tracking.py
Default target in script:
- IP:
192.168.1.100 - Port:
5000
Packets are sent only when all are true:
- hand is detected
- confidence is high enough (
> 0.8) - UDP is currently enabled
The script renders four windows:
- RGB camera with hand box
- Colorized depth map
- Hand region crop
- 5x5 matrix display with FPS and UDP status
- Runtime adjustments update active
HAND_DEPTH_MIN/HAND_DEPTH_MAX - Press
pto write those values intoconfig_hand_tracking.py - Next run attempts to load saved values back in at startup
- Sprint2 is the current final script.
- Older hand-tracking iterations and YOLO model assets were removed to reduce project clutter.
- The calibration guide in
docs/CALIBRATION_GUIDE.mdremains as the dedicated depth-calibration reference.