Skip to content

rakinmohammedrafeeq/dextera

Repository files navigation

Dextera — Gesture Controlled Virtual Mouse

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.


Features

  • 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

Demo

Watch Demo Video


Technologies Used

  • 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

File Structure

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

Requirements

  • Python 3.8 or higher
    (Note: MediaPipe currently supports up to Python 3.11. See the MediaPipe documentation for details.)
  • opencv-python
  • mediapipe
  • pyautogui

These dependencies are listed in requirements.txt and can be installed with pip install -r requirements.txt.


Installation

  1. Clone the repository:
    git clone https://github.com/rakinmohammedrafeeq/dextera
    cd dextera
  2. Install dependencies:
    pip install -r requirements.txt
  3. Run the application:
    python dextera.py

How It Works

  • Cursor Movement
    The system cursor is moved based on the wrist position using pyautogui.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 triggers mouseDown(). Releasing ends it with mouseUp().

  • 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.


Security Policy

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

License

This project is licensed under the MIT License.


Contact

For any questions or suggestions, feel free to reach out:


Support

If you find this project useful, consider giving it a ⭐ on GitHub or supporting my work:

Buy Me a Coffee

About

Dextera: A Python-based virtual mouse controlled by hand gestures using MediaPipe, OpenCV, and PyAutoGUI. Enables touchless navigation, clicking, dragging, and scrolling via webcam.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors

Languages