主要参考的是OpenCV官方的这篇文章:OpenCV: Installation in MacOS
安装OpenCV需要下载一些安装包:CMake3.9、Git、Python这些我之前已经下载好,这里就不过多阐述了,自行百度安装即可
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git?
mkdir build_opencv
进入创建的目录
cd?build_opencv
(-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules扩展库) (-DBUILD_DOCS=ON构造文档)
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -DBUILD_DOCS=ON ../opencv
?最后输出如下就是配置完成:
make -j7 ?
编译构建后的目录:
?完成