机器视觉 fuzzy_measure_pairs算子

Posted 沧海一笑-dj

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了机器视觉 fuzzy_measure_pairs算子相关的知识,希望对你有一定的参考价值。

00. 目录

01. 概述

fuzzy_measure_pairs - 提取垂直于矩形或环形弧的直边对。

02. 签名

fuzzy_measure_pairs(Image : : MeasureHandle, Sigma, AmpThresh, FuzzyThresh, Transition : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, RowEdgeCenter, ColumnEdgeCenter, FuzzyScore, IntraDistance, InterDistance)

03. 描述

fuzzy_measure_pairs用于提取垂直于矩形或环形弧长轴的直边对。 与measure_pairs不同的是,它还使用模糊函数来判断和选择边缘对。

提取算法与fuzzy_measure_pos相同。 另外,相邻的边被分组成对。 要提取彼此相交或包含的对,请使用fuzzy_measure_pairing。

如果Transition =‘positive’,则在RowEdgeFirst和ColumnEdgeFirst中将返回沿矩形或圆弧的长轴方向的暗到明转换的边缘点。 在这种情况下,在RowEdgeSecond和ColumnEdgeSecond中将返回具有明暗过渡的相应边。 如果Transition =‘negative’,则效果完全相反。 如果Transition =“all”,则首先检测到的边将定义RowEdgeFirst和ColumnEdgeFirst的转换。 即,取决于测量对象的定位,返回具有明暗过渡的边缘对或具有暗明过渡的边缘对。 这适合于例如测量具有相对于背景的不同亮度的物体。

在提取了子像素边缘位置之后,边缘是成对的。 配对算法对边缘进行分组,从而禁止边缘对待交织和包含。 边缘对的特征由模糊函数评估,可以通过set_fuzzy_measure或set_fuzzy_measure_norm_pair来设置。(在候选边缘对中) 选择哪个边缘对可以用参数FuzzyThresh来确定,该参数构成了所有模糊集上权重的阈值,即所定义的模糊函数的权重的几何平均值。(Which edge pairs are selected can be determined with the parameter FuzzyThresh, which constitutes a threshold on the weight over all fuzzy sets, i.e., the geometric mean of the weights of the defined fuzzy functions.)

选定的边将作为单个点返回,这些点位于矩形或环形弧的长轴上。 相应的边缘振幅在AmplitudeFirst和AmplitudeSecond中返回,返回模糊分数到FuzzyScore。 另外,每个边缘对之间的距离在IntraDistance中返回,连续边缘对之间的距离在InterDistance中返回。 这里,IntraDistance [i]对应于EdgeFirst [i]和EdgeSecond [i]之间的距离,而InterDistance [i]对应于EdgeSecond [i]和EdgeFirst [i + 1]之间的距离,即,元组InterDistance包含(边缘对元组长度-1)个元素。

原文描述

fuzzy_measure_pairs serves to extract straight edge pairs which lie perpendicular to the major axis of a rectangle or an annular arc. In addition to measure_pairs it uses fuzzy functions to evaluate and select the edge pairs.

For an explanation of the concept of 1D measuring see the introduction of chapter 1D Measuring.

The extraction algorithm of fuzzy_measure_pairs is identical to fuzzy_measure_pos. In addition, neighboring edges are grouped to pairs. To extract pairs that intersect or include each other, use fuzzy_measure_pairing.

If Transition = ‘positive’, the edge points with a dark-to-light transition in the direction of the major axis of the rectangle or annular arc are returned in RowEdgeFirst and ColumnEdgeFirst. In this case, the corresponding edges with a light-to-dark transition are returned in RowEdgeSecond and ColumnEdgeSecond. If Transition = ‘negative’, the behavior is exactly opposite. If Transition = ‘all’, the first detected edge defines the transition for RowEdgeFirst and ColumnEdgeFirst. I.e., dependent on the positioning of the measure object, edge pairs with a light-dark-light transition or edge pairs with a dark-light-dark transition are returned. This is suited, e.g., to measure objects with different brightness relative to the background.

Having extracted subpixel edge locations, the edges are paired. The pairing algorithm groups the edges such that interleavings and inclusions of pairs are prohibited. The features of an edge pair are evaluated by a fuzzy function, which can be set by set_fuzzy_measure or set_fuzzy_measure_norm_pair. Which edge pairs are selected can be determined with the parameter FuzzyThresh, which constitutes a threshold on the weight over all fuzzy sets, i.e., the geometric mean of the weights of the defined fuzzy functions.

The selected edges are returned as single points, which lie on the major axis of the rectangle or annular arc. The corresponding edge amplitudes are returned in AmplitudeFirst and AmplitudeSecond, the fuzzy scores in FuzzyScore. In addition, the distance between each edge pair is returned in IntraDistance and the distance between consecutive edge pairs is returned in InterDistance. Here, IntraDistance[i] corresponds to the distance between EdgeFirst[i] and EdgeSecond[i], while InterDistance[i] corresponds to the distance between EdgeSecond[i] and EdgeFirst[i+1], i.e., the tuple InterDistance contains one element less than the tuples of the edge pairs.

执行信息

●  多线程类型:可重入(与非独占算子并行运行)。
●  多线程范围:全局(可以从任何线程调用)。
●  不并行处理。

04. 注意

只有在边缘是直的并且垂直于矩形或环形弧长轴的情况下,fuzzy_measure_pairs返回的结果才有意义。 因此,例如,它不应该用于从曲面对象中提取边缘。 此外,用户应确保矩形或环形弧尽可能接近垂直于图像中的边缘。 此外,西格玛不能大于约 0.5 *Length1(对于Length1请参见gen_measure_rectangle2)。

05. 参数

Image (input_object)   singlechannelimage → object (byte / uint2 / real)
  输入图像。

MeasureHandle (input_control)    measure_id → (integer)
  measure对象句柄。

Sigma (input_control)    number → (real)
  高斯模糊的Sigma。
  Default value: 1.0
  Suggested values: 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0
  Typical range of values: 0.4 ≤ Sigma ≤ 100 (lin)
  Minimum increment: 0.01
  Recommended increment: 0.1
  Restriction: Sigma >= 0.4

AmpThresh   (input_control) number → (real)
  最小边缘幅度。
  Default value: 30.0
  Suggested values: 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 90.0, 110.0
  Typical range of values: 1 ≤ AmpThresh ≤ 255 (lin)
  Minimum increment: 0.5
  Recommended increment: 2

FuzzyThresh   (input_control) number → (real)
  最小模糊值。
  Default value: 0.5
  Suggested values: 0.1, 0.3, 0.5, 0.7, 0.9
  Typical range of values: 0.0 ≤ FuzzyThresh ≤ 1.0 (lin)
  Recommended increment: 0.1

Transition   (input_control) string → (string)
  选择边缘对的第一个灰度值转换。
  Default value: ‘all’
  List of values: ‘all’, ‘negative’, ‘positive’

RowEdgeFirst   (output_control) point.y-array → (real)
  边缘对的第一个边缘点的Row坐标。

ColumnEdgeFirst   (output_control) point.x-array → (real)
  边缘对的第一个边缘点的Column坐标。

AmplitudeFirst   (output_control) real-array → (real)
  边缘对第一条边的边缘幅度(带符号)。

RowEdgeSecond   (output_control) point.y-array → (real)
  边缘对的第二个边缘点的Row坐标。

ColumnEdgeSecond   (output_control) point.x-array → (real)
  边缘对的第二个边缘点的Column坐标。

AmplitudeSecond   (output_control) real-array → (real)
  边缘对第二条边的边缘幅度(带符号)。

RowEdgeCenter   (output_control) point.y-array → (real)
  边缘对的中心的Row坐标。

ColumnEdgeCenter   (output_control) point.x-array → (real)
  边缘对的中心的Column坐标。

FuzzyScore   (output_control) real-array → (real)
  边缘对的模糊评估分数。

IntraDistance   (output_control) real-array → (real)
  边缘对内部的距离。

InterDistance   (output_control) real-array → (real)
  连续边缘对之间的距离。

06. 结果

如果参数值正确,则算子fuzzy_measure_pairs将返回值2(H_MSG_TRUE)。 否则会引发异常。

HDevelop例程

fuzzy_measure_switch.hdev  用一个模糊measure对象确定一个开关引脚的宽度和距离
fuzzy_measure_pin.hdev   使用模糊measure来测量IC的引脚

程序示例


07. 附录

7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497

以上是关于机器视觉 fuzzy_measure_pairs算子的主要内容,如果未能解决你的问题,请参考以下文章

论文GRNN:几何视觉的神经网络算法库

如何选择机器视觉软件

EasyCV开源|开箱即用的视觉自监督+Transformer算法库

飞行机器人专栏-- 异构多视角视觉系统

计算机视觉,凉了?

学习了哪些知识,计算机视觉才算入门