本文记录在Ubuntu16.04 LTS操作系统中从源代码编译安装OpenCV的过程。
安装必需的软件包
1 | [compiler] sudo apt-get install build-essential |
下载OpenCV源代码
1 | cd ~/<my_working_directory> |
使用CMake构建OpenCV
创建临时的build目录
1 | cd ~/opencv |
创建配置文件
1 | $ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. |
构建OpenCV
1 | make -j3 # runs 3 jobs in parallel |
安装OpenCV
1 | sudo make install |
参考链接
- Installation in Linux, by opencv.
- 4.0.0 does not produce pkgconfig file, by opencv.
- Pkg-config,by wikipedia.