首页 > 其他分享 >解决OpenCV 4描述符匹配器(cv::DescriptorMatcher)create函数的参数类型问题

解决OpenCV 4描述符匹配器(cv::DescriptorMatcher)create函数的参数类型问题

时间:2022-11-06 17:45:45浏览次数:67  
标签:matcherType create DescriptorMatcher OpenCV static cv

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

相关文章

  • How to create projrect in git
    第一步,在本机选择一个地方,创建一个空目录,如learngit,并进入这个添加的目录:$mkdirlearngit$cdlearngit第二步,通过gitinit命令把这个目录变成Git可以管理的仓库:$git......
  • OpenCV图像处理与视频分析详解
    1、OpenCV4环境搭建VS2017新建一个控制台项目配置包含目录配置库目录配置链接器配置环境变量重新启动VS20172、第一个图像显示程序main.cpp#i......
  • 运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message
    运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException:Message:sessionnotcreated        原因:ChromeDriver版本与浏览器版本不......
  • 模板匹配(createTrackbar函数这样用)
    一、模板匹配模板匹配(TemplateMatching)就是在一幅图像中寻找和模板图像(template)最相似的区域,该方法原理简单计算速度快,能够应用于目标识别,目标跟踪等多个领域。二、原理......
  • opencv遇到std::bad_alloc异常
    配置opencv环境时遇到的,首先注意解决方案平台是x64而不是x86,然后属性管理器->Debug|64右键属性->链接器->输入->附加依赖项中,把opencv_world460.lib(不同版本数字不同,位......
  • OpenCV 实现BGR转RGB
    一、问题当使用opencv函数imread()读取图片时,颜色的顺序是BGR(blue、green、red),而Pillow的颜色顺序又是RGB,因此我们可能需要将BGR转RGB。二、转换可以通过以下几种方法......
  • mexopencv配置
    配置环境:Win10+VS2015+Opencv3.3+matlab2016a第一步:下载mexopencv链接:对应版本为opencv3.3.1对应下载地址:​​https://github.com/kyamagu/mexopencv/tree/v3.3.1​​......
  • ARCHIV_CREATE_FILE 员工头像上传
    *&---------------------------------------------------------------------**&ReportZHRR_011*&----------------------------------------------------------------......
  • 相同的一段代码放在mounted钩子函数里就可以执行, 放在created钩子函数里就不可以执行
    现象这样一段代码---蓝色部分代码,放在放在mounted钩子函数里就可以执行,但是我看它并不涉及dom的操作,不如放到created钩子函数里执行,并且可以在非路由跳转的情况下......
  • spring-boot-2.0.3启动源码篇四 - run方法(三)之createApplicationContext
    前言此系列是针对springboot的启动,旨在于和大家一起来看看springboot启动的过程中到底做了一些什么事。如果大家对springboot的源码有所研究,可以挑些自己感兴趣或者对自......