Ubuntu14.04下opencv3.1.0的配置

1. 依赖:

[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

2. 下载:

下载linux下的opencv文件:opencv-3.1.0.zip http://opencv.org/,并解压到一个临时目录下。

可选文件:

opencv-contrib.zip https://github.com/opencv/opencv_contrib.git


3.  使用CMake编译源码:

解压已下载的文件

将opencv-contrib放入opencv-3.1.0文件中  ###### if you want use opencv-contrib

进入临时目录,并用cmake编译:

cd ~/opencv-3.1.0
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_LAPACK=OFF .. ####### if no opencv-contrib
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DOPENCV_EXTRA_MODULES_PATH=../opencv-contrib/modules/ -DWITH_LAPACK=OFF ..  ####### if opencv-contrib
 
   
 
    
   

安装:

make -j2
sudo make install

 
   
 
   
 
  

4. 错误:

ICV hash校验值不符或者是下载ippicv_linux_20151201.tgz文件超时,造成如下错误:

CMake Error at 3rdparty/ippicv/downloader.cmake:75 (message):
  ICV: Failed to download ICV package: ippicv_linux_20151201.tgz.
  Status=28;"Timeout was reached"

下载v3.1.0/protobuf-cpp-3.1.0.tar.gz文件超时,造成如下错误:

CMake Error at cmake/OpenCVUtils.cmake:1047 (message):
  Failed to download v3.1.0/protobuf-cpp-3.1.0.tar.gz.  Status=28;"Timeout
  was reached"

下载好这两个文件,分别放入报错信息中显示的文件夹里:

opencv-3.1.0/3rdparty/ippicv/downloads

opencv-3.1.0/opencv_contrib/modules/dnn/.download/bd5e3eed635a8d32e2b99658633815ef/v3.1.0/


你可能感兴趣的:(OpenCV,Linux)