diff --git a/ReadMe.md b/ReadMe.md index 1d6292eb1edcdb2d5863055ca5f9dacb0f1b2dd7..d8a397ec5e61909d481e4a2adbe47d297511f83b 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -23,13 +23,24 @@ sudo apt-get update sudo apt-get install libgtk2.0-dev pkg-config wget https://github.com/opencv/opencv/archive/3.3.0.zip -O temp.zip && unzip temp.zip && rm temp.zip cd opencv-3.3.0 -git clone https://github.com/opencv/opencv_contrib.git && cd opencv_contrib && git checkout 3.3.0 && cd .. +git clone https://github.com/opencv/opencv_contrib.git +cd opencv_contrib +git checkout 3.3.0 +cd .. +``` +In ubuntu 20.04 a [bug](https://stackoverflow.com/questions/56845909/invalid-conversion-error-in-cv2-file-while-installing-opencv-3-3-0-on-raspberry/56919661) has to be fixed before compiling: + +```sh +sed -i 's/char\* str = PyString_AsString(obj)/const char\* str = PyString_AsString(obj)/g' modules/python/src2/cv2.cpp +``` +Compilation has to be done disabling FFMPEG acording to [this bug](https://stackoverflow.com/questions/46884682/error-in-building-opencv-with-ffmpeg) +```sh mkdir build && cd build -cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_CXX_FLAGS="-fPIC -std=c++11" -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules .. +cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_CXX_FLAGS="-fPIC -std=c++11" -D OPENCV_EXTRA_MODULES_PATH=../ opencv_contrib/modules -D WITH_FFMPEG=OFF .. make -j4 sudo make install ``` - * NOTE: Check that opencv and `opencv_contrib` versions are the same. +NOTE: Check that `opencv` and `opencv_contrib` versions are the same. * [YAML cpp](https://github.com/jbeder/yaml-cpp): Used to load parameters from YAML files. To install it run the following commands: