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.
| 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 |
| 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 |
- Clone the repo
git clone https://github.com/KrishBharadwaj5678/GestureNinja.git
cd GestureNinja- Install dependencies
pip install -r requirements.txt- Run the script
python app.py- 📸 Detect your hand landmarks using MediaPipe.
- ☝️ Track the tip of your index finger to control the mouse position.
- 🤙 Show your pinky finger to simulate a mouse hold (useful for slicing).
- 🖱️ Move your system cursor in real time based on your finger’s position.
- 🔁 Continuously respond to your gestures for smooth interaction.
Want to contribute? Here's how:
- 🍴 Fork the repository.
- 🌿 Create a new branch (
git checkout -b feature-name). - ✍️ Make your changes and commit them (
git commit -am 'Add feature-name'). - 🚀 Push to your branch (
git push origin feature-name). - 🔄 Submit a pull request to merge into the main branch.