Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Virtual Air Canvas ๐ŸŽจ

License: MIT

A real-time virtual drawing application built with OpenCV and MediaPipe. This project detects hand gestures to allow users to draw, erase, and pause on a virtual canvas directly through the webcam.

๐Ÿ–ผ๏ธ Demo

Virtual Air Canvas Demo

๐Ÿš€ Features

  • Live Drawing: Draw on the canvas by moving your index finger.
  • Gesture Control: Use simple hand gestures to control the drawing process.
  • Erase Canvas: Clear the entire canvas with a specific hand pose.
  • Pause Drawing: Stop drawing without losing your progress.
  • Smart Line Breaks: The application intelligently handles the start and end of drawing strokes.

๐ŸŽฎ Controls & Gestures

The application recognizes the following hand gestures:

Gesture Action
Index Finger Up Only ๐ŸŸข Draw
All Fingers Up ๐Ÿ”ด Erase Canvas
Pinky Finger Up ๐ŸŸ  Pause
Fist (All Bent) โšซ Wait/No Action

๐Ÿ“ฆ Installation

To get this project up and running, follow these steps:

  1. Clone the repository:

    git clone https://github.com/MjavadH/virtual-air-canvas.git
    cd virtual-air-canvas
  2. Install the required dependencies:

    pip install -r requirements.txt

โ–ถ๏ธ How to Use

Once the installation is complete, run the main script:

python src/main.py

Hold your hand in front of the webcam and use the defined gestures to start drawing. Press the q key to exit the application.

๐Ÿง  How it Works

This project uses MediaPipe Hands to track 21 hand landmarks. The drawing logic is based on geometric checks:

  • Drawing Mode: Activated when only the Index finger is up (tip y < pip y).
  • Smooth Lines: A deque data structure stores the coordinates to draw continuous lines and handle breaks efficiently.

๐Ÿ“œ Requirements

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

About

๐ŸŽจ Real-time gesture-controlled drawing canvas. Built with Python, OpenCV for computer vision, and MediaPipe for hand tracking.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages