Camera-Gesture Mouse Controller

Hands-free mouse control using Python, OpenCV, and MediaPipe hand-tracking.

Overview

This project turns your webcam into a gesture-driven mouse. The system tracks the thumb tip to move the cursor and uses pinch gestures to perform mouse actions: left-drag (thumb+index), right-click (thumb+middle), and scrolling (thumb+ring). Motion is smoothed using an Exponential Moving Average, while pyautogui injects native OS mouse events. A safe preview mode and live overlay aid debugging and calibration.

System Architecture

Key Features

Core Algorithms

Controls

Configuration

Dependencies

Troubleshooting

How It Works (Flow)

1) Open camera (DirectShow on Windows) โ†’ 2) Detect hand landmarks โ†’ 3) Thumb tip normalized โ†’ 4) Smooth with EMA โ†’ 5) Map to screen โ†’ 6) Detect pinches (index/middle/ring) with debouncing โ†’ 7) Emit OS input via pyautogui โ†’ 8) Draw overlay & FPS.

Example

Demo (placeholder)

Future Improvements