Skip to content

Latest commit

 

History

History
24 lines (23 loc) · 979 Bytes

opencv.md

File metadata and controls

24 lines (23 loc) · 979 Bytes

Compiling Opencv3 and Opencv_contrib from source

  1. Clone opencv and opencv_contrib:
    git clone https://github.com/opencv/opencv.git
    git clone https://github.com/opencv/opencv_contrib.git
  2. Grab the opencv dependencies, listed here: https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
  3. Create a build directory under the opencv directory:
    cd <path_to_opencv>
    mkdir build
    cd build
  4. 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 ..
  5. Run make and make install
    make -j`nproc` && sudo make install