Ubuntu 16.04’te OpenCV Derlemek

Anaconda’nın içindeki Python’ı kullanmak istediğimde hata aldım. Ubuntu ile gelen Python’ı kullandım.

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local  \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D INSTALL_C_EXAMPLES=OFF \
    -D BUILD_EXAMPLES=ON \
    -D PYTHON_INCLUDE_DIR=~/anaconda3/include/python3.6m \
    -D PYTHON_LIBRARY=~/anaconda3/lib/libpython3.6m.so \
    -D PYTHON2_EXECUTABLE=/usr/bin/python2.7 \
    -D PYTHON2_INCLUDE_PATH=/usr/lib/python2.7/dist-packages \
    -D PYTHON2_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython2.7.so \
    -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ../

make -j4
sudo make install
sudo ldconfig

Kaynak: http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/