Skip to content

Cobot69/VisionBallGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

VisionBallGame

Description

"VisionBallGame is a real-time interactive game using Python, OpenCV, and MediaPipe. Players use their hands to catch moving enemies on the screen. The game tracks hand movements via webcam and updates the score when an enemy is caught, providing an engaging experience through advanced hand-tracking and computer vision technologies."

Table of Contents

  1. Features
  2. Usage
  3. Code Overview
  4. Concepts Used
  5. Challenges Faced
  6. Images and Videos
  7. Future Enhancements
  8. License

Features

  • Real-time hand tracking using a webcam
  • Interactive gameplay with score tracking
  • Dynamic enemy movement
  • Easy-to-use interface

Usage

1.Run the game:

Open a terminal or command prompt, navigate to the project directory, and execute:

2.Gameplay Instructions:

  • Objective: Use your index finger to catch the moving enemies on the screen.

  • Scoring: The score increases each time an enemy is caught.

  • Exit the Game: Press 'q' to quit the game at any time.

3.Controls:

  • Hand Movement: Move your hand in front of the webcam to control the game.

  • Enemy Interaction: Position your index finger close to the moving enemy to score points.

  • Troubleshooting:

4.Webcam Issues:

  • Ensure your webcam is properly connected.

  • Performance: Close other applications if you experience lag.

  • Detection Accuracy: Ensure good lighting for accurate hand tracking.

Code Overview

Libraries Used:

-OpenCV: For video capture and image processing.

-MediaPipe: For hand tracking and landmark detection.

-NumPy: For mathematical operations.

Main Components:

-Video Capture: Captures video from the webcam.

-Hand Detection: Detects and tracks hand landmarks using MediaPipe.

-Enemy Movement: Randomly positions the enemy on the screen.

-Collision Detection: Checks for proximity between the player's finger and enemy to update the score.

Game Logic:

-Continuously captures and processes video frames.

-Updates score when the player's finger touches an enemy.

-Moves enemies to new positions when caught.

Concepts Used

-Computer Vision: Real-time processing with OpenCV.

-Hand Tracking: MediaPipe for detecting hand landmarks.

-Game Mechanics: Score tracking and interaction through gesture recognition

Challenges Faced

-Real-time Processing: Optimizing performance for smooth gameplay.

-Lighting Conditions: Ensuring accurate tracking in different lighting environments.

-Coordinate Mapping: Mapping hand positions to screen coordinates accurately.

Images and Videos

Images

Screenshot 2024-08-08 183706

"Displays real-time hand recognition with detected hand landmarks and a blue circle indicating tracked positions in the webcam feed."

Screenshot 2024-08-08 183626

"Displays real-time hand recognition with a blue circle on the index finger and another blue circle representing the enemy target in the webcam feed."

Videos

VN20240808_193153.mp4

G-Drive Link

https://drive.google.com/file/d/1z71S2z2AnT5i7tsJWebQKhzyeNONLhoL/view?usp=sharing

Future Enhancements

-Add more levels with increasing difficulty.

-Include additional gestures for diverse interactions.

-Enhance UI design and add sound effects for better user experience.

About

"VisionBallGame is a real-time interactive game using Python, OpenCV, and MediaPipe. Players use their hands to catch moving enemies on the screen. The game tracks hand movements via webcam and updates the score when an enemy is caught, providing an engaging experience through advanced hand-tracking and computer vision technologies."

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages