Dextera is a Python-based desktop application that allows users to control their system's mouse using hand gestures via webcam. Built using MediaPipe, OpenCV, and PyAutoGUI, Dextera provides a touchless way to navigate, click, drag, and scroll with simple hand movements.
- Virtual Mouse Movement – Move the cursor using hand gestures
- Left Click & Right Click – Pinch gestures trigger left and right clicks
- Drag and Drop – Pinch and hold gesture to simulate drag actions
- Scroll Mode – Raise index finger to enter scroll mode and move hand up/down to scroll
- Real-time FPS Display – Displays current frame rate to monitor performance
- Hand Detection – Supports multiple hands using MediaPipe’s hand landmark tracking
- Python 3.x
- OpenCV – For real-time webcam capture and image processing
- MediaPipe – Hand tracking using 21 hand landmarks
- PyAutoGUI – To control mouse functions like move, click, drag, and scroll
The Dextera project is organized for seamless hand gesture recognition:
Dextera/
│
├── dextera.py # Main script for gesture-controlled mouse
├── hand_detector.py # Detects hand landmarks using MediaPipe
├── gesture_recognition.py # Processes gestures: click, drag, scroll, etc.
├── basic_hand_detection.py # Test script to verify hand detection setup
│
├── demo/ # Folder with demo videos
│ └── demo.mp4
│
├── requirements.txt # Required Python dependencies
├── README.md # Project documentation
├── LICENSE # MIT License
├── SECURITY.md # Security information
├── .gitignore # Git ignore rules
└── .gitattributes # Git attribute file
- Python 3.8 or higher
(Note: MediaPipe currently supports up to Python 3.11. See the MediaPipe documentation for details.) opencv-pythonmediapipepyautogui
These dependencies are listed in requirements.txt and can be installed with pip install -r requirements.txt.
- Clone the repository:
git clone https://github.com/rakinmohammedrafeeq/dextera cd dextera - Install dependencies:
pip install -r requirements.txt
- Run the application:
python dextera.py
-
Cursor Movement
The system cursor is moved based on the wrist position usingpyautogui.moveTo(). -
Left Click (Thumb + Index)
When the thumb and index fingertip come close together (pinch), a left click is triggered. -
Right Click (Thumb + Middle)
A pinch between the thumb and middle fingertip triggers a right click. -
Drag and Drop (Thumb + Ring, Held)
Pinching the ring finger with the thumb and holding it for a short duration triggersmouseDown(). Releasing ends it withmouseUp(). -
Scroll Mode (Raised Index Finger)
When the index finger is raised above the thumb, scroll mode is activated. Moving the hand up or down scrolls the screen accordingly.
For the complete security policy, refer to SECURITY.md.
It outlines:
- Supported versions
- Responsible disclosure guidelines
- Private reporting process
- Required information when reporting vulnerabilities
- Response timelines
This project is licensed under the MIT License.
For any questions or suggestions, feel free to reach out:
- Email: rakinmohammedrafeeq@gmail.com
- LinkedIn: https://www.linkedin.com/in/rakinmohammedrafeeq
- GitHub: https://github.com/rakinmohammedrafeeq
If you find this project useful, consider giving it a ⭐ on GitHub or supporting my work: