[Bug集合]OpenCV Error: Bad argument (Unknown matcher name) in create

出现在编写视觉SLAM第七讲时的bug。

Starting: /media/eminbogen/Eminbogen001/Temp/SLAM/test program/7.0/build/pose_estimation_2d2d /media/eminbogen/Eminbogen001/Temp/SLAM/slambook-master/ch7/1.png /media/eminbogen/Eminbogen001/Temp/SLAM/slambook-master/ch7/2.png
OpenCV Error: Bad argument (Unknown matcher name) in create, file /home/eminbogen/下载/opencv-3.1.0/modules/features2d/src/matchers.cpp, line 1016
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/eminbogen/下载/opencv-3.1.0/modules/features2d/src/matchers.cpp:1016: error: (-5) Unknown matcher name in function create

关键是这个问题是在运行时产生而不是编译,所以不知道具体位置。其实看报错内容也知道是matcher的名字不对,但是我看了名字后发现没问题,最后证明是我没仔细看(疲劳?),然后一行一行地找问题。。。

Right:
Ptr<DescriptorMatcher> matcher = DescriptorMatcher::create("BruteForce-Hamming");
False:
Ptr<DescriptorMatcher> matcher = DescriptorMatcher::create("BruteForce_Hamming");

猜你喜欢

转载自blog.csdn.net/unlimitedai/article/details/86531613