OpenCV安装过程
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
参考:Linux(Ubuntu 16.04)中安装OpenCV + OpenCV_Contrib
从github中down下OPenCV + OpenCV_Contrib库,指令下载:
git clone https://github.com/Itseez/opencv.git
git clone https://github.com/Itseez/opencv_contrib.git
添加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
将opencv_contrib目录移到opencv目录下,进入opencv目录,创建build目录,进入build目录,开始编译:
mkdir build
cd build
cmake -D WITH_PROTOBUF=OFF -D ENABLE_CXX11=ON -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
编译结果:
接着执行:
make -j8
报错:prtobuf 相关错误
参考:https://github.com/opencv/opencv/issues/13328
编译成功后输出如下:
最后执行:
sudo make install # 这里必须用sudo权限,否则会报错
openCV的使用
在python中直接导入cv2的库就可以用了:
import cv2
注意:用python2编译的openCV在python3中是不能用的




A beautiful web dashboard for Linux
最近提交(Master分支:5 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)