gpt4 book ai didi

c++ - opencv:对 `cv::cuda::DescriptorMatcher::createBFMatcher(int)' 的 undefined reference

转载 作者:太空宇宙 更新时间:2023-11-03 22:51:03 25 4
gpt4 key购买 nike

我正在尝试编译 opencv-3.1.0/samples/gpu/surf_keypoint_matcher.cpp 通过:

g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/local/lib/-g -o 二进制 surf_keypoint_matcher.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_stitching -lopencv_imgcodecs -lopencv_xfeatures2d

但是我收到了这个错误:

/tmp/ccQW7t3Z.o: In function `main':
/home/luca/Downloads/opencv-3.1.0/samples/gpu/surf_keypoint_matcher.cpp:65: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
collect2: error: ld returned 1 exit status

为什么?

最佳答案

您的错误信息:

/home/luca/Downloads/opencv-3.1.0/samples/gpu/surf_keypoint_matcher.cpp:65: undefined reference to `cv::cuda::DescriptorMatcher::createBFMatcher(int)'
collect2: error: ld returned 1 exit status

表明您有一个 undefined reference cv::cuda::DescriptorMatcher::createBFMatcher

这位于 cuda 库中,因此您需要包含适当的 header 并链接到以下库,因为 opencv_cudafeatures2d 取决于它们:

  • opencv_cudafilters
  • opencv_cudawarping
  • opencv_features2d
  • opencv_cudaarithmn
  • opencv_flann
  • opencv_核心

对于我正在使用的 opencv 3.1.0 版来说确实如此

关于c++ - opencv:对 `cv::cuda::DescriptorMatcher::createBFMatcher(int)' 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37656085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com