Installing Open CV

You can install the Open Source Computer Vision (OpenCV) 3.2 library if you need to customize models with the features of OpenCV 3.2.

Procedure

  1. Get the OpenCV source code from Github:
    wget https://github.com/opencv/opencv/archive/3.2.0.zip
  2. Unpack the downloaded package and change to the package directory:
    unzip 3.2.0.zip
    cd opencv-3.2.0
  3. Create a building subdirectory and change to the directory:
    mkdir build
    cd build
  4. Prepare and generate the building configuration:
    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON ..
  5. Compile and build the package:
    make -j $(($(nproc) + 1))
  6. Install the package:
    sudo make install
  7. Register the libraries and modules to the system:
    sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
    sudo ldconfig
  8. If required, uninstall the old opencv version to avoid version collision:
    sudo apt-get autoremove libopencv-dev