Ubuntu编译Opencv3.1

转自:http://jingyan.baidu.com/article/cb5d6105e4519e005c2fe014.html

opencv3.1 刚出来没多久,我相信这个时候  在Linux怎么安装在国内应该是比较领先的,所以今天把我安装过程分享给大家。如果大家有更好的安装方法欢迎相互讨论


方法/步骤

  1. apt-get update

    apt-get upgrade

  2. apt-get install libqt4-dev libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev  libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip 

  3. 下载opencv3.1 

    wget https://github.com/Itseez/opencv/archive/3.1.0.zip

  4. 下载完了 放在 /usr/local

    用 unzip 解压刚才下载文件

  5. 进入opencv-3.1.0

    创建build

  6. 进入 build 

    接下来 就开始干

    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

  7. make -j $(nproc)

    make  install 

  8. /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'

     ldconfig(这一步很重要)

  9. pkg-config --modversion opencv

    pkg-config --cflags opencv



你可能感兴趣的:(Ubuntu编译Opencv3.1)