1.在OpenCV 4.6.0中函数签名如下:
static Ptr<DescriptorMatcher> cv::DescriptorMatcher::create(const String & descriptorMatcherType)
static Ptr<DescriptorMatcher> cv::DescriptorMatcher::create(const DescriptorMatcher::MatcherType & matcherType)
2.在OpenCV 3.3.0中函数签名如下:
static Ptr<DescriptorMatcher> cv::DescriptorMatcher::create(const String & descriptorMatcherType)
static Ptr<DescriptorMatcher> cv::DescriptorMatcher::create(int matcherType)
3.将int转换为枚举类型,以便通过组合框选择类型
//! 在OpenCV3.3.0中
descMather = DescriptorMatcher::create(ui->matcherCombo->currentIndex() + 1);
//! 在OpenCV4.6.中
int matcherType = ui->matcherCombo->currentIndex() + 1;
descMather = DescriptorMatcher::create(static_cast<DescriptorMatcher::MatcherType>(matcherType));
descMather->match(descriptor1, descriptor2, matches);
标签:matcherType,create,DescriptorMatcher,OpenCV,static,cv From: https://www.cnblogs.com/zdt168/p/16863151.html