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

前言:

针对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.xdnf.cn/news/146297.html

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

相关文章

生信初学者教程(五):R语言基础

文章目录 数据类型整型逻辑型字符型日期型数值型复杂数数据结构向量矩阵数组列表因子数据框ts特殊值缺失值 (NA)无穷大 (Inf)非数字 (NaN)安装R包学习材料R语言是一种用于统计计算和图形展示的编程语言和软件环境,广泛应用于数据分析、统计建模和数据可视化。1991年:R语言的最…

DOCKER 数据库管理软件自己开发--———未来之窗行业应用跨平台架构

- 数据异地容灾服务--未来之窗智慧数据服务 DATA REMOTE DISASTER RECOVERY SERVICE -CyberWin Future Docker-数据查看 CyberWin DATA Viewer 1.docker 样式 mysqli://root:密码172.17.0.2:端口/数据库 阿雪技术观 拥抱开源与共享,见证科技进步奇迹,…

25届计算机专业毕设选题推荐-基于python+Django协调过滤的新闻推荐系统

💖🔥作者主页:毕设木哥 精彩专栏推荐订阅:在 下方专栏👇🏻👇🏻👇🏻👇🏻 实战项目 文章目录 实战项目 一、基于协调过滤的新闻推荐系统…

MySQL的登陆错误:ERROR 1049 (42000): Unknown database ‘root‘

MySQL的登陆错误:ERROR 1049 (42000): Unknown database ‘root’ 安装MySQL的时候,到网上查的命令行登陆MySQL的方法都是mysql -u root -p password mysql -r root -p 123456但是奇怪的是这条命令我输进去死活都不对,它都会要求再输入一遍…

how can I train a OpenAI fine tuned model with more prompts

题意:我如何使用更多提示来训练一个 OpenAI 微调模型? 问题背景: I fine-tuned OpenAI model with some prompts following this documentation it succeeded and created a new model in the playground. How I can retrain (fine-tune) th…

如何通过蜂巢(容器安全)管理内部部署数据安全产品与云数据安全产品?

本文将探讨内部部署和云数据安全产品之间的主要区别。在思考这个问题之前,首先了解内部部署和云数据安全产品之间的主要区别。 内部部署数据安全产品意味着管理控制台位于企业客户的内部部署,而德迅云安全则在云中托管云数据安全产品。德迅云安全供应商通…

灵当CRM系统index.php存在SQL注入漏洞

文章目录 免责申明漏洞描述搜索语法漏洞复现nuclei修复建议 免责申明 本文章仅供学习与交流,请勿用于非法用途,均由使用者本人负责,文章作者不为此承担任何责任 漏洞描述 灵当CRM系统是一款功能全面、易于使用的客户关系管理(C…

Vue 修饰符 | 指令 区别

Vue 修饰符 | 指令 区别 在Vue.js这个前端框架中,修饰符(modifiers)和指令(directives)是两个非常重要的概念。这里我们深度讨论下他们区别。 文章目录 Vue 修饰符 | 指令 区别一、什么是修饰符修饰符案例常见修饰符列…

基于深度学习的花卉智能分类识别系统

温馨提示:文末有 CSDN 平台官方提供的学长 QQ 名片 :) 1. 项目简介 传统的花卉分类方法通常依赖于专家的知识和经验,这种方法不仅耗时耗力,而且容易受到主观因素的影响。本系统利用 TensorFlow、Keras 等深度学习框架构建卷积神经网络&#…

4、论文阅读:基于深度学习和成像模型的水下图像增强

基于深度学习和成像模型的水下图像增强 前言介绍物理成像模型光学成像原理数学公式深度学习方法Backscatter Estimation Module(反向散射估计模块)Direct-transmission Estimation Module(直接传输估计模块)训练方法前言 现在的主要挑战是水下机器人捕获的图像颜色失真。水…

nacos启动报错 load derby-schema.sql error

nacos 今天在使用nacos时,启动时一直报错,错误日志如下: 2024-09-16 08:27:57 Caused by: java.lang.RuntimeException: com.alibaba.nacos.api.exception.runtime.NacosRuntimeException: errCode: 500, errMsg: load derby-schema.sql err…

基于MindSpore实现Transformer机器翻译(下)

因本文内容较长,故分为上下两部分。上部分可点击以下链接查看 基于MindSpore实现Transformer机器翻译(上) 编码器(Encoder) Transformer的Encoder负责处理输入的源序列,并将输入信息整合为一系列的上下文…

分布式消息中间件kafka

文章目录 什么是kafka?整体架构 kafka核心概念1. 生产者 (Producer)2. 消费者 (Consumer)3. 主题 (Topic)4. 分区 (Partition)5. 经纪人 (Broker)6. 复制 (Replication)7. 消费者组 (Consumer Group)8. 日志段 (Log Segment) 主要功能1. 高吞吐量2. 可靠的消息传递3. 发布/订阅…

信息安全数学基础(19)同余式的基本概念及一次同余式

一、同余式概念 同余式是数论中的一个基本概念,用于描述两个数在除以某个数时所得的余数相同的情况。具体地,设m是一个正整数,a和b是两个整数,如果a和b除以m的余数相同,则称a和b模m同余,记作a≡b(mod m)。反…

电脑ip地址怎么换地区:操作步骤与利弊分析

在当今全球化的信息时代,人们经常需要访问不同地区的网络资源。然而,由于地理位置的限制,某些内容或服务可能只对特定地区的用户开放。这时,更换电脑IP地址的地区就成为了一个实用的解决方案。本文将详细介绍两种更换电脑IP地址地…

Excel--DATEDIF函数的用法及参数含义

DATEDIF函数的用法为: DATEDIF(start_date,end_date,unit),start_date表示的是起始时间,end_date表示的是结束时间。unit表示的是返回的时间代码,是天、月、年等。如下: Datedif函数的参数含义unit参数返回值的意义"y"两个时间段之间的整年数…

QEMU:模拟 ARM 大端字节序运行环境

文章目录 1. 前言2. ARM 大小端模拟测试2.1 裸机模拟测试2.1.1 大端模拟测试2.1.2 小端模拟测试 2.2 用户空间模拟测试2.2.1 大端模拟测试2.2.2 小端模拟测试 2.3 结论 3. 参考链接 1. 前言 限于作者能力水平,本文可能存在谬误,因此而给读者带来的损失&…

PLC通信协议的转化

在自动化程序设计中,常常需要对通信协议进行相互转化。例如,某个控制器需要通过PLC控制设备的某个部件的运动,但PLC只支持ModbusTCP协议,而控制器只支持CanOpen通讯协议。这时,就需要一个网关进行通信协议的转化。网关…

双击就可以打开vue项目,而不用npm run dev

右键点击桌面或其他位置,选择“新建” -> “快捷方式”,在“对象的位置”处直接输入“npm run dev”,然后下一步 自定义一个快捷方式名称 完成后,桌面会创建一个快捷方式,右键快捷方式选择属性,可以看…

MiniCPM3-4B | 笔记本电脑运行端侧大模型OpenBMB/MiniCPM3-4B-GPTQ-Int4量化版 | PyCharm环境

MiniCPM3-4B,轻松在笔记本电脑上运行大模型? 背景一、选择模型二、模型下载三、模型运行四、总结 背景 2024年9月5日,面壁智能发布了MiniCPM3-4B,面壁的测试结果声称MiniCPM3-4B表现超越 Phi-3.5-mini-instruct 和 GPT-3.5-Turbo-…