OpenCV 4 on Raspberry Pi 4

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

  1. Download the scripts from the Download ZIP link on the page.
  2. 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
  1. Open a terminal
  2. Change to the code folder
     pi@SwathePi:~ $ cd Swathe/OpenCV/Pi4/  
     pi@SwathePi:~/Swathe/OpenCV/Pi4 $  
    
  3. Activate the Python virtual environment by:
     pi@SwathePi:~/Swathe/OpenCV/Pi4 $ workon cv  
     (cv) pi@SwathePi:~/Swathe/OpenCV/Pi4 $   
    
  4. The next thing
     (cv) pi@SwathePi:~/Swathe/OpenCV/Pi4 $ python3 record.py  
    
  5. And it looks like this
OK, so that's it. When I've forgotten how to breathe, this is it.

Comments