Skip to content

sandeepannandi/SliceCam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCV Fruit Ninja

A hand-tracking version of the classic Fruit Ninja game using OpenCV and MediaPipe.
Explore the features »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. How to Play
  4. Features
  5. License

About The Project

OpenCV Fruit Ninja is an interactive, computer-vision based arcade game inspired by the classic Fruit Ninja. Instead of swiping on a touch screen, you use your actual hand movements captured by your webcam to slice fruits in real-time. The game leverages MediaPipe for accurate hand-tracking and OpenCV for rendering and computer vision operations.

Built With

Major frameworks and libraries used to bootstrap this project:

  • Python
  • OpenCV
  • MediaPipe
  • Pygame

Getting Started

To get a local copy up and running, follow these simple steps.

Prerequisites

Ensure you have Python 3.7 or higher installed on your system. You will also need a functional webcam.

Installation

  1. Clone the repository or download the source code files.
  2. Install the required Python packages:
    pip install -r requirements.txt
  3. Run the game:
    python fruit_ninja.py

How to Play

  1. Make sure you are in a well-lit environment for optimal hand-tracking performance.
  2. Stand in front of your webcam ensuring your hands are clearly visible.
  3. Use your index finger to slice the fruits that appear on the screen.
  4. Try to slice as many fruits as possible to achieve a high score!
  5. Watch out! If you miss a fruit and it falls off the screen, the game is over.
  6. Press R to restart the game after a game over.
  7. Press Q to quit the game at any time.

Features

  • Real-Time Hand Tracking: Utilizes Google's MediaPipe for robust and low-latency hand tracking.
  • Dynamic Gameplay: Multiple fruit types rendered with distinct colors and smooth physics.
  • Visual Feedback: Satisfying slicing animations when a fruit is successfully cut.
  • Score System: Tracks your current score to challenge yourself.
  • Intuitive Controls: Replay or quit seamlessly directly from the game over screen.

License

Distributed under the Apache License 2.0. See LICENSE for more information.

About

SliceCam is a fun, camera-controlled game powered by OpenCV and Mediapipe that lets you slash flying fruits with real-time hand tracking.

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages