Ubuntu 16.04 编译 opencv-3.2.0 + opencv_contrib-3.2.0

注意:要在github上下载相同release版本号的opencv和opencv_contrib,否则cmake报错。

sudo apt-get remove ffmpeg x264 libx264-dev  
sudo apt-get install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg cmake qt5-default checkinstall  
sudo apt-get install liblapacke-dev  
mkdir build  
cd build  
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=/modules ..  
make -j2  
sudo checkinstall  
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'  
sudo ldconfig  

你可能感兴趣的:(Ubuntu 16.04 编译 opencv-3.2.0 + opencv_contrib-3.2.0)