Skip to content

Ankur3509/AirDraw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✋🎨 AirDraw – Hand Gesture Based Virtual Blackboard

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.


🚀 Features

  • ✍️ 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

🧠 How It Works (Concept)

  1. The webcam captures live video frames.
  2. MediaPipe detects the hand and extracts 21 hand landmarks.
  3. Finger states (up/down) are calculated using landmark positions.
  4. The index fingertip position is used as a drawing cursor.
  5. A separate black canvas stores the drawing.
  6. The canvas is overlaid on the live video feed.
  7. Gestures control drawing, color changes, and clearing the board.

✋ Gesture Controls

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

🛠️ Tech Stack

  • Python 3.x
  • OpenCV – video capture and drawing
  • MediaPipe – hand landmark detection
  • NumPy – array and canvas operations

📂 Project Structure

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

▶️ How to Run

  1. Clone the repository:
git clone https://github.com/your-username/airdraw.git
cd airdraw
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the application:
python air_draw.py
  1. Use hand gestures in front of the webcam to start drawing.

💾 Saving the Drawing

  • Trigger save using a gesture or key press (configured in code)
  • The drawing is saved as a JPG image in the project directory

🎨 Customization

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

🏆 Use Cases

  • Virtual teaching & online whiteboards
  • Assistive technology
  • Touchless interfaces
  • Computer vision demos
  • Hackathons & science exhibitions

📈 Future Enhancements

  • Shape recognition (circle, square, line)
  • OCR: convert air-written text to digital text
  • Multi-hand support
  • GUI-based tool selection
  • Voice feedback

👨‍💻 Author

Ankur Student | Computer Vision & AI Enthusiast


⭐ Acknowledgements

  • MediaPipe by Google
  • OpenCV Community

If you like this project, don’t forget to ⭐ the repository!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages