opencv3.4.1+ubuntu18.04+anaconda 源码编译

Posted gris

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了opencv3.4.1+ubuntu18.04+anaconda 源码编译相关的知识,希望对你有一定的参考价值。

sudo apt-get install -y
    libglew-dev
    libtiff5-dev
    zlib1g-dev
    libjpeg-dev
    libpng-dev
    libjasper-dev
    libavcodec-dev
    libavformat-dev
    libavutil-dev
    libpostproc-dev
    libswscale-dev
    libeigen3-dev
    libtbb-dev
    libgtk2.0-dev
    cmake
    pkg-config

安装libjasper-dev依赖包出现如下错误
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev

cmake -D WITH_TBB=ON
-D BUILD_NEW_PYTHON_SUPPORT=ON
-D CMAKE_INSTALL_PREFIX=./install
-D WITH_V4L=ON
-D WITH_OPENGL=ON
-D WITH_VTK=ON
-D WITH_GTK=ON
-D CMAKE_BUILD_TYPE=RELEASE
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules
-D WITH_IPP=OFF
-D WITH_CUDA=OFF
-D BUILD_opencv_cudacodec=OFF
-D PYTHON_DEFAULT_EXECUTABLE=/home/gris/anaconda3/envs/tf/bin/python3
-D BUILD_opencv_python3=ON
-D BUILD_opencv_python2=OFF
-D PYTHON3_PACKAGES_PATH=/home/gris/anaconda3/envs/tf/lib/python3.7/site-packages/
-D PYTHON3_EXCUTABLE=/home/gris/anaconda3/envs/tf/bin/python3.7m
-D PYTHON3_INCLUDE_DIR=/home/gris/anaconda3/envs/tf/include/python3.7m
-D PYTHON3_LIBRARY=/home/gris/anaconda3/envs/tf/lib/libpython3.7m.so.1.0
-D PYTHON_NUMPY_PATH=/home/gris/anaconda3/envs/tf/lib/python3.7/site-packages/
-D BUILD_EXAMPLES=ON
-D BUILD_LIBPROTOBUF_FROM_SOURCES=ON
-D BUILD_opencv_hdf=OFF
..

以上是关于opencv3.4.1+ubuntu18.04+anaconda 源码编译的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu14配置opencv3.4.1

ubuntu16.04安装opencv3.4.1教程

Ubuntu16.04安装Opencv3.4.1教程

ubuntu16.04安装opencv3.4.1及卸载,以及opencv与anaconda相关问题,import cv2,no module named cv2填坑指南

ubuntu16.04安装opencv3.4.1及卸载,以及opencv与anaconda相关问题,import cv2,no module named cv2填坑指南

Opencv 断言因暗网而失败