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

前言:

针对PatMax 的高级应用和原理,在这一节进行说明:


PatMax Patterns

When you train PatMax you specify a region of interest in an image or provide a description of a shape that includes the features you want to train. If you are using an image to train the PatMax software, PatMax constructs an internal geometric representation of the features that make the pattern, where features are defined by boundaries between regions of dissimilar grey values. If you are using a shape description to train the PatMax software, PatMax transforms the model information into this same internal geometric description. Once trained, PatMax execution is the same regardless of whether PatMax was trained with an image or with a shape description.

 需要训练PatMax的某个需求区域的时候,首先需要提供对这个特征需求的形态的描述,这个特征形态需求包括你想训练的特征【或者说你希望未来算子自动找寻的特征】。当使用一个1图像进行训练的时候,PatMax构建了一个内部的几何表达,并利用这些几何表达来构建模板。【案,主要是通过不同区域灰度值的边界表达来区分模板的特征区域】。PartMax也可以通过,2形状的描述,对于形态描述,PatMax将模型的信息同样投射到相同几何的表述里面去。【案,也就是最终用几何的表述来描述特征匹配模版,不因为选择图像,或者形状而改变】


Pattern Features 模板特征

模板特征,理解为一组特征值的集合。一个独立的特征往往被有区分度的连续的像素的边界点击区域来定义。【案,这些区分度的定义,可以是亮度、对比度、纹理等任何最终反映到像素边界的区域】区域的定义可以是闭合的,也可以是开放的。

PatMax pattern features are represented by an ordered list of feature boundary points. A feature boundary point has a location and an angle along with links to its neighboring boundary points. The angle of a feature boundary point is the angle between the image coordinate system x-axis and a line drawn through the feature boundary point perpendicular to the feature boundary and in the dark-to-light direction.

 PatMax算子,简单的模板特征的计算原理,是通过一个带次序的边界点集来表达的。而一个特征的边界点集包括两个重要的特性:1 位置 2 和相邻的点的角度【这一点的定义后面用图来进一步阐述】,特征边界点的角度,是在图像坐标系中,以X轴正向为起点,然后,按照dark-to-light延伸的角度【案,这里角度的定义是dark-to-light,也就是定义一个规则,规则为灰度暗的区域向灰度浅的区域的正交(90度)延伸。如下图:


Feature Size and Pattern Granularity 特征尺寸和粒度

The features that make up a pattern can be of different sizes, from features a few pixels in size to features up to 50 or 100 pixels in size. Most patterns contain features with a range of sizes.PatMax uses features of different sizes to locate the desired features in the run-time images you acquire. In general, PatMax uses large features to find an approximate pattern match in a run-time image quickly, and small features to determine the pattern location precisely.

Figure 6. Large features used for coarse location and small features for fine location

PatMax算子的逻辑,如上,就是将模板特征依据大小【案,这里应该是点集的大小】分为Large和Small,然后,利用大的特征点集来找到近似的模板,在用小的特征去进一步决定匹配模版的位置精度。

 The particular features that PatMax can detect in an image are determined by the granularity the PatMax software is currently using. Large granularity settings allow the software to detect only large features in an image, while a smaller granularity setting allows the tool to locate smaller features.

1 粒度的定义:

In addition to affecting the features that are trained as part of the pattern, pattern granularity also affects the spacing of boundary points along a feature boundary. In general, the spacing of feature boundary points is approximately equal to the pattern granularity.

PatMax uses a range of pattern granularities when it trains a pattern from an image; PatMax automatically determines the optimum granularity settings when it trains a pattern. The smallest granularity used to detect features in the training image or shape description is called the fine granularity limit. The largest granularity used to detect features is called the coarse granularity limit.You can display the actual features and feature boundary points trained using the 1 coarse and 2 fine granularity limits.

Note: PatMax trains the pattern using a range of granularities, not just the coarse and fine granularity limits. The coarse and fine limits are the largest and smallest granularities that PatMax uses.

[PatMax 算子是在最大粒度和最小粒度之间的一个范围内来训练特征的模板]


Pattern Polarity 模板的极性

Each of the boundary points that describes a pattern feature has a polarity. The polarity of a boundary point indicates whether the boundary can be characterized as1  light-to-dark or 2 dark-to-light. You can configure PatMax to find only objects in which every boundary point has the same polarity as the trained pattern, or you can configure PatMax to find objects with mismatched polarity.

一个包含某个特征的模板,特征的表达分为两种,这里定义为: 1  light-to-dark or 2 dark-to-light

上图,绿框为:dark-to-light, 红框为light-to-dark,

【案,PatMax的特征模板训练,如左图,如果我们想要绿框的结果,那么,需要在配置算子的时候,选择Matching polarity,否则,选择Mismatched polarity。】


 Pattern Masking

这个算子的功能比较简单:就是屏蔽掉你不想处理的部分。

Note: Pattern masking is not supported for shape training since you can design your shape description to include only desired features and thus have no need to mask out unwanted features.

The mask image is interpreted as follows:

  • All pixels in the training image that correspond to pixels in the mask image with values greater than or equal to 192 are considered care pixels. All feature boundary points detected within care pixels are included in the trained pattern.
  • All pixels in the training image that correspond to pixels in the mask image with values from 0 through 63 are considered don't care but score pixels. Feature boundary points detected within don't care but score pixels are not included in the trained pattern. When the trained pattern is located in a run-time image, features within the don't care but score part of the trained pattern are treated as clutter features.
  • All pixels in the training image that correspond to pixels in the mask image with values from 64 through 127 are considered don't care and don't score pixels. Feature boundary points detected within don't care and don't score pixels are not included in the trained pattern. When the trained pattern is located in a run-time image, features within the don't care and don't score part of the trained pattern are ignored and not treated as clutter features.
  • Mask pixel values from 128 through 191 are reserved for future use by Cognex.

【案,Masking 功能在Shape的模板判别的时候是不使能的。 现在看Mask也是通过灰度的值来决定,这里的阈值大约在192这个大小】

这个逻辑同时包括,dark-to-light的基本定义,边缘的定义以黑色为默认。

有关不同的灰度定义下的逻辑:

  • >= 192   的区域被认为被搜索,或者成为训练区域,这里会对图像的所有特征进行检测
  • 0 到 63的高亮区域,为不考虑,但是积分(score pixels)像素区域。【案,PatMax算法有一个计分的因子,用于评判特征匹配的相似程度,这里我理解的积分的区域,是在做特征匹配度的评分的时候,会考虑0到63的区域用于评分。这应该该是一个参考的分数。】,score pixels 影响的特征判断的特征,这里定义为 clutter features【案,理解为其他(凌乱)的小特征】
  • 64到127的灰度区域,也是mask在设定的时候,我们看到的区域,会被任务是不需要处理的像素点区域。
  • 128 到 191的区域是康耐视软件预留的区域

【案,康耐视的掩膜的定义,显然,和灰度的定义有相关性,但是,感觉有点不同,这里面混杂了处理的逻辑,这一点是不是很好,我想值得商榷】

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

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

相关文章

Mac电脑技巧:通过 5 种方法从 Mac 上的 SD 卡恢复已删除的文件

SD 卡重量轻且便于携带,是广受欢迎的存储设备。它们通常用于相机、车载录像机、安全门铃等。假设您是一位摄影爱好者,使用 SD 卡来存储您珍贵的回忆:您需要意识到,与易用性相反的是其易碎性,这意味着 SD 卡上的数据可能…

最好的十大儿童护眼灯品牌有哪些?十大护眼大路灯品牌排行榜

最好的十大儿童护眼灯品牌有哪些?作为一名宝爸兼测评博主,对于孩子的视力健康我是极其关注的,可以说经常跟护眼灯打交道。一开始在这方面上我也踩雷不少坑!测评用过这么多护眼大路灯最大的感受就是,有些护眼大路灯完全…

Redis技术解析(基础篇)

1.初识Redis Redis是一种键值型的NoSql数据库,这里有两个关键字: 键值型 Redis-server NoSql 其中键值型,是指Redis中存储的数据都是以key、value对的形式存储,而value的形式多种多样,可以是字符串、数值、甚至jso…

莲藕炖排骨-UMLChina建模知识竞赛第5赛季第15轮

DDD领域驱动设计批评文集 做强化自测题获得“软件方法建模师”称号 《软件方法》各章合集 只要最先答对前3题,即可获得本轮优胜。 如果有第4题,第4题为附加题,对错不影响优胜者的判定,影响的是优胜者的得分。 所有题目的回答必…

2024/9/19 英语每日一段

One driver told the Guardian that when the renewal quote for her Saga over-50s car insurance arrived, the cost of the policy had jumped 77% to £2,044 even though “nothing has changed”. Saga said it was experiencing “high levels of claims infl…

【笔记】扩散模型(八):DALL-E 2 (unCLIP) 论文解读与代码实现

论文链接:Hierarchical Text-Conditional Image Generation with CLIP Latents 非官方实现:lucidrains/DALLE2-pytorch DALL-E 2 是一个比较经典的文生图模型,虽然和 Stable Diffusion 的架构有些区别,但是也利用了 CLIP 的文本-图…

2024CCPC网络赛

vp链接&#xff1a;Dashboard - The 2024 CCPC Online Contest - Codeforces B. 军训 II 序列 a 从小到大排列或者从大到小排列时&#xff0c;不整齐度是最小的。方案数是所有相同数字的个数的排列数的乘积。如果首尾的数字不同的话&#xff0c;还要再乘个 2。 #include <…

【在Linux世界中追寻伟大的One Piece】进程间关系与守护进程

目录 1 -> 进程组 1.1 -> 什么是进程组 1.2 -> 组长进程 2 -> 会话 2.1 -> 什么是会话 2.2 -> 如何创建会话 2.3 -> 会话ID(SID) 3 -> 控制终端 4 -> 作业控制 4.1 -> 什么是作业(job)和作业控制(Job Control) 4.2 -> 作业号 4.3…

【他山之石】优化 JavaScript 的乐趣与价值(下)

前言 继本文的 上篇 发表之后&#xff0c;没想到反响还挺好&#xff0c;看来大家在 JS 优化的问题上越来越注重“与国际接轨”了。一起来看本文的下篇&#xff0c;也是干货满满。 文章目录 6. Avoid large objectsWhat the eff should I do about this? 7. Use eval8. Use str…

Linux用户账号管理

目录 一、useradd 创建新用户 二、usermod 修改用户账号 三、userdel 删除用户账号 四、passwd 设置或更改用户密码 五、who 或 w 查看当前登录用户 六、切换用户 6.1. su命令切换用户 6.2. sudo授权命令 6.2.1. sudo的特性 6.2.2. sudo的相关文件 6.3. exit退出 6…

自制数据库迁移工具-C版-04-HappySunshineV1.4-(支持Gbase8a、PG)

目录 一、环境信息 二、简述 三、架构图 四、升级点 五、支持功能 六、安装包下载地址 七、配置参数介绍 八、安装步骤 1、配置环境变量 2、生效环境变量 3、检验动态链接是否正常 4、修改配置文件MigrationConfig.txt &#xff08;1&#xff09;Gbase8a -> Gba…

Axios基本语法和前后端交互

Axios是一个js框架&#xff0c;用于发送ajax请求。 一、导入 // node中&#xff0c;使用npm安装 npm install axios // HTML中&#xff0c;使用cdn安装 <script src"https://unpkg.com/axios/dist/axios.min.js"></script> 二、基本使用 // 使用axios…

x264中的cabac编码实现

typedef struct { /* state */ int i_low; //概率状态的范围low int i_range; //当前概率状态 范围range /* bit stream */ int i_queue; //stored with an offset of -8 for faster asm 队列中可输出的bits 个数&#xff0c;-8 开始&#xff0c;是为了方便asm优化 int i_byt…

数据防泄密系统的构建与功能分析(实用物料)

一、构建1、需求分析&#xff1a;明确企业需要保护的敏感数据类型&#xff08;如商业机密、研发资料等&#xff09;及其潜在的泄露途径&#xff08;如网络传输、文件共享、打印复印等&#xff09;。 2、策略&#xff1a;根据需求分析结果&#xff0c;制定详细的数据防泄密策略…

数字逻辑电路-加法器

目录 半加器和全加器 半加器 ​全加器 集成全加器 利用全加器实现二进制的乘法功能 加法器 半加器和全加器 半加器 不考虑低位进位的加法。 本位为s&#xff0c;进位为c。 全加器 多了一个相邻低位来的进位数。 集成全加器 左上角和右下角那两个是不用的。 利用全加器…

Selenium通过ActionBuilder模拟鼠标操作直接移动到指定坐标的注意事项

在目前&#xff08;2024-09-18&#xff09;得Selenium官方手册中&#xff0c;模拟鼠标操作基本上都是通过ActionChains完成的&#xff0c;唯独有一动作&#xff0c;是通过ActionBuilder完成的。 而前者ActionChains&#xff0c;主要是通过offset&#xff0c;也就是坐标偏移量来…

RK3568笔记五十九:FastSAM部署

若该文为原创文章,转载请注明原文出处。 记录FastSAM训练到部署全过程,转换模型和yolov8一样。 一、介绍 Fast Segment Anything Model (FastSAM) 是一种基于 CNN 的新型实时解决方案,可用于 Segment Anything 任务。该任务旨在根据各种可能的用户交互提示分割图像中的任何…

AT24CXX系列eeprom的相关知识总结

常用的eeprom存储器件有很多容量类型&#xff0c;AT系列的eeprom有at24c01,at24c02…at24c1024等。我们来做一个总结。 1.常见的型号含义 at24c01&#xff1a;表示1kbit&#xff08;128BYTE*8&#xff09; at24c02&#xff1a;表示2kbit&#xff08;256BYTE*8&#xff09; . .…

pybind11 学习笔记

pybind11 学习笔记 0. 一个例子1. 官方文档1.1 Installing the Library1.1.1 Include as A Submodule1.1.2 Include with PyPI1.1.3 Include with Conda-forge 1.2 First Steps1.2.1 Separate Files1.2.2 PYBIND11_MODULE() 宏1.2.3 example.cpython-38-x86_64-linux-gnu.so 的…

二百六十四、Java——Java采集Kafka主题A的JSON数据,解析成一条条数据,然后写入Kafka主题B中

一、目的 由于Hive是单机环境&#xff0c;因此庞大的原始JSON数据在Hive中解析的话就太慢了&#xff0c;必须放在Hive之前解析成一个个字段、一条条CSV数据 二、IDEA创建SpringBoot项目 三、项目中各个文件 3.1 pom.xml <?xml version"1.0" encoding"UTF…