AirDraw is a computer vision–based Python project that allows users to draw in the air using hand gestures, with the drawing appearing live on a virtual blackboard on the screen. The final artwork can be saved as a JPG image, and drawing colors can be changed using gestures — no mouse, no touch, no stylus.
This project demonstrates the practical use of OpenCV and MediaPipe for real-time hand tracking and gesture-based interaction.
- ✍️ Draw in the air using your index finger
- 🎥 Real-time webcam-based hand tracking
- 🖐️ Gesture-controlled drawing modes (draw, move, clear)
- 🎨 Gesture-based color switching
- 🧹 Clear the blackboard using hand gestures
- 💾 Save the drawing as a JPG image
- 🧠 No machine learning model or dataset required
- ⚡ Smooth and responsive drawing experience
- The webcam captures live video frames.
- MediaPipe detects the hand and extracts 21 hand landmarks.
- Finger states (up/down) are calculated using landmark positions.
- The index fingertip position is used as a drawing cursor.
- A separate black canvas stores the drawing.
- The canvas is overlaid on the live video feed.
- Gestures control drawing, color changes, and clearing the board.
| Gesture | Action |
|---|---|
| Index finger up | Draw on blackboard |
| Index + Middle finger up | Move cursor (no drawing) |
| Closed fist | Stop drawing |
| 4 fingers up | Clear blackboard |
| Button 'c' | Change drawing color |
| S | Save the picture |
| q | Quit application |
- Python 3.x
- OpenCV – video capture and drawing
- MediaPipe – hand landmark detection
- NumPy – array and canvas operations
AirDraw/
│
├── air_draw.py # Main application logic
├── hand_tracking_module.py # Hand detection and landmark extraction
├── requirements.txt # Required Python libraries
└── README.md # Project documentation
- Clone the repository:
git clone https://github.com/your-username/airdraw.git
cd airdraw- Install dependencies:
pip install -r requirements.txt- Run the application:
python air_draw.py- Use hand gestures in front of the webcam to start drawing.
- Trigger save using a gesture or key press (configured in code)
- The drawing is saved as a JPG image in the project directory
You can easily extend the project by:
- Adding more colors to the color palette
- Changing brush thickness
- Adding an eraser gesture
- Implementing undo/redo
- Exporting drawings as PDF
- Virtual teaching & online whiteboards
- Assistive technology
- Touchless interfaces
- Computer vision demos
- Hackathons & science exhibitions
- Shape recognition (circle, square, line)
- OCR: convert air-written text to digital text
- Multi-hand support
- GUI-based tool selection
- Voice feedback
Ankur Student | Computer Vision & AI Enthusiast
- MediaPipe by Google
- OpenCV Community
If you like this project, don’t forget to ⭐ the repository!