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.
- Host: GitHub
- URL: https://github.com/krishbharadwaj5678/gestureninja
- Owner: KrishBharadwaj5678
- Created: 2025-05-19T09:51:22.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-05-19T10:28:14.000Z (7 months ago)
- Last Synced: 2025-05-19T10:44:39.624Z (7 months ago)
- Topics: 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
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.