GitHunt
MI

MihaiBudurean/virtual-painter

A hand-tracking virtual painter using OpenCV and Mediapipe. Draw with your fingers in real time through your webcam.

๐ŸŽจ Virtual Painter

Control a virtual paint canvas using your hands and a webcam. This project uses OpenCV and Mediapipe for real-time hand tracking.

Features

  • Draw with your index finger.
  • Select brush/eraser from a header bar using gestures (index + middle up).
  • Immediate visual feedback and simple UI.

๐Ÿ”ง Dependencies and Usage

Install the dependencies:

conda env create -f environment.yml
conda activate virtual-painter

mediapipe is installed via pip inside the conda env (declared in environment.yml).

or

pip install -r requirements.txt

๐Ÿš€ Run

python virtual_painter.py

๐ŸŽฎ Controls

  • Index + middle up: select tool from header (green = brush, black = eraser).
  • Only index up: draw.
  • Press q: quit.

๐Ÿ“ Notes / Troubleshooting

You might see EGL / OpenGL warnings on some systems (e.g., falling back to ES 2). Theyโ€™re harmless.
To reduce logs:

export GLOG_minloglevel=2
export TF_CPP_MIN_LOG_LEVEL=2

Languages

Python100.0%

Contributors

MIT License
Created September 8, 2025
Updated September 10, 2025
MihaiBudurean/virtual-painter | GitHunt