From b2df75665723b012d27b08e2925b550c8fe8e3b7 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 22:06:23 +0200 Subject: [PATCH] update to OpenCV section --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f13f3b..0cbedab 100644 --- a/README.md +++ b/README.md @@ -302,10 +302,32 @@ In order to send and receive data from python, you need this library. Run the fo pip3 install paho-mqtt ``` + ### Install OpenCV -Use the quick version without virtual env -https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and-raspbian-buster/ +We need to install the latest OpenCV version. Unfortunately, it is not available in the repositories. We are going to install it directly by using pip. + +First, we need to install the needed dependencies, then we will directly install opencv: +```sh +sudo apt install libgtk-3-0 libavformat58 libtiff5 libcairo2 libqt4-test libpango-1.0-0 libopenexr23 libavcodec58 libilmbase23 libatk1.0-0 libpangocairo-1.0-0 libwebp6 libqtgui4 libavutil56 libjasper1 libqtcore4 libcairo-gobject2 libswscale5 libgdk-pixbuf2.0-0 libhdf5-dev libilmbase-dev libopenexr-dev libgstreamer1.0-dev libavcodec-dev libavformat-dev libswscale-dev libwebp-dev libatlas-base-dev +sudo pip3 install opencv-contrib-python==4.1.0.25 +``` + +You can now check that opencv is properly installed by running a python interpreter and importing the cv2 module. +```sh +pi@planktoscope:~ $ python3 +Python 3.7.3 (default, Dec 20 2019, 18:57:59) +[GCC 8.3.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> import cv2 +>>> cv2.__version__ +'4.1.0' +>>> quit() +``` + +If all goes well, the displayed version number should be `4.1.0`. + +More detailed information can be found on this [website](https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and-raspbian-buster/). ### Install MorphoCut