Opencv3.2.0安装为例
一、下载opencv3.2.0
链接:https://opencv.org/opencv-3-2.html
二、下载opencv_contrib
链接:https://github.com/opencv/opencv_contrib
三、下载cmake
四、配置cmake
/Users/LXJ/Downloads/opencv-3.2.0
在where to build the binaries中填入
/Users/LXJ/Downloads/opencv-3.2.0/release
点击configure
选择unix makefile,其他默认。
在Search中输入extra,选中OPENCV_EXTRA_MODULES_PATH,
在value中输入opencv_contrib_master库的modules路径
CMake Error at /Users/LXJ/Downloads/opencv-3.2.0/cmake/OpenCVUtils.cmake:1043 (file):
file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):
/Users/LXJ/Downloads/opencv_contrib-master/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
/Users/LXJ/Downloads/opencv_contrib-master/modules/xfeatures2d/CMakeLists.txt:9 (download_vgg_descriptors)
CMake Error at /Users/LXJ/Downloads/opencv-3.2.0/cmake/OpenCVUtils.cmake:1047 (message):
Failed to download . Status=
Call Stack (most recent call first):
/Users/LXJ/Downloads/opencv_contrib-master/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
/Users/LXJ/Downloads/opencv_contrib-master/modules/xfeatures2d/CMakeLists.txt:9 (download_vgg_descriptors)
1、在modules中找到对应文件,打开。
2、将FILENAME替换为PACKAGE,再次编译。
3、编译过程中,遇到问题,继续上述过程。
完成后,点击generate。
3、在终端中打开opencv3.2.0的release文件夹
cd /Users/LXJ/Downloads/opencv-3.2.0/release/
文件夹中生成makefile文件