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、下载openCV3.2.0的源码并解压

$ wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip
$ unzip opencv.zip

4、编译安装

$ cd opencv-3.2.0
$ mkdir build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make -4j
$ sudo make install

5、安装zbar

$ brew install zbar
$ sudo apt-get install libzbar0
$ python2 -m pip install pyzbar --user

6、验证安装

输入

$ python

在>>>后依次输入

>>> import cv2
>>> cv2.__version__
>>> import zbar

验证安装。

看懂了就给个赞呗~

发布了12 篇原创文章 · 获赞 16 · 访问量 287

猜你喜欢

转载自blog.csdn.net/THU_COCO/article/details/104532550