#问题1:
fatal error: features2d/test/test_detectors_regression.impl.hpp: No such file or directory
#解决方法:
原因是没找到这个文件,解决方法如下:
将opencv-4.4.0/modules/features2d复制,然后粘贴到build目录中来解决该问题
cd build
cp -r ../modules/features2d .
#问题2:
/root/opencv-4.4.0/opencv_contrib-4.4.0/modules/xfeatures2d/src/vgg.cpp:490:41: fatal error: vgg_generated_120.i: No such file or directory
/root/opencv-4.4.0/opencv_contrib-4.4.0/modules/xfeatures2d/src/boostdesc.cpp:654:37: fatal error: boostdesc_bgm.i: No such file or directory
#解决方法
#我提供百度云盘中的文件boostdesc.tar.gz解压
cd /root/boostdesc
cp * ../opencv-4.4.0/opencv_contrib-4.4.0/modules/xfeatures2d/src/
#问题3:
fatal error: opencv2/xfeatures2d.hpp: No such file or directory
#解决方法
将opencv-4.4.0/opencv_contrib-4.4.0/modules/xfeatures2d/test/test_features2d.cpp中的
#include "features2d/test/test_detectors_regression.impl.hpp"
#include "features2d/test/test_descriptors_regression.impl.hpp"
改为
#include "test_detectors_regression.impl.hpp"
#include "test_descriptors_regression.impl.hpp"
再将opencv-4.4.0/opencv_contrib-4.4.0/modules/xfeatures2d/test/test_rotation_and_scale_invariance.cpp中的
#include "features2d/test/test_detectors_invariance.impl.hpp"
#include "features2d/test/test_descriptors_invariance.impl.hpp"
改为
#include "test_detectors_invariance.impl.hpp"
#include "test_descriptors_invariance.impl.hpp"
#问题4:
fatal error: opencv2/xfeatures2d.hpp: No such file or directory
#解决方法:
cd /home/cxzx/opencv-4.4.0
vim CMakeLists.txt
INCLUDE_DIRECTORIES("/home/cxzx/opencv-4.4.0/opencv_contrib-4.4.0/modules/xfeatures2d/include")