A real-time virtual drawing application that uses hand gestures detected through the webcam to draw on a digital canvas. Built using PyQt5, OpenCV, and MediaPipe, this project enables touchless interaction for artistic expression, presentations, or accessibility-focused UIs.
-
ποΈ Gesture Recognition with MediaPipe
- Track hand landmarks in real-time
- Recognize gestures like "index-thumb pinch" to draw
- with cursor as well as drawing mode (unique no one has done it)
- Detect "pinky finger" gesture to clear the canvas.
-
π¨ Virtual Drawing Canvas
- Draw using hand gestures without a physical stylus
- Custom brush colors using color picker
- Adjustable brush size with slider
-
π Undo / Redo Functionality
- Implemented using Python's
dequefor efficient drawing history
- Implemented using Python's
-
π§ Smooth UI with PyQt5
- Responsive GUI with buttons, sliders, toolbars, and dialogs
- Multithreaded video processing for performance
-
πΎ Image Handling
- Save your drawings as images
- Import background images for annotation.
| Component | Technology |
|---|---|
| Programming Language | Python 3.x |
| GUI Framework | PyQt5 |
| Video Processing | OpenCV |
| Gesture Detection | MediaPipe (Google) |
| Math/Arrays | NumPy |
| Data Structure | collections.deque |
| Multithreading | QThread, QTimer |
- Start the script β webcam feed is displayed.
- MediaPipe tracks your hand in real-time.
- Perform the "pinch" gesture (index + thumb) to draw on the canvas.
- Use UI controls to:
- Change color and brush size
- Save or clear the canvas
- Undo/redo your strokes
Make sure Python 3.7+ is installed. install all the packages and requires a gpu for better performance
pip install pyqt5 opencv-python mediapipe numpy