I've tried a number of times to get OpenCV running on Raspberry Pi. Lately, I've wanted OpenCV 4 on my Raspberry Pi 4. I tried a few ways and, first, it takes a long time and, second, it doesn't always work. Props to Will Price for his scripts available on GitHub.
Installing
- Download the scripts from the Download ZIP link on the page.
- Follow Will's instructions in the README.md file.
I've run through all this weeks ago and it was the first time I've got OpenCV started and running the first time.
Usage
This is the part that's valuable to me. Next time I come to work on OpenCV I will have forgotten the mechanics. So this is what I need to do on my Pi. The Python scripts I want to run are in my ./Swathe/OpenCV/Pi4 folder
- Open a terminal
- Change to the code folder
pi@SwathePi:~ $ cd Swathe/OpenCV/Pi4/ pi@SwathePi:~/Swathe/OpenCV/Pi4 $
- Activate the Python virtual environment by:
pi@SwathePi:~/Swathe/OpenCV/Pi4 $ workon cv (cv) pi@SwathePi:~/Swathe/OpenCV/Pi4 $
- The next thing
(cv) pi@SwathePi:~/Swathe/OpenCV/Pi4 $ python3 record.py
- And it looks like this
OK, so that's it. When I've forgotten how to breathe, this is it.
Comments
Post a Comment