Real-Time Gesture-Based Drawing Interface using Computer Vision.
AirCanvas transforms hand movement into a responsive drawing interface using real-time hand tracking. Designed with accuracy and smoothness in mind, it implements stroke confirmation and interpolation techniques to ensure fluid, stable rendering without gesture complexity.
AirCanvas captures real-time hand landmarks and enables drawing when exactly one finger (index) is raised. The system emphasizes accuracy and stability over gimmicks, using stroke confirmation logic, jitter filtering, and linear interpolation to produce smooth and reliable results.
The drawing appears as a floating overlay above the live camera feed, creating a clean and intuitive touchless interaction experience.
- Real-time hand tracking using MediaPipe
- Single-finger drawing logic (index only)
- Stroke confirmation frames to prevent accidental marks
- Linear interpolation for smooth, gap-free strokes
- Light jitter suppression for stability
- Hover-based color selection with delay confirmation
- Adjustable brush thickness (+ / - keys)
- Transparent overlay compositing
- Timestamp-based PNG export
- Minimal and clean UI design
- '+' Increase brush size
- '-' Decrease brush size
- 'C' Clear canvas
- 'S' Save drawing as PNG
- 'ESC' Exit application
- Click 'H' Toggle help panel
AirCanvas is structured around four logical components:
-
Hand Tracking Layer
Detects and tracks hand landmarks in real time. -
Gesture Interpretation Layer
Confirms exactly one finger raised before initiating drawing. -
Drawing Engine
Implements:- Frame-based stroke confirmation
- Linear interpolation between points
- Jitter filtering
- Alpha compositing for overlay rendering
-
UI Overlay System
Includes color selection boxes and a semi-transparent help panel.
The system adapts dynamically to frame size changes and avoids hardcoded resolution assumptions, making it compatible with standard webcams and phone-based webcam setups.
Clone the repository and install dependencies:
pip install -r requirements.txt
Run the application:
python aircanvas.py
- Python 3.8+
- OpenCV
- MediaPipe
- NumPy
This project is released under the MIT License.