1.http://opencv.org/ 下载安装包并解压
2.安装依赖
[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
3.编译安装
$ cd opencv-3.2.0
$ sudo mkdir build
$ cd build
$ sudo cmake .. 可以在文件的默认追加新编译的3.10版本的路径,也就是cmake时:CMAKE_INSTALL_PREFIX=/usr/local/opencv/
4.安装
$ sudo make -j4
$ sudo make install
5.查看版本号
$ pkg-config --modversion opencv