VisionPro - 基础 - 00 模板匹配技术和在VP中的使用 - PMAlign - PatMax - (3)

news2024/9/21 8:38:09

前言:

针对PatMax 的高级应用和原理,在这一节继续进行说明:这一节主要考虑的是PatMax模板匹配的原理:


How PatMax Finds Patterns in an Image PatMax 模板匹配原理

1 Run-time Space

When you search for a PatMax pattern in a run-time image, you define the run-time space that PatMax uses. The run-time space is determined by the degrees of freedom you enable, and the range of values to consider within each degree of freedom.

PatMax identifies likely candidates within the run-time space, then determines the transformation that best describes the transformation from the trained pattern geometry to the transformed pattern geometry in the run-time image.

【案,run-time image ,其实就是实时捕获图片。run-time space 则是在执行PatMax,需要先决定自由度,有关自由度的定义参考上一篇博客,PatMax的介绍(2)。】

【案,自由度的设定中,我们会定义好自由度的阈值,比如每个自由度的识别的范围。然后, PatMax会在run-time space 来识别可能的候选的特征进行匹配。也就是依据自由度阈值来进行训练好(理解为预设)模板和实时捕获图片的匹配情况。】

2 Pattern Granularity 模板粒度

PatMax locates pattern matches in the run-time space by first searching only for the large features. After locating one or more pattern matches, it uses smaller features to determine the precise transformation between the trained pattern and the pattern match in the run-time image.

By default, PatMax uses the same range of granularities that it computed when it trained the pattern to detect features in the run-time image.

【案,PatMax在进行 模板匹配的时候,先进行最大特征的匹配。在找到1个或者多个匹配的最大特征后,再进行小特征的匹配来提高匹配的精度。这个大,小的特征就是模板粒度。】

3 PatMax的两种Run Mode模式:

PatMax supports two run modes for locating the pattern in each acquired image.

3.1 Search Image Mode

By default, PatMax uses Search Image mode and searches the entire image for the pattern it is trained to find.

3.2 Refine Start Pose mode

PatMax also supports Refine Start Pose mode, which limits the search for the pattern to within a few pixels of a defined starting position, typically supplied by another vision tool. Using Refine Start Pose mode, PatMax does not use its coarse granularity settings to search the image for larger features, and instead moves to a refined search for the smaller features assuming they are located within an extremely narrow range of the given starting position.

 【案,就是一种是全图搜索,另外一种是直接定义一个区域,进行小范围的小特征的搜索】


4  两种图像处理模式:

4.1 standard mode

4.2 High Sensitivity Mode 

Image quality can have a significant affect on PatMax's success in finding features in images. Clear, sharp, high contrast images generally yield the best results while low contrast and noisy images can be problematic. To better enable PatMax to handle this range of image quality, two execution modes are provided. For good images with low noise and high contrast, you should run the tool in standard mode, the normal mode of operation. If your images are noisy or have low contrast you may improve your results by running the tool in high sensitivity mode which will generally require more training time and more execution time. Figure 10 shows examples of good and problematic images. Note that high sensitivity mode performance may be worse than standard mode for patterns with small features. Cognex recommends standard mode for most applications.

图像质量对PatMax的匹配有决定作用。清晰、尖锐、高对比度的图像一般有最好的结果。为了能够更好的处理低质量的图片,提供了两个不同的处理模式。standard mode和high sensitivity mode。

4.2.1 Sensitivity Parameter 敏感参数

When you use high sensitivity mode you can also set the sensitivity training parameter which allows you to specify your image quality. The sensitivity parameter is a number in the range 1.0 through 10.0 that specifies the amount of noise rejection PatMax applies to run-time images. If the sensitivity parameter is set to 1.0, minimum noise rejection is applied. If the sensitivity parameter is set to 10.0 PatMax applies the maximum noise rejection. Since portions of the pattern may appear as random noise, actual pattern features may be lost. Best results are usually achieved by using the default of 2.0. Lower sensitivity parameter values have less of an affect on training time and execution time whereas higher values tend to increase these times.

If you are having problems when using the default value of 2.0, and you suspect the cause is low contrast or noisy images, you can experiment by changing the sensitivity parameter to determine an optimum setting. Increase the sensitivity parameter to make PatMax less sensitive to random noise, and decrease the sensitivity parameter to make PatMax more sensitive to the pattern. If this helps you should find your optimal setting in the range 1.0 through 5.0. It is very unlikely that a setting above 5.0 will produce an optimal result.

 【这应该是对噪点的设定阈值,范围为 1 到 10 。 然后,默认值为2。 高设定阈值,比如10,会导致实际的模板参数的缺失,同时导致处理时间的花费增加。】

【当在默认的阈值2.0发生错误的时候,低对比度或者太多的噪点也许是一个原因,这时候回,可以适当的调整阈值。增加阈值,会减少算子对随机噪点的敏感度,反之增加。不建议采用5.0以上的设定值】


 6 Pattern Weights 模板权重

When you use PatMax shape training, you supply a collection of individual shape models. Each of these shape models can be assigned a weighting factor that is used when running the tool to compute a score for how well the trained model matches the likeness found, as described in the section Assigning Weights. Shape models with larger weighting factors have more effect on the score.

【在使用形态的模板训练的时候。这时候提供一组独立的模板形态的集合。每一种形态集都可以被赋予一种加权,从而提高模板搜索的匹配度】


7 Pattern Transformations 模板变换

When you train a pattern with PatMax using either shape description or an image, PatMax creates an internal representation of the pattern's geometry. PatMax also initializes the pattern origin to a value that you specify. When PatMax returns the location of a pattern instance in a run-time image, it does so in terms of the pattern origin.

Note: In addition to specifying the pattern origin as a simple point, you can also specify a generalized pattern origin in the form of a transformation object. The use of a generalized pattern origin is described in the section Generalized Pattern Origin.

【显然, 模板的训练有两种方向,1 形态 2 图像本身。 PatMax会构建内部的模板的几何表述,这点前面的章节我们已经了解。PatMax同样会初始化一个原始模板(用户可以设置)。在PatMax返回一个模板实例的位置的时候,当然,是在这个初始化的原始模板的定义下。

那么模板的变换的概念意义是什么?笔者理解就是从模板的几何表述中,抽象出我们再配置中定义出来的变换值】

如图,【pattern origin 到底是原始模板还是模板中心点?】默认的坐标原点的值为,(70,70)点,图上十字这个点。 这里pattern origin 应该是模板的一个坐标元原点。

7.1 Pattern Transformations and Shape Training 模板变换和形态训练:

When you train PatMax using image training, it uses the selected space of the training image to relate the features in the image and the pattern origin you specify, to the root space of the training image.For shape training, you must provide information that relates the shape models you supply to the root space of a hypothetical training image. You can provide this information in either of two ways.

  • You can provide a training image with an associated coordinate space tree that defines the selected space of each of the shape models you are training.
  • You can provide a CogTransform2D object that provides a pixel from shape model transformation.

PatMax requires the information provided using these methods so that it can compute the appropriate granularity limits for pattern training.

Note: Keep in mind that the features in the trained pattern are not the same as the shapes you provide for training. If, for example, you provided a shape that was extremely small (less than 1 pixel in size), there would be no point in training that shape as a feature, since it would not be resolved in any run-time image.

 【模板的图像训练的坐标空间可以有三种:1 被测的图像空间 2 指定的模板原点,也可以理解为原始的。】

【模板的形态训练,你必须提供形态模式相关的信息来构建坐标系。这些信息包括(或的关系):

- 被测图像的相关坐标空间。

- 一个包括形态变换的a CogTransform2D object对象。

PatMax用于在模板训练时候,提供并计算近似的模板的粒度限制。

  7.2 Pattern Transformation Result模板变换的结果:

When you run PatMax, it returns a transformation that describes how the trained pattern maps into the found instance. You can use the information in this transformation in two ways:

  • As a transformation object that you can use to convert any location from the trained pattern to the corresponding location in the run-time image. You can use the transformation object to transform points between the selected space of the trained pattern (translated by any nonzero pattern origin) and the selected space of the run-time image.
  • As individual values for the ordinary degrees of freedom (the location of the pattern origin) and individual values for each of the generalized degrees of freedom that you have enabled

 【模板变换,就是模板的特征匹配可以适应自由度的变换。而模板变换的结果通过一下两点表述:1 变换对象从训练的模板的位置变换到一个我们定义的坐标系中的位置(坐标系的定义在上一小节已经介绍)。2 得到分别独立的自由度的变换值。(我们知道,在模板特征匹配的时候,我们可以从6个基本的自由度定义,选取我们关心的几个自由度,这样,在模板变换的时候,我们关心的几个自由度的值是可以同时被计算出来的。

 

上图展示了模板变换的两个方面。1 位置变换,我们看到训练的模板在新的坐标系下,坐标原点变换到Pattern origiin的变换位置。 2 就是计算这个坐标变换,带来的自由度变化【分别是X缩放不变,Y缩放压缩了一倍,而角度自由度则旋转了+135度。

7.3  Generalized Pattern Origin 生成的原始模板

As described in the preceding section, PatMax returns a transformation object that describes how the pattern in the run-time image is different from the trained pattern. The returned transformation object describes the transformation between the trained pattern and the pattern in the run-time image, as shown in Figure 13.

 一般标准的模板变换,是从训练的模板到实时的图像模板:如下:

也支持,先做逻辑的变换,再和实时的图像进行变换。

 In some cases, you may want to apply a transformation to the trained pattern before you search for the pattern in a run-time image. You apply such a transformation by supplying a generalized pattern origin. PatMax applies the transformation you supply to the trained pattern before it searches for the pattern in the run-time image. When it returns a pattern location result, it returns the transformation between the trained, transformed, pattern and the pattern in the run-time image.

有时候,你可能想在进行实时的图像匹配搜索前,先做一些变换。这有点和逻辑传递相似。 

You typically supply a generalized pattern origin to compensate for known scale or rotation changes in the trained pattern. If you supply a generalized pattern origin you should keep the following points in mind:

  • PatMax will return results that describe the difference between the trained pattern after it has been transformed by the generalized pattern origin and the pattern in the run-time image.
  • Any zone ranges and nominal values that you specify are interpreted with respect to the transformed trained pattern.
  • Supplying a generalized pattern origin has no effect on the speed, accuracy, or number of results produced by PatMax.
  • The x- and y-translation components of a generalized pattern origin are equivalent to the simple (point) origin.

通常逻辑产生(而不是输入图像)的一个原模板坐标原点( pattern origin )(主要是缩放、转动),PatMax总会同样


系列文章集表:

VisionPro - 基础 - 00 模板匹配技术和在VP中的使用 - PMAlign - PatMax - (1)-CSDN博客

VisionPro - 基础 - 00 模板匹配技术和在VP中的使用 - PMAlign - PatMax - (2)-CSDN博客1

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2151848.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

World of Warcraft [CLASSIC] International translation bug

internationalization i18n_getinternationalizationjs-CSDN博客 1)国际化翻译不完整 Chance on melee and ranged critical strike to increase your attack power by 1262 for 10s. 2)更新美酒节,服务器并发太高,被提出副本 Wo…

DataFrame生成excel后为什么多了一行数字

问题描述 python查询数据生成excel文件,生成的excel多了第一行数字索引,1,2,3,4,5...... 代码: df pd.DataFrame(data)df.to_excel(filename, sheet_name用户信息表, indexFalse) 解决: 原理也很简单,就是设置个参…

Java对象一口气讲完!φ(* ̄0 ̄)

Java Object类 Java面向对象设计 - Java Object类 Java在java.lang包中有一个Object类。 所有Java类都直接或间接扩展Object类。 所有Java类都是Object类的子类Object类是所有类的超类。 Object类本身没有超类。 Object类的引用变量可以保存任何类的对象的引用。 以下代…

python中ocr图片文字识别样例(一)

一、使用easyocr安装依赖 pip install easyocr pip install opencv-python-headless # 处理图像二、具体实现,此处有个缺陷,大家可以尝试解决下,识别的文字打印结果没问题,但是图片识别出现乱码: 2.1 具体识别的图片…

Springboot 文件上传下载相关问题

文章目录 关于Springboot 文件上传下载问题解决方案注意事项文件上传文件下载文件删除文件在线打开在写练习的时候,发现了一些小小的问题,已经在 上述代码中体现。① 代码路径碰到中文的时候,会有乱码,需要转换(内容中…

【全网首发】2024华为杯数学建模ABCDEF选题方向+完整思路代码+数据集处理+可视化结果

2024华为杯研究生数学建模比赛ABCDEF选题分析 建议选哪道题? 点击链接加入群聊【2024华为杯数学建模助攻资料】:http://qm.qq.com/cgi-bin/qm/qr?_wv1027&kxtS4vwn3gcv8oCYYyrqd0BvFc7tNfhV7&authKeyedQFZne%2BzvEfLEVg2v8FOm%2BWNg1V%2Fiv3H…

KMP算法的实现

这是C算法基础-数据结构专栏的第二十六篇文章,专栏详情请见此处。 引入 KMP算法是一种可以快速查找某一字符串在一个文本中的所有出现的算法。 下面我们就来讲KMP算法的实现。 定义 Knuth–Morris–Pratt 算法,简称KMP算法,是由Knuth、Pratt…

2024华为杯数学建模竞赛E题

2024年中国研究生数学建模竞赛E题 高速公路应急车道紧急启用模型 高速公路拥堵现象的原因众多,除了交通事故外,最典型的就是部分路段出现瓶颈现象,主要原因是车辆汇聚,而拥堵后又容易蔓延。高速公路一些特定的路段容易形成堵点&…

云手机的便捷性和安全性体现在哪?

随着5G技术的迅速发展,云手机在游戏、电商以及新媒体营销等领域中的应用日益广泛。它不仅能够显著降低成本、提升效率,还随着边缘计算和云技术的进步,展现出无限的增长潜力。 云手机的便捷性体现在哪里? 云手机的便捷性毋庸置疑。…

煤矿智慧矿井数据集 (1.煤矿采掘工作面智能分析数据集2.煤矿井下钻场智能分析数据集 )

智慧矿井智能分析数据集 数据1:数据1包含煤矿采掘工作面工人安全帽检测,工人行为检测(行走,站立,坐,操作,弯腰,靠,摔,爬),液压支撑防护…

C++ | Leetcode C++题解之第421题数组中两个数的最大异或值

题目: 题解: struct Trie {// 左子树指向表示 0 的子节点Trie* left nullptr;// 右子树指向表示 1 的子节点Trie* right nullptr;Trie() {} };class Solution { private:// 字典树的根节点Trie* root new Trie();// 最高位的二进制位编号为 30static…

en造数据结构与算法C# 用Unity实现简单的群组行为算法 之 对齐

en造数据结构与算法C# 用Unity实现简单的群组行为算法 之 聚集-CSDN博客 en造数据结构与算法C# 用Unity实现简单的群组行为算法 之 聚集-CSDN博客 演示 思路 1.检测 自然是沿用前两节的检测范围 2.对齐朝向 对齐朝向就是邻居鸟的forward加起来再除总数得到平均数 3.对齐…

企业急于采用人工智能,忽视了安全强化

对主要云提供商基础设施上托管的资产的安全分析显示,许多公司为了急于构建和部署 AI 应用程序而打开安全漏洞。常见的发现包括对 AI 相关服务使用默认且可能不安全的设置、部署易受攻击的 AI 软件包以及不遵循安全强化指南。 这项分析由 Orca Security 的研究人员进…

关于机器学习和深度学习的区别有哪些?

成长路上不孤单😊😊😊😊😊😊 【14后😊///C爱好者😊///持续分享所学😊///如有需要欢迎收藏转发///😊】 今日分享关于机器学习和深度学习区别的相关内容&…

Altium Designer(AD)百度云下载与安装(附安装步骤)

在我们日常使用当中,Altium designer常常也被简称为AD,是一款一体化的电子产品开发系统软件,主要运行在Windows操作系统上。 我们通过Altium designer把原理图设计、电路仿真、PCB绘制编辑、拓扑逻辑自动布线、信号完整性分析和设计输出等技…

企业为什么要做算法备案?

企业为什么要做算法备案? 在数字经济迅速发展的今天,算法已成为推动各行各业创新发展的核心动力。鉴于此,国家层面正积极构建完善的监管框架,旨在促进算法应用的健康发展,确保其在法治轨道上运行。 近期,一…

揭开数据能力的神秘面纱

在当今数字化时代,数据已成为企业和组织的重要资产。拥有强大的数据能力,能够帮助企业更好地理解市场、客户和业务,从而做出更明智的决策。然而,数据能力究竟是什么?它包含哪些方面?又如何提升呢&#xff1…

银河麒麟桌面操作系统V10(SP1)ssh服务安装与配置

在国产化的大背景下,各种国产操作系统逐步进入运维人员的视野,ssh作为linux远程连接工具,是运维人员必需的工具之一。本文主要介绍在银河麒麟桌面操作系统V10(SP1)上安装和配置ssh服务。 准备工作 1、查看操作系统信息 cat /etc/os-release 笔者操作系统为银河麒麟桌面操…

一款能够管控企业计算机的安全系统 | 企业终端安全管控 | 天锐DLP数据安全

天 锐 DLP可帮助企业规范对电脑计算机的使用管理,对USB存储设备、终端外节设备、桌面壁纸进行统一管控,支持限制控制面板、计算机管理、系统下的相关功能选项的使用。 【地址:点击了解天锐股份数据安全产品】 1.计算机设置 天锐DLP可对计算…

uniapp|微信小程序 实现输入四位数 空格隔开

<template><page-meta :page-style"cssVar"></page-meta><view class"container"><u-navbartitle"优惠券兑换"placeholderbgColor"#fff":autoBack"true":titleStyle"{fontFamily: SourceHa…