整体安装参考博客
第一个坑:
~/opencv_contrib/modules/xfeatures2d/src/boostdesc.cpp:673:20: fatal error: boostdesc_bgm.i: No such file or directory
网络差,下载失败。解决方法:自行下载后拷贝到该目录。
下载链接:https://files.cnblogs.com/files/arxive/boostdesc_bgm.i%2Cvgg_generated_48.i%E7%AD%89.rar
第二个坑:
/opencv-3.4.8/modules/stitching/include/opencv2/stitching/detail/matchers.hpp:52:12: fatal error: opencv2/xfeatures2d/cuda.hpp: 没有那个文件或目录
# include "opencv2/xfeatures2d/cuda.hpp"
头文件链接有问题,cuda.hpp在
opencv_contrib/modules/xfeaturese/opencv2
可修改matchers.hpp内cuda.hpp路径
更一劳永逸的方法:
在CMakeLists.txt增加以下内容:
INCLUDE_DIRECTORIES("opencv_contrib-3.4.0/modules/xfeatures2d/include")
CMakeLists.txt文件所在路径为:opencv-3.4.0/modules/stitching/ CMakeLists.txt
补充:cmake时会下载ippicv文件
~/下载/用完了的安装包/opencv-3.4.8/3rdparty/ippicv ippicv.cmake 47行
速度很慢可离线下载后建立软连接。