An open API service indexing awesome lists of open source software.

https://github.com/albertomarquillas/gesture-mouse-control

Real-time hand gesture tracking with OpenCV and MediaPipe to control system volume or emulate mouse actions.
https://github.com/albertomarquillas/gesture-mouse-control

computer-vision gesture-recognition hand-tracking human-computer-interaction mediapipe opencv python

Last synced: about 2 months ago
JSON representation

Real-time hand gesture tracking with OpenCV and MediaPipe to control system volume or emulate mouse actions.

Awesome Lists containing this project

README

          

# Gesture Mouse Control

![Language](https://img.shields.io/badge/language-Python-blue)
![Framework](https://img.shields.io/badge/framework-OpenCV-green)
![Library](https://img.shields.io/badge/library-MediaPipe-orange)
![License](https://img.shields.io/badge/license-MIT-green)
![Release](https://img.shields.io/github/v/release/AlbertoMarquillas/gesture-mouse-control)
![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow)

---

## πŸ“Œ Overview

The **Gesture Mouse Control** project demonstrates how to use **hand-tracking with OpenCV and MediaPipe** to emulate system actions using real-time hand gestures. In this implementation, the gestures are mapped to **volume control**, but the framework can be extended to emulate other mouse or keyboard actions.

The project showcases how computer vision and human–computer interaction can be combined to build natural and intuitive interfaces.

---

## πŸ“‚ Repository Structure

```
/
β”œβ”€ src/ # Source code
β”‚ β”œβ”€ main.py # Entry point: runs the volume control app
β”‚ └─ hand_tracking_module.py # Hand tracking module (mediapipe wrapper)
β”œβ”€ test/ # Placeholder for future tests
β”œβ”€ docs/ # Documentation and assets
β”‚ └─ assets/ # Figures, screenshots, diagrams
β”œβ”€ notebooks/ # Optional experimentation notebooks
β”œβ”€ build/ # Temporary outputs (ignored)
β”œβ”€ requirements.txt # Dependencies
└─ README.md # Project documentation
```

---

## βš™οΈ Installation

Ensure you have **Python 3.9+**. Install the dependencies listed in `requirements.txt`:

```powershell
git clone https://github.com/AlbertoMarquillas/gesture-mouse-control.git
cd gesture-mouse-control
pip install -r requirements.txt
```

Typical dependencies include:

* `opencv-python`
* `mediapipe`
* `numpy`

---

## πŸš€ Usage

Run the application from the command line:

```powershell
python src/main.py
```

* The webcam feed will open.
* The **hand landmarks** are detected in real time.
* Gestures (e.g., distance between thumb and index fingers) are mapped to **system volume control**.

> ⚠️ Note: the current implementation modifies system volume. To extend it for **mouse control** or **other actions**, adjust the mapping logic inside `main.py`.

---

## πŸ” Features

* **Real-time hand tracking** using **MediaPipe**.
* **Gesture recognition** mapped to system actions.
* **Volume control demo** included by default.
* Modular code: `hand_tracking_module.py` encapsulates the MediaPipe logic.
* Easily extendable to support other gestures and actions.

---

## πŸ“š What I Learned

Through this project I gained experience in:

* Using **OpenCV** for real-time video processing.
* Applying **MediaPipe** for robust hand-tracking.
* Mapping geometric relationships (distance between landmarks) to actionable commands.
* Designing intuitive human–computer interaction prototypes.
* Structuring Python projects for clarity and reusability.

---

## πŸ“œ License

This project is released under the [MIT License](LICENSE).