This project uses OpenCV, MediaPipe, and PyAutoGUI to let you control your computer mouse without touching it β using only your hand gestures detected from your webcam!
- Hand Tracking with MediaPipe
- Mouse Control
- Move mouse with index finger
- Thumbs Up β Single Click (after 0.75s)
- Thumbs Up β Double Click (after 2.25s, total 3 clicks including the first one)
- Pause Mouse Movement by raising index + middle finger together
- On-Screen Visualization
- Green dots show which fingers are active
- Debug text with landmark coordinates and click counter
- Resizable Window β camera frame automatically adjusts to window size
(Insert GIF or screenshot of your program running here)
Clone this repository:
git clone https://github.com/yourusername/touchless-hand-tracking.git
cd touchless-hand-trackingInstall dependencies:
pip install opencv-python mediapipe pyautoguiRun the script:
python main.pyControls:
π Index finger up β Move mouse
βοΈ Index + Middle finger up β Pause mouse movement
π Thumbs up
- Hold for 0.75s β Left Click
- Hold for 2.25s β Double Click (so total 3 clicks)
β Press Q β Quit the app
Works best in good lighting with one hand visible
When the window is minimized, the program falls back to prevent resize crashes
Screen resolution is automatically detected for accurate mouse movement
OpenCV β Computer Vision
MediaPipe β Hand Tracking
PyAutoGUI β Mouse Control
Right-click gesture support
Scroll with finger gestures
Multi-hand support