https://github.com/jakson-almeida/drawwithhands
Draw with your hands using Computer Vision
https://github.com/jakson-almeida/drawwithhands
computer-vision handdetection mediapipe pygame
Last synced: about 1 month ago
JSON representation
Draw with your hands using Computer Vision
- Host: GitHub
- URL: https://github.com/jakson-almeida/drawwithhands
- Owner: Jakson-Almeida
- Created: 2025-05-22T15:50:38.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-29T03:41:21.000Z (12 months ago)
- Last Synced: 2025-06-29T04:29:54.535Z (12 months ago)
- Topics: computer-vision, handdetection, mediapipe, pygame
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DrawWithHands
A Python application that lets you draw in the air using hand gestures, powered by **MediaPipe** and **Pygame**.
## Features
- Real-time hand tracking with 21 landmarks
- Pinch gesture detection for drawing
- Adjustable brush size and color
- Clear canvas functionality
- Webcam feed overlay
## Requirements
- Python 3.11+
- Webcam
## Installation
1. Clone the repository:
```bash
git clone https://github.com/Jakson-Almeida/DrawWithHands.git
cd DrawWithHands
```
2. Create and activate virtual environment:
```bash
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
## Usage
Run the application:
```bash
python draw.py
```
### Controls:
- **Pinch gesture**: Draw on the canvas
- **Brush button**: Switch to red brush
- **Clear All button**: Reset the canvas
- **ESC**: Exit the application
## How It Works
The application uses:
- MediaPipe for real-time hand tracking
- Pygame for rendering and drawing
- Pinch detection between thumb and index finger
- Simple GUI buttons for controls
## Troubleshooting
- If webcam isn't detected, try changing `cv2.VideoCapture(0)` to `cv2.VideoCapture(1)`
- For performance issues, reduce the webcam resolution
- Ensure proper lighting for better hand detection