机器视觉 fuzzy_measure_pairing算子
Posted 沧海一笑-dj
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了机器视觉 fuzzy_measure_pairing算子相关的知识,希望对你有一定的参考价值。
00. 目录
01. 概述
fuzzy_measure_pairing - 提取垂直于矩形或环形弧的直边对。
02. 签名
fuzzy_measure_pairs(Image : : MeasureHandle, Sigma, AmpThresh, FuzzyThresh, Transition : RowEdgeFirst, ColumnEdgeFirst, AmplitudeFirst, RowEdgeSecond, ColumnEdgeSecond, AmplitudeSecond, RowEdgeCenter, ColumnEdgeCenter, FuzzyScore, IntraDistance, InterDistance)
03. 描述
fuzzy_measure_pairing用于提取垂直于矩形或环形弧长轴的直边对。
提取算法与fuzzy_measure_pairs相同,但也可以使用参数Pairing提取交织和包含对。 目前只有’no_restriction’可用,它返回所有可能的边缘对,允许交叉和包含对。
NumPairs只返回得分最高的边缘对个数,而0表示返回所有可能的边缘组合。
选定的边将作为单个点返回,这些点位于矩形或环形弧的长轴上。 相应的边缘振幅在AmplitudeFirst和AmplitudeSecond中返回,FuzzyScore表示模糊分数。 另外,每个边缘对之间的距离在IntraDistance中返回,对应于EdgeFirst [i]和EdgeSecond [i]之间的距离。
原文描述:
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_pairing返回的结果才有意义。 因此,它不应该用于从曲面对象中提取边缘。 此外,用户应确保矩形或环形弧尽可能接近垂直于图像的边缘。 此外,西格玛不能大于约0.5 *Length1(对于Length1请参见gen_measure_rectangle2)。
应该记住,为了效率的原因,fuzzy_measure_pairing会忽略Image的ROI域。 如果图像中的特定区域应该从measurement中排除,则应该生成具有适当修改的参数的新measure对象。
05. 参数
Image (input_object) 单通道图像 → 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’
Pairing (input_control) string → (string)
配对约束。
Default value: ‘no_restriction’
List of values: ‘no_restriction’
NumPairs (input_control) number → (integer)
边缘对的数量。
Default value: 10
Suggested values: 0, 1, 10, 20, 50
Typical range of values: 0 ≤ NumPairs
Recommended increment: 1
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)
(边缘对)第二个边缘的边缘幅度(带符号)。
RowPairCenter (output_control) point.y-array → (real)
边缘对的中心的Row坐标。
ColumnPairCenter (output_control) point.x-array → (real)
边缘对的中心的Column坐标。
FuzzyScore (output_control) real-array → (real)
边缘对的模糊评估分数。
IntraDistance (output_control) real-array → (real)
边缘对内的距离。
06. 结果
如果参数值正确,则算子fuzzy_measure_pairing将返回值2(H_MSG_TRUE)。 否则会引发异常。
HDevelop例程
inspect_bottle_label_360_degree.hdev 将一个瓶子的四个图像组合成拼接图像,显示瓶子的标签展开图。
程序示例
07. 附录
7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497
以上是关于机器视觉 fuzzy_measure_pairing算子的主要内容,如果未能解决你的问题,请参考以下文章