在Ubuntu上编译opencv3.4.2源码时,遇到下面的错误, 错误1
/home/src/software/opencv-3.4.2/modules/stitching/include/opencv2/stitching/detail/matchers.hpp:52:42: fatal error: opencv2/xfeatures2d/cuda.hpp: No such file or directory
^
compilation terminated.
解决办法1: 在/home/src/software/opencv-3.4.2/modules/stitching/CMakeLists.txt中加入
INCLUDE_DIRECTORIES("/home/src/software/opencv-3.4.2/opencv_contrib-3.4.2/modules/xfeatures2d/include")
解决办法2:
根据报错信息,打开/home/src/software/opencv-3.4.2/modules/stitching/include/opencv2/stitching/detail/matchers.hpp文件,将52行
替换成
重新编译即可
错误2
/home/src/software/opencv-3.4.2/opencv_contrib-3.4.2/modules/xfeatures2d/src/boostdesc.cpp:693:46: fatal error: boostdesc_bgm.i: No such file or directory
^
compilation terminated.
解决办法: 应该是boostdesc_bgm.i文件下载失败了,需要手动下载,在/home/src/software/opencv-3.4.2/build路径下找到CMakeDownloadLog.txt,打开后搜索”boostdesc_bgm.i“,复制其下载地址到网页可以看到源码,直接拷贝源码并存为同名文件,把它放在 /home/src/software/opencv-3.4.2/opencv_contrib-3.4.2/modules/xfeatures2d/src 路径下, 以下这些文件也都需要手动下载: boostdesc_bgm.i boostdesc_bgm_bi.i boostdesc_bgm_hd.i boostdesc_lbgm.i boostdesc_binboost_064.i boostdesc_binboost_128.i boostdesc_binboost_256.i vgg_generated_120.i vgg_generated_64.i vgg_generated_80.i vgg_generated_48.i
把上述文件放置在上述指定路径下后,直接make重新编译即可
注:opencv源码编译教程和其它报错,大家可以看我之前的博客,祝大家安装顺利~
|