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

https://github.com/krishbharadwaj5678/gestureninja

Play Fruit Ninja using just your index finger with real time gesture tracking. No mouse, no keyboard โ€” just your webcam and smooth slicing.
https://github.com/krishbharadwaj5678/gestureninja

automation computer-vision cvzone finger-tracking fruit-ninja game-development gamedev gesture-recognition hand-tracking mediapipe mouse mouse-control numpy opencv pyautogui python realtime virtualmouse webcam

Last synced: 5 months ago
JSON representation

Play Fruit Ninja using just your index finger with real time gesture tracking. No mouse, no keyboard โ€” just your webcam and smooth slicing.

Awesome Lists containing this project

README

          

# ๐Ÿฅท GestureNinja

**GestureNinja** is a computer vision based project that allows you to play **Fruit Ninja** game using real time index finger tracking. Harness the power of your webcam and slice fruits using hand gestures. ๐Ÿ‰๐ŸŽ

---

## โœจ Features

| Feature | Description |
| ------------------------------- | -------------------------------------------------------------------------------- |
| โ˜๏ธ **Index Finger Tracking** | Detects and tracks your index finger using webcam |
| ๐ŸŠ **Gesture Based Control** | No mouse or keyboard needed |
| โšก **Real Time Interaction** | Low-latency tracking for smooth gameplay |
| ๐Ÿง  **Hand Landmark Detection** | Uses advanced hand tracking via MediaPipe |
| ๐Ÿ–ฑ๏ธ **Mouse Emulation** | Moves your system cursor based on finger position |
| ๐ŸŽฎ **Game Integration** | Works with Fruit Ninja game |
| ๐Ÿ–ฅ๏ธ **Cross-Platform** | Compatible with Windows, macOS, and Linux |
| ๐Ÿ’ป **Offline Support** | Runs entirely offline after setup |
| ๐Ÿงฉ **Modular Code Structure** | Easy to extend for more gestures or games |
| ๐Ÿ‘จโ€๐Ÿ’ป **Developer Friendly** | Clean, well-documented code |

---

## ๐Ÿงฉ Tech Stack

| Technology | Purpose |
| ----------------- | ----------------------------------------------------------------------- |
| ๐Ÿ **Python 3.x** | Core programming language |
| ๐ŸŽ›๏ธ **CVZone** | Simplifies OpenCV + MediaPipe |
| ๐ŸŽฅ **OpenCV** | Video capture and image processing |
| ๐Ÿ–๏ธ **MediaPipe** | Real time hand and finger tracking |
| ๐ŸŽ›๏ธ **PyAutoGUI** | Emulates mouse movements |
| ๐Ÿ–ฑ๏ธ **mouse** | Mouse control library for more precise input |
| ๐Ÿง  **NumPy** | Efficient numerical operations and array handling |

---

## ๐Ÿ› ๏ธ Installation

1. **Clone the repo**

```bash
git clone https://github.com/KrishBharadwaj5678/GestureNinja.git
cd GestureNinja
````

2. **Install dependencies**

```bash
pip install -r requirements.txt
```

3. **Run the script**

```bash
python app.py
```

---

## ๐ŸŽฏ How It Works

1. ๐Ÿ“ธ Detect your **hand landmarks** using MediaPipe.
2. โ˜๏ธ Track the **tip of your index finger** to control the mouse position.
3. ๐Ÿค™ **Show your pinky finger** to simulate a **mouse hold** (useful for slicing).
4. ๐Ÿ–ฑ๏ธ Move your system cursor in real time based on your fingerโ€™s position.
5. ๐Ÿ” Continuously respond to your gestures for smooth interaction.

---

## ๐Ÿค Contributing

We welcome contributions from the community!

### ๐Ÿ“ Steps to Contribute:

1. **Fork the repository**:
Click the **Fork** button at the top right of this repository to create your own copy of the project.

2. **Clone your fork**:

```bash
git clone https://github.com/KrishBharadwaj5678/GestureNinja.git
```

3. **Create a new branch**:

```bash
git checkout -b feature-name
```

4. **Make your changes**

5. **Commit your changes**:

```bash
git commit -m "Add feature XYZ"
```

6. **Push to your fork**:

```bash
git push origin feature-name
```

7. **Open a Pull Request**:
Go to the original **GestureNinja** repo and click **New Pull Request** to submit your changes. Provide a brief description of what youโ€™ve done.