AirCanvas lets you paint virtually using hand gestures. No physical tools needed - just your hand and creativity!
- 🖌️ Draw in mid-air using hand gestures
- 🎨 Multiple color options (Blue, Green, Red, Yellow)
- 📏 Adjustable brush sizes
- 💫 Real-time hand tracking
- 🔄 Canvas clearing option
- 🖼️ Smooth drawing experience
- 📸 Live webcam integration
- Webcam (Optional)
- Computer with Python support
pip install opencv-python
pip install mediapipe
pip install numpy
- Clone the repository
git clone https://github.com/Vinandra-Adam-Saputra/AirCanvas-VirtualDrawing.git
cd AirCanvas-VirtualDrawing
-
Install dependencies
-
Run the application
python virtual_paint.py
- ☝️ Index Finger Up + Middle Finger Down: Activate drawing mode
- ✋ Other Positions: Pause drawing
q
- Quit applicationc
- Clear canvasb
- Switch to blue colorg
- Switch to green colorr
- Switch to red colory
- Switch to yellow color+
- Increase brush size-
- Decrease brush size
- Uses MediaPipe Hands for accurate hand landmark detection
- Tracks 21 different points on your hand
- Focuses on index finger tip for drawing
-
Initialization
- Sets up video capture
- Creates empty canvas
- Initializes color options and brush settings
-
Hand Tracking
- Detects hand in frame
- Identifies finger positions
- Determines drawing mode based on gesture
-
Drawing Process
- Tracks index finger movement
- Creates continuous lines when drawing
- Maintains smooth line quality
self.hands = self.mp_hands.Hands(
max_num_hands=1,
min_detection_confidence=0.7,
min_tracking_confidence=0.7
)
self.colors = {
'blue': (255, 0, 0),
'green': (0, 255, 0),
'red': (0, 0, 255),
'yellow': (0, 255, 255)
# Add your custom colors here
}
- Fork the repository
- Create feature branch
git checkout -b feature/amazingfeature
- Commit changes
git commit -m 'Add amazing feature'
- Push to branch
git push origin feature/amazingfeature
- Open a Pull Request
This project is licensed under the MIT License
- MediaPipe team for hand detection
- OpenCV community
- All contributors and testers