A simple program that allows you to draw with your finger on the webcam view.
The program allows switching between 3 different colors (Red, Green, Blue) and 1 eraser. Color and eraser selection boxes do not appear on the screen until a hand is detected on the webcam.
- Clone the project to your computer:
git clone https://github.com/efetunca/Virtual-Painter.git
or simply download the project as ZIP file.
- Go to project directory:
cd Virtual-Painter
- Install necessary modules:
sudo pip3 install -r requirements.txt
- Run the program:
python3 VirtualPainter.py
In order to use the program, a hand must first be detected on the webcam. The program works with only one hand; two-handed operation is not possible.
-
Raise your index and middle fingers together and move them to the corresponding box. The text "Select" will appear in the lower-right side of the window.
-
Each box allows its own color to be selected; select the black box for the eraser.
-
By default, the program starts with the red color selected.
- Raise your index finger and start drawing. The text "Draw" will appear in the lower-right side of the window.
- As long as your index finger stay raised, you can draw. Lower your finger to stop drawing.
If you get the Frames can not be received! Exiting...
error, simply run the program again.
-
The option to change the brush size will be added.
-
Color and eraser selection mechanism will be improved.
-
The option to save the drawing as an image will be added.
-
Hand detection will be done with a self-written machine learning algorithm instead of the Mediapipe module.
To check out my other project that is similar to this one: