00. 目录

文章目录

  • 00. 目录
  • 01. 概述
  • 02. 签名
  • 03. 描述
  • 04. 注意
  • 05. 参数
  • 06. 结果
  • 07. 附录

01. 概述

measure_pos - 提取垂直于矩形或环形弧的直线边缘。

02. 签名

measure_pos(Image : : MeasureHandle, Sigma, Threshold, Transition, Select : RowEdge, ColumnEdge, Amplitude, Distance)

03. 描述

measure_pos提取垂直于矩形或环形弧长轴的直边。

该算法通过计算垂直于矩形或环形弧的长轴的“切片”中的灰度值的均值以获得一维边缘轮廓。采样是在矩形中心的整数行和列位置(在矩形的坐标系中)的图像Image中的亚像素位置完成的。由于这含有可以在多次测量中重复使用的一些计算,所以使用算子gen_measure_rectangle2或gen_measure_arc来执行一次这些计算,从而显著提高了measure_pos的速度。由于在灰度值的亚像素计算中存在精度和速度之间的折衷,并且因此在所提取的边缘位置的准确度中,可以在gen_measure_rectangle2中选择不同的插值方案。 (插值仅影响与图像轴不对齐的矩形。)使用gen_measure_rectangle2生成的measure对象在MeasureHandle中传递。

在计算出一维边缘轮廓之后,通过将轮廓与标准偏差Sigma的高斯平滑核的导数进行卷积来计算亚像素边缘位置。可以用构成振幅阈值的参数Threshold(即边缘的一阶导数的绝对值)来选择显著边缘。请注意,幅度值按Sigmasqrt(2pi)比例缩放。另外,可以仅选择正边缘,即在矩形或弧的长轴方向上构成暗到亮的过渡的边缘(Transition = ‘positive’),或者只有负边缘,即,亮到暗过渡(Transition =‘negative’)或两种类型的边缘(Transition =‘all’)。最后,可以选择返回哪个边缘点。如果Select设置为’all’,则返回所有边缘点。如果设置为’first’,则只返回第一个提取的边缘点,而设置为’last’,则只返回最后一个。

提取的边缘将把位于矩形或圆弧长轴上的单个点(RowEdge,ColumnEdge)作为提取的边缘返回。 Amplitude返回相应的边缘振幅。 另外,连续的边缘点之间的距离以Distance返回。 这里, Distance[i]对应于Edge[i]和Edge[i+1]之间的距离,即,元组Distance 含有比(RowEdge 和ColumnEdge)的长度-1个元素

原文描述

measure_pos extracts straight edges which lie perpendicular to the major axis of a rectangle or annular arc.

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

The algorithm of 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 or gen_measure_arc is used to perform these calculations only once, thus increasing the speed of 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.) 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 Threshold, which constitutes a threshold on the amplitude, i.e., the absolute value of the first derivative of the edge. Note that the amplitude values are scaled by the factor . 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 or the arc (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. If Select is set to ‘all’, all edge points are returned. If it is set to ‘first’, only the first of the extracted edge points is returned, while it is set to ‘last’, only the last one is returned.

The extracted edges are returned as single points which lie on the major axis of the rectangle or arc in (RowEdge,ColumnEdge). The corresponding edge amplitudes are returned in Amplitude. 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. 注意

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

应该记住,为了效率的原因,measure_pos会忽略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

Threshold (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 ≤ Threshold ≤ 255 (lin)
  Minimum increment: 0.5
  Recommended increment: 2

Transition (input_control) string → (string)
  亮到暗或者暗到亮的边缘。
  Default value: ‘all’
  List of values: ‘all’, ‘negative’, ‘positive’

Select (input_control) string → (string)
  要选择返回的点。
  Default value: ‘all’
  List of values: ‘all’, ‘first’, ‘last’

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

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

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

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

06. 结果

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

HDevelop例程

measure_pin.hdev         测量IC的引脚

measure_ic_leads.hdev     测量IC的引线

measure_fill_level.hdev       检查细颈瓶的液位

measure_arc.hdev         测量金属部件沿着圆弧的的宽度

gen_measure_rectangle2.hdev   测量垂直于给定线的边缘
gen_measure_arc.hdev       测量垂直于给定弧的边

create_drawing_object_rectangle2.hdev 使用绘图对象在矩形内交互测量直边
3d_coordinates.hdev         测量世界坐标中的倾斜物体

程序示例


07. 附录

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

【机器视觉】 measure_pos算子相关推荐

  1. 机器视觉 边缘检测算子

    1.实验目的 利用opencv python实现对下图实现边缘检测算子. 2.实验过程 (1)在python安装opencv库, pip install opencv-python. (2)在pyth ...

  2. 【一】1D测量 Measuring——measure_pos()算子

  3. 【机器视觉】机器视觉博客汇总

    00. 目录 文章目录 00. 目录 01. 机器视觉概述 02. 机器视觉环境搭建 03. Halcon初级教程 04. Halcon中级教程 05. Halcon高级教程 06. Halcon与Q ...

  4. 拉普拉斯噪声公式_高斯拉普拉斯算子(Laplace of Gaussian)

    高斯拉普拉斯(Laplace of Gaussian) Laplace算子作为一种优秀的边缘检测算子,在边缘检测中得到了广泛的应用.该方法通过对图像 求图像的二阶倒数的零交叉点来实现边缘的检测,公式表 ...

  5. HALCON 20.11:学习笔记---一维测量(Measuring)

    HALCON 20.11:学习笔记---一维测量(Measuring) 本章主要提供有关一维测量的信息. 一维测量的概念 通过一维测量可以沿着预定义的线或弧定位从亮到暗或从暗到亮的过渡边缘.这使您可以 ...

  6. 【机器视觉】 measure_pairs算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 measure_pairs - 提取垂直于矩形或环 ...

  7. 【机器视觉】 gen_measure_rectangle2算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 gen_measure_rectangle2 - ...

  8. 【机器视觉】 gen_measure_arc算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 gen_measure_arc - 准备提取垂直于 ...

  9. 【机器视觉】 fuzzy_measure_pos算子

    00. 目录 文章目录 00. 目录 01. 概述 02. 签名 03. 描述 04. 注意 05. 参数 06. 结果 07. 附录 01. 概述 fuzzy_measure_pos - 提取垂直于 ...

最新文章

  1. java解数独_java解数独
  2. java 读取文件,内容方置Person 并写到另外地址
  3. python学习笔记之socket(第七天)
  4. 在当当买了python怎么下载源代码-爬虫实战一:爬取当当网所有 Python 书籍
  5. 从B 树、B+ 树、B* 树谈到R 树
  6. VTK:可视化算法之BluntStreamlines
  7. Exploiting “BadIRET” vulnerability (CVE-2014-9322, Linux kernel privilege escalation)
  8. C# 版本 疫情传播仿真程序
  9. Jsoup处理URLs
  10. 【loj2585】【APIO2018】新家
  11. Yii防注入攻击笔记
  12. 历史首次!中国联通、中国电信组队了,只为达成这个目的
  13. ESXi主机下的常用日志
  14. python 抢购小米_利用Python+selenium实现小米商城抢购代码
  15. 百度地图开发(安卓)
  16. 敏捷模式下携程的接口自动化平台演变
  17. 小米HTML查看器记住密码,小米路由器 SSH 密码计算工具,开启小米SSH访问
  18. oracle 11g64 位 安装文件
  19. 罗技G603鼠标欧姆龙D2FC-F-7N微动开关拆解修复双击问题要点解析
  20. CLRS 17.4动态表

热门文章

  1. MS讲座:可视化的软件架构设计和Portal Starter Kit挖宝记
  2. 时结果 hive_Hive优化
  3. Java黑皮书课后题第9章:**9.12(几何:交点)假设两条线段相交。第一条线段的两个端点是(x1, y1)和(x2, y2),第二条线段的两个端点是(x3, y3)和(x4, y4)
  4. Linux打开浏览器进程,Linux终端Web浏览器w3m
  5. 蓝牙配对模式 java_BLE(低功耗蓝牙)配对和绑定
  6. @ExceptionHandler
  7. oracle database 12cr2 使用 dbms_stat 采集统计信息
  8. 维护索引——通过重组索引提高性能
  9. jqgrid定义多选操作
  10. 关于EGE图形库在CodeBlocks下的配置