Hand Gesture Controlled Bike Racing Game
A machine learning project that uses computer vision to track hand gestures and control a bike racing game in real-time.
Features
- Real-time hand gesture recognition using MediaPipe and OpenCV
- Bike racing game with physics and obstacles
- Gesture controls:
- ✋ Open palm (5 fingers): Accelerate
- ✊ Fist: Brake
- ☝️ Index finger: Turn left
- 🖐️ Pinky finger: Turn right
Project Structure
hand_gesture_bike_racing/
├── main.py # Main game loop
├── gesture_detector.py # Hand gesture recognition
├── bike_game.py # Bike racing game logic
├── camera_interface.py # Camera handling and processing
├── models/ # Trained ML models
├── assets/ # Game assets (images, sounds)
├── data/ # Training data and datasets
└── utils/ # Utility functions
Installation
- Install Python 3.8+
- Install dependencies:
pip install -r requirements.txt
Usage
- Run the main game:
- Position your hand in front of the camera
- Use gestures to control the bike:
- Show all 5 fingers to accelerate
- Make a fist to brake
- Point with index finger to turn left
- Point with pinky finger to turn right
Technical Details
- Computer Vision: OpenCV for camera input and image processing
- Hand Tracking: MediaPipe for real-time hand landmark detection
- Machine Learning: TensorFlow for gesture classification
- Game Engine: Pygame for 2D graphics and physics
- Real-time Processing: Optimized for 30+ FPS
Requirements
- Webcam or camera device
- Python 3.8+
- 4GB+ RAM
- GPU recommended for better performance
Contributing
Feel free to contribute by improving gesture recognition, adding new game features, or optimizing performance!