本文主要是介绍ubuntu14编译安装opencv,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
下载opencv 源码 https://github.com/opencv/opencv
下载opencv_contrib源码 https://github.com/opencv/opencv_contrib
下载完解压后,将opencv_contrib源码 拷贝到opencv下
在 opencv 下
mkdir build
cd build
在build下配置cmake 参数 (关闭opencv_vedioio模块,不然会出错。)
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -D BUILD_opencv_videoio=OFF ..
参考配置脚本
#!/bin/sh
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D BUILD_opencv_gpu=OFF \
-D BUILD_DOCS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_WITH_DEBUG_INFO=OFF \
-D BUILD_opencv_apps=OFF \
-D BUILD_opencv_calib3d=OFF \
-D BUILD_opencv_contrib=OFF \
-D BUILD_opencv_features2d=OFF \
-D BUILD_opencv_flann=OFF \
-D BUILD_opencv_gpu=OFF \
-D BUILD_opencv_ml=OFF \
-D BUILD_opencv_nonfree=OFF \
-D BUILD_opencv_objdetect=OFF \
-D BUILD_opencv_photo=OFF \
-D BUILD_opencv_stitching=OFF \
-D BUILD_opencv_superres=OFF \
-D BUILD_opencv_ts=OFF \
-D BUILD_opencv_video=OFF \
-D BUILD_opencv_videostab=OFF \
make
make opencv_contrb模块时候会报缺少 vgg_generated_120.i 以及其它文件
请从别处下载这些头文件,就能编译通过。
这篇关于ubuntu14编译安装opencv的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!