机器视觉 fuzzy_measure_pos算子

Posted 沧海一笑-dj

tags:

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

00. 目录

01. 概述

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

02. 签名

fuzzy_measure_pos(Image : : MeasureHandle, Sigma, AmpThresh, FuzzyThresh, Transition : RowEdge, ColumnEdge, Amplitude, FuzzyScore, Distance)

03. 描述

fuzzy_measure_pos提取垂直于矩形长轴或环形弧的直边。 与measure_pos有所区别,它还使用模糊函数(fuzzy functions)来判断和选择边缘。

该算法通过平均垂直于矩形或环形弧的长轴的“切片”中的灰度值来工作,以获得一维边缘轮廓。(The algorithm works by averaging the gray values in “slices” perpendicular to the major axis of the rectangle or annular arc in order to obtain a one-dimensional edge profile.)采样是在矩形中心的整数行和列距离(在矩形的坐标系中)图像Image中的亚像素位置完成的。由于这涉及一些可以在多次测量中重复使用的计算,所以仅使用算子gen_measure_rectangle2执行一次这些计算,从而显著提高了fuzzy_measure_pos的速度。由于在灰度值的亚像素计算中存在精度和速度之间的折衷,并且因此在所提取的边缘位置的准确度中,可以在gen_measure_rectangle2中选择不同的插值方案。 (插值仅影响矩形轴和圆弧不与图像对齐的measure。)使用gen_measure_rectangle2生成的measure对象在MeasureHandle中传递。

在计算出一维边缘轮廓之后,通过将轮廓与标准偏差Sigma的高斯平滑核的导数进行卷积来计算亚像素边缘位置。 可以用构成振幅阈值的参数AmpThresh,即边缘的一阶导数的绝对值来选择显著边缘。 另外,可以仅选择positive边缘,即构成矩形长轴方向上的暗到亮的过渡的边缘(Transition = ‘positive’),或者negative边缘即亮到暗 (Transition = ‘negative’)或两种类型的边缘(Transition = ‘all’)。 最后,可以选择返回哪个边缘点。

在提取了亚像素边缘位置之后,通过相应的模糊函数来评估这些边缘的特征,这可以通过set_fuzzy_measure来设置。 可以用参数FuzzyThresh确定选择哪些边缘,该参数构成了所有模糊集合上权重的阈值,即定义集合的权重的几何平均值。

选定的边将作为位于矩形或圆弧长轴上的点返回,这些点存储在(RowEdge,ColumnEdge)中。 Amplitude中返回相应的边缘振幅,模糊分数在FuzzyScore中。 另外,连续的边缘点之间的距离以Distance返回。 这里,Distance[i]对应于Edge[i]和Edge[i + 1]之间的距离,即元组Distance包含(ColumnEdge或RowEdge -1)个元素。

原文描述

fuzzy_measure_pos extracts straight edges which lie perpendicular to the major axis of a rectangle or an annular arc. In addition to measure_pos it uses fuzzy functions to evaluate and select the edges.

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

The algorithm of fuzzy_measure_pos works by averaging the gray values in “slices” perpendicular to the major axis of the rectangle or annular arc in order to obtain a one-dimensional edge profile. The sampling is done at subpixel positions in the image Image at integer row and column distances (in the coordinate frame of the rectangle) from the center of the rectangle. Since this involves some calculations which can be used repeatedly in several measurements, the operator gen_measure_rectangle2 is used to perform these calculations only once, thus increasing the speed of fuzzy_measure_pos significantly. Since there is a trade-off between accuracy and speed in the subpixel calculations of the gray values, and thus in the accuracy of the extracted edge positions, different interpolation schemes can be selected in gen_measure_rectangle2. (The interpolation only influences rectangles not aligned with the image axes and annular arcs.) The measure object generated with gen_measure_rectangle2 is passed in MeasureHandle.

After the one-dimensional edge profile has been calculated, subpixel edge locations are computed by convolving the profile with the derivatives of a Gaussian smoothing kernel of standard deviation Sigma. Salient edges can be selected with the parameter AmpThresh, which constitutes a threshold on the amplitude, i.e., the absolute value of the first derivative of the edge. Additionally, it is possible to select only positive edges, i.e., edges which constitute a dark-to-light transition in the direction of the major axis of the rectangle (Transition = ‘positive’), only negative edges, i.e., light-to-dark transitions (Transition = ‘negative’), or both types of edges (Transition = ‘all’). Finally, it is possible to select which edge points are returned.

Having extracted subpixel edge locations, features of these edges are evaluated by a corresponding fuzzy function, which can be set by set_fuzzy_measure. Which edges 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 sets.

The selected edges are returned as single points, which lie on the major axis of the rectangle or annular arc, in (RowEdge,ColumnEdge). The corresponding edge amplitudes are returned in Amplitude, the fuzzy scores in FuzzyScore. In addition, the distance between consecutive edge points is returned in Distance. Here, Distance[i] corresponds to the distance between Edge[i] and Edge[i+1], i.e., the tuple Distance contains one element less than the tuples RowEdge and ColumnEdge.

执行信息

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

04. 注意

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

应该记住,为了效率的原因,fuzzy_measure_pos忽略了Image的ROI(domain)。 如果要从测量中排除图像中的特定区域,则应该生成具有适当修改的参数的新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
  限制: 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.6, 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’

RowEdge (output_control)    point.y-array → (real)
  Edge点的Row坐标。

ColumnEdge (output_control)    point.x-array → (real)

Edge点的Column坐标。

Amplitude (output_control)   real-array → (real)
  边缘的边缘幅度(带符号)。

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

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

06. 结果

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

HDevelop例程

程序示例


07. 附录

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

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

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

如何选择机器视觉软件

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

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

计算机视觉,凉了?

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