0

在制作期间错误发生了

这是错误出现之前的程序

1.从opencv的github和opencv_contrib 4.3.0下载源代码

2.在opencv源码目录名下创建一个目录opencv_contrib

3.进入构建目录并输入代码

cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..

cmake 未下载时要下载的一些文件,但我手动下载了这些文件,并且所有下载失败的文件都被复制到所需的路径

然后开始制作

make -j7

制作时出错

Scanning dependencies of target opencv_test_xfeatures2d
[ 90%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_detectors.cpp.o
[ 90%] Building CXX object modules/gapi/CMakeFiles/opencv_test_gapi.dir/test/internal/gapi_transactions_test.cpp.o
[ 90%] Building CXX object modules/gapi/CMakeFiles/opencv_test_gapi.dir/test/own/conc_queue_tests.cpp.o
[ 90%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_test_xfeatures2d.dir/test/test_features2d.cpp.o
[ 90%] Building CXX object modules/xfeatures2d/CMakeFiles/opencv_perf_xfeatures2d.dir/perf/perf_surf.ocl.cpp.o
/home/wang/Documents/opencv-4.3.0/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp: In member function ‘virtual void opencv_test::{anonymous}::Features2d_SIFTHomographyTest_regression_Test::Body()’:
/home/wang/Documents/opencv-4.3.0/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp:366:88: error: ‘SIFT’ has not been declared
 TEST(Features2d_SIFTHomographyTest, regression) { CV_DetectPlanarTest test("SIFT", 80, SIFT::create()); test.safe_run(); }
                                                                                        ^~~~
/home/wang/Documents/opencv-4.3.0/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp: In member function ‘virtual void opencv_test::{anonymous}::Features2d_SIFT_using_mask_regression_Test::Body()’:
/home/wang/Documents/opencv-4.3.0/opencv_contrib/modules/xfeatures2d/test/test_features2d.cpp:435:39: error: ‘SIFT’ has not been declared
     FeatureDetectorUsingMaskTest test(SIFT::create());

参考网站

https://www.cnblogs.com/fx-blog/p/8213704.html

https://blog.csdn.net/u011736771/article/details/85960300

4

1 回答 1

0

我在 4.3.0 版本中遇到了同样的问题,SIFT 已从 xfeatures2d 中移出,但我认为它没有插入到 4.3.0 版本的主分支中。只需下载master(开发)分支,问题就解决了

于 2020-06-17T17:24:11.407 回答