Pi Wars post – OpenCV install

Since my last post, I have been trying to install simpleCV on a Raspberry Pi 3 running Raspbian Stretch. I tried a number of guides witch all failed, checking with the simpleCV github account page that SimpleCV has not been updated for install on Stretch. I also tried to install the Python OpenCV package as well same result fail. My next plan was to install OpenCV with Python 3 bindings.

Once again, I turned to my friend Google and Google found the following website and guide.

https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/

First attempt failed because I used a too small SD card, 8Gb was not large enough! Found an unused 16Gb SD card restarted again followed the guide. Got up to Step 5, 4 hours to Compile! Luckily it was about 10pm so I started compiling it and will pick up in the morning when it had finished, good plan I thought. This morning I woke up, and checked my laptop, yes I had started a SSH session to install it. I found that my laptop had gone to sleep after ½ hour of me leaving my laptop. Bottoms! The compile had stopped, restart the compile, after 2 hours compiling, I was ready for the next step, install.  I followed the steps to install for Python 3.5. tested importing OpenCV and it worked!

So what have I learnt from this? always make sure that your laptop, when on mains power does not go asleep or work on the Raspberry Pi instead of using SSH, use a large SD card if you not sure how large the software package you are compiling is.

Now for more learning and testing. Watch this space!

update

you also need to follow the guide below to get the PiCamera working within the virtual environment.

https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/

Keith suggested using gnu screen in this tweet for long/big install ;-D

 

Brian


1 comment

  • Hi Brian. Another good way to ensure installs initiated over ssh don’t fail is to use gnu screen.

    Start your ssh session start a screen session ‘screen bash’ now do your install as usual.

    If your ssh session fails simply start is again and do ‘screen -r’

    Back where you were.
    A lot more features available too, see this video
    https://youtu.be/iOJdkFoHn9c

    Keith Ellis

Leave a comment

Please note, comments must be approved before they are published