Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Handraw

Python OpenCV MediaPipe License Status

Project Structure

HANDRAW/
├── camera/
│   ├── captures/           
│   ├── drawing.py         
│   └── hand_landmarker.task 
└── README.md

Demo

demo_handraw

Install

pip install opencv-python opencv-contrib-python mediapipe numpy

How to run

python cam_draw.py

Controls

Hand Gestures

Gesture Action
☝️ Index finger up Draw
✌️ Index + middle finger up Erase
✊ Closed hand Idle

Hand Landmarks

MediaPipe detects 21 landmarks on each hand, numbered 0 to 20:

Group Landmarks Description
Wrist 0 WRIST
Thumb 1-4 CMC -> MCP -> IP -> TIP
Index finger 5-8 MCP -> PIP -> DIP -> TIP
Middle finger 9-12 MCP -> PIP -> DIP -> TIP
Ring finger 13-16 MCP -> PIP -> DIP -> TIP
Pinky 17-20 MCP -> PIP -> DIP -> TIP

Each finger has 4 points: base knuckle (MCP), middle knuckle (PIP), upper knuckle (DIP), and fingertip (TIP).

Keyboard

Key Action
19 Switch color (green, blue, pink, orange, white, ...)
+ / - Decrease / increase brush size
C Clear board
S Save screenshot to captures/
Tab Toggle HUD
Q / Esc Quit

Credits

About

Air-drawing app powered by hand-tracking - control a virtual canvas with nothing but finger gestures, using Python, OpenCV and MediaPipe.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages