ubuntu16.04安装opencv3.1.0

1.安装依赖
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
可选的:
sudo apt-get install checkinstall yasm libtiff5-dev libjpeg-dev libjasper-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 libeigen3-dev

2.创建编译的临时目录
cd ~/opencv-3.1.0
mkdir release
cd release
(这里release和下面对应的,尽量不要改)

3.生成cmake编译配置
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
===========================================================================
– ICV: Downloading ippicv_linux_20151201.tgz…

这里下载文件可能会出错,解决办法就是去官网下载ippicv_linux_20151201.tgz,然后放到该路径下
/home/computer/opencv-3.1.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e/
===========================================================================
miniconda2下cmake配置:
conda install -c menpo opencv3=3.1.0

4.安装
sudo make install

5.安装python-opencv
sudo apt-get install python-opencv

6.测试
python
import cv2
ubuntu16.04安装opencv3.1.0_第1张图片**
查看python下opencv版本:
cv2.version
或者查看opencv版本
pkg-config –modversion opencv
ubuntu16.04安装opencv3.1.0_第2张图片

你可能感兴趣的:(ubuntu16.04安装opencv3.1.0)