virtual pen is a computer vision program to track object movement and draw line according the movement.
- Detecting pen and set colur of drawing
- Testing the objectdetection
- Draw your line
First install all requirement file:
>> pip install -r requirement.txt
- for linux edit requirement.txt and chnage opencv version from 4.2.0.34 to 4.2.0.26 this will run smoothly on the linux and raspberry pi enviroment
Step 1 : setup pen
$ python pensetup.py
Step 2 : correct morphological operations to reduce noise in the video
$ python max_musk.py
Step 3 : Detect and track the colored object with contour detection
$ python pendecting.py
Step 4 : Draw the tracking object
$ python main.py
- Press button "s" to stop drawing lines
- press button "e" for enable ereaser
- press button "p" to enable pen
- Need to fix a Wirper iuuse
If you are want to use this on the raspberry pi then first setup opencv on raspberry pi
with open cv version 4.0.2.26 or and never go for leatest if you are not full sure
"A developer don't get tired of error and never take warnings seriously"
this quote will help you if you are seting up this project on raspberry pi.
MIT
Free Software, Yeah it's fucking truth!
https://www.learnopencv.com/creating-a-virtual-pen-and-eraser-with-opencv/