亲测已经成功编译安装
参考文献:
[1].Ubuntu 16.04: How to install OpenCV
http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/
如果是cuda会出现一个错误:
make[2]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o] Error 1
make[2]: *** 正在等待未完成的任务....
[ 88%] Linking CXX executable ../../bin/opencv_test_cudaimgproc
CMakeFiles/Makefile2:9333: recipe for target 'modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all' failed
make[1]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 88%] Built target opencv_test_cudaimgproc
[ 88%] Linking CXX shared library ../../lib/libopencv_photo.so
[ 88%] Built target opencv_photo
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
idc@idc-Hi-Fi-Z77X:~/opencv-3.1.0/build$ cd ,,
bash: cd: ,,: 没有那个文件或目录
idc@idc-Hi-Fi-Z77X:~/o
解决办法:
[2]. Ubuntu 14.04 + OpenCV 3.1.0
http://www.jianshu.com/p/68ac83436a1b
j解决问题后,继续回到build 目录
重新运行:
make -j16
sudo make install
然后运行,查看自己安装的版本:
idc@idc-Hi-Fi-Z77X:~/opencv-3.1.0/build$ pkg-config --modversion opencv
3.1.0
如果需要卸载,只需在build目录下,运行uninstall命令,如:
idc@idc-Hi-Fi-Z77X:/home/deeplearning/下载/opencv-3.2.0/build$ sudo make uninstall