OpenCV 各个系统安装流程。
OSX 系统
安装依赖包
1 | brew install cmake pkg-config |
安装 OpenCV
1 | brew tap homebrew/science |
设置路径
1 | mkdir -p /Users/YI/Library/Python/2.7/lib/python/site-packages |
建立软连接
1 | ln -s /usr/local/Cellar/opencv/2.4.9/lib/python2.7/site-packages/cv.py cv.py |
设置编译路径
1 | export OpenCV_DIR=/usr/local/Cellar/opencv@3/3.4.5 |
XCODE 编译配置:
1 | Header Search Paths -> /usr/local/include/ |
Raspberry 系统
1 | sudo apt-get update |
CentOS 系统
1 | yum install cmake |
编译带上 FFMPEG:
1 | export PKG_CONFIG_PATH=/usr/local/ffmpeg/lib/pkgconfig:$PKG_CONFIG_PATH |
报错解决
问题:
1 | make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o] Error 1 |
解决:
1 | 修改 …/modules/highgui/src/cap_ffmpeg_impl.hpp 文件 |
Ubuntu 系统
1 | sudo apt-get install libcv-dev or libopencv-devpy |