Ubuntu 16.04安装python2.7+openCV3.2.0
1、更新相关的package
sudo apt-get update
2、安装相关的依赖包
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
3、安装python,一般系统自带,可不装
sudo apt-get install python2.7-dev
4、下载openCV3.2.0的源码,现在是从github下载 ,也可以从官网下载
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip
5、下载完解压
unzip opencv.zip
6、编译安装
# cd opencv-3.2.0
# mkdir build
# cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
# make -4j
# sudo make install
6、验证是否成功
# python
>>> import cv2
>>> cv2.__version__
7、安装 zbar
# brew install zbar
8、下载 https://github.com/npinchot/zbar 解压并安装
# unzip zbar-master.zip
# cd zbar-master
# python setup.py install