Ubuntu16.04下安装OpenCV3.2.0(cpu)

 

1.安装官方给的opencv依赖包

$ sudo apt-get install build-essential
$ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev # 处理图像所需的包
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev
$ sudo apt-get install libxvidcore-dev libx264-dev # 处理视频所需的包
$ sudo apt-get install libatlas-base-dev gfortran # 优化opencv功能
$ sudo apt-get install ffmpeg

 $ sudo apt-get install build-essential libgtk2.0-dev libvtk5-dev libjpeg-dev libtiff5-dev libjasper-dev libopenexr-dev libtbb-dev

2.下载opencv3.2.0

$ wget https://github.com/opencv/opencv/archive/3.2.0.zip # 从github上直接下载或者clone也可

  $ unzip 3.2.0.zip

3.配置编译opencv (无NVIDIA CUDA版本) 

$ cd opencv-3.2.0
$ mkdir build
$ cd build

$ cmake ..

$ make

$ sudo make install

$ sudo build

4.测试opencv是否安装成功,在python中调用

$ python

>>import cv2

>>

 

你可能感兴趣的:(Ubuntu16.04下安装OpenCV3.2.0(cpu))