- Clone opencv and opencv_contrib:
git clone https://github.com/opencv/opencv.git git clone https://github.com/opencv/opencv_contrib.git
- Grab the opencv dependencies, listed here: https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
- Create a build directory under the opencv directory:
cd <path_to_opencv> mkdir build cd build
- Make sure you are on the 3.2.0 branch, then run cmake for opencv3 using the following command in the build directory.
I found that the opencv_python3 failed a lot to build, you can turn it back on if you want.
cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DOPENCV_ENABLE_NONFREE=ON -DENABLE_PRECOMPILED_HEADERS=OFF -DBUILD_opencv_xfeatures2d=ON -DBUILD_opencv_python3=OFF ..
- Run make and make install
make -j`nproc` && sudo make install