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

news2025/2/22 16:39:13

前言:

针对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.coloradmin.cn/o/2146529.html

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

相关文章

一个无聊的网页(无服务器实现网页在线人数统计)

项目简介 一个无聊且没有任何意义的网页… 无聊的时候打开这个网页,然后可以和这个小黄脸玩趣 (当你的鼠标到他面前,他会死死盯住你的鼠标,手机也可以用手指代替鼠标 ) 你可以看到有多少人和你样无聊 打开方式 sil…

Centos7-rpm包管理器方式安装MySQL 5.7.25

前言 本文用于学习通过Mysql压缩包在centos7中安装和配置的过程以及过程中碰到的Bug解决。 Mysql安装包下载和上传 MySQL :: Download MySQL Community Server (Archived Versions)https://downloads.mysql.com/archives/community/访问Mysql官方下载站,选择对应的…

跟《经济学人》学英文:2024年09月14日这期 “The Perfect Couple” and the new map of Moneyland

“The Perfect Couple” and the new map of Moneyland Depictions of the super-rich on screen reflect the times 原文: FIRST, pick an approachable avatar. In “The Perfect Couple”, a glitzy new drama on Netflix, this role is played by Amelia (Ev…

【Python】探索 PluginBase:Python 插件系统的灵活构建

我承认这道菜有赌的成分,果然还是赌输了。 在现代软件开发中,插件系统为应用程序提供了极大的灵活性和扩展性。Python,作为一种流行的编程语言,拥有丰富的库和框架来支持插件的开发。今天,我们将深入探讨一个名为Plug…

股指期货理论价格计算公式是什么?

股指期货,作为金融衍生品的一种,其价格与现货市场的股指价格紧密相关,但又受到多种因素的影响。了解股指期货理论价格的计算公式,对于投资者进行套利交易、风险管理等具有重要意义。本文将详细解读股指期货理论价格的计算公式&…

【Java宝典】——二维数组的寻宝之旅

二维数组 二维数组的创建和打印 数据类型[ ] [ ] 数组名称 new 数据类型[行数][列数]{初始化数据}; import java.util.Arrays;public class DyadicArray {// 二维数组的创建和打印public static void main(String[] args) {// 直接初始化一个二维数组&#xff…

openssl 生成多域名 多IP 的数字证书

openssl.cnf 文件内容: [req] default_bits 2048 distinguished_name req_distinguished_name copy_extensions copy req_extensions req_ext x509_extensions v3_req prompt no [req_distinguished_name] countryName CN stateOrProvinceName GuangDong l…

Oracle VM VirtualBox仅主机(Host-0nly)网络实现外网连接

目录 1.仅主机(Host-0nly)网络介绍 1.操作步骤 2.测试​编辑 “如果您在解决类似问题时也遇到了困难,希望我的 经验分享 对您有所帮助。如果您有任何疑问或者想分享您的经历,欢迎在评论区留言,我们可以一起探讨解决方案。祝您在编程路上顺利…

通过多模态关系图学习实现可解释的医学图像视觉问答|文献速递--Transformer架构在医学影像分析中的应用

Title 题目 Interpretable medical image Visual Question Answering via multi-modal relationship graph learning 通过多模态关系图学习实现可解释的医学图像视觉问答。 01 文献速递介绍 医学视觉问答(VQA)是医学多模态大语言模型(LL…

通信工程学习:什么是OLT光线路终端

OLT:光线路终端 OLT(Optical Line Terminal,光线路终端)是光纤通信系统中的核心局端设备,特别是在无源光网络(Passive Optical Network, PON)架构中扮演着至关重要的角色。以下是关于OLT光线路终…

GUI编程15:JPanel、JScroll 面板

视频链接:17、文本域JScroll面板_哔哩哔哩_bilibilihttps://www.bilibili.com/video/BV1DJ411B75F?p17&vd_sourceb5775c3a4ea16a5306db9c7c1c1486b5 1.JPanel package com.yundait.lesson05;import javax.swing.*; import java.awt.*;public class JPanelDem…

C++速通LeetCode中等第5题-无重复字符的最长字串

字串substr法,定义字串的头部和长度,和字串后一位对比,如果不存在重复元素则长度1,存在重复元素则头部更新,长度重置。 class Solution { public:int lengthOfLongestSubstring(string s) {string s2;//存放s的前一部分…

基于虚拟阻抗的逆变器下垂控制环流抑制策略MATLAB仿真

微❤关注“电气仔推送”获得资料(专享优惠) 模型简介 由于微电网的弱电网特性,变流器并网线路较大的阻感比会导致变流器输出功率不能近似解耦,从而影响其下垂控制的精度。另外变流器并网线路阻抗的不确定性还会导致变流器之间分…

放过自己,决绝内耗

其实真正折磨你的,从来不是任何人的绝情,也不是糟糕的事情,而是你心存幻想的期待和无法控制的想象力,很多时候,你不是过不去生活的那道坎,而是过不了你心里的那一关,世间万物都在治愈你&#xf…

深入探究 Flask 的应用和请求上下文

目标 读完本文后,您应该能够解释: 什么是上下文哪些数据同时存储在应用程序和请求上下文中在 Flask 中处理请求时,处理应用程序和请求上下文所需的步骤如何使用应用程序和请求上下文的代理如何在视图函数中使用current_app和代理request什么…

『功能项目』第三职业弓弩的平A【58】

我们打开上一篇57第二职业法师的平A的项目, 本章要做的事情是实现第三职业弓弩的平A伤害 首先修改脚本:MagicBall.cs 将脚本挂载在Sphere预制体身上 注意组件设置 运行项目 本章做了第三职业弓弩的平A伤害及显示伤害UI 接下来文章的内容: …

【深度学习】(1)--神经网络

文章目录 深度学习神经网络1. 感知器2. 多层感知器偏置 3. 神经网络的构造4. 模型训练损失函数 总结 深度学习 深度学习(DL, Deep Learning)是机器学习(ML, Machine Learning)领域中一个新的研究方向。 从上方的内容包含结果,我们可以知道,在学习深度学…

你真的需要理解Diffusion(扩散模型),它在视觉领域具有无与伦比的美丽!

【Vision结合Diffusion】模型的研究方向,探索了如何利用扩散模型在数据空间中模拟随机游走的特性,以生成高质量和逼真的图像。这一领域的研究,通过结合视觉感知和文本描述,推动了图像合成技术的发展,尤其是在个性化图像…

家用小型洗衣机哪个牌子好?五款热搜爆火型号,速来围观

在日常生活中,内衣洗衣机已成为现代家庭必备的重要家电之一。选择一款耐用、质量优秀的内衣洗衣机,不仅可以减少洗衣负担,还能提供高效的洗涤效果。然而,市场上众多内衣洗衣机品牌琳琅满目,让我们往往难以选择。那么&a…

LabVIEW提高开发效率技巧----使用事件结构优化用户界面响应

事件结构(Event Structure) 是 LabVIEW 中用于处理用户界面事件的强大工具。通过事件驱动的编程方式,程序可以在用户操作时动态执行特定代码,而不是通过轮询(Polling)的方式不断检查界面控件状态。这种方式…