QQ登录

只需一步,快速开始

1.10 halcon上位机利用测量助手实现圆弧长度测量

[ 复制链接 ]
在前面一帖子中使用代码实现圆弧的长度测量。
当前也可以使用测量助手,会更加直观。
首先打开测量助手窗口。
在输入选项卡中打开图片C:/Users/Public/Documents/MVTec/HALCON-17.12-Progress/examples/images/zeiss1.png
使用工具栏上的绘制圆弧工具在图上绘制圆弧确认测量范围。
在边缘选项卡内微调节参数,观察图片上边缘的提取效果。

1.10 halcon上位机利用测量助手实现圆弧长度测量

1.10 halcon上位机利用测量助手实现圆弧长度测量

可以结果选项卡查看测量结果。
也可在代码生成选项卡上,点击按钮插入代码,进行代码 编辑
  1. * Measure 01: Code generated by Measure 01
  2. * Measure 01: Prepare measurement
  3. AmplitudeThreshold := 5
  4. RoiWidthLen2 := 5
  5. set_system ('int_zooming', 'true')
  6. * Measure 01: Coordinates for circular arc Measure 01 [0]
  7. ArcRow_Measure_01_0 := 269.882
  8. ArcColumn_Measure_01_0 := 335.685
  9. ArcRadius_Measure_01_0 := 99.6761
  10. ArcAngleStart_Measure_01_0 := -0.282035
  11. ArcAngleExtent_Measure_01_0 := 1.85283
  12. * Measure 01: Create measure for circular arc Measure 01 [0]
  13. * Measure 01: Attention: This assumes all images have the same size!
  14. gen_measure_arc (ArcRow_Measure_01_0, ArcColumn_Measure_01_0, ArcRadius_Measure_01_0, ArcAngleStart_Measure_01_0, ArcAngleExtent_Measure_01_0, max2(1, min2(RoiWidthLen2, ArcRadius_Measure_01_0)), 679, 557, 'nearest_neighbor', MsrHandle_Measure_01_0)
  15. * Measure 01: ***************************************************************
  16. * Measure 01: * The code which follows is to be executed once / measurement *
  17. * Measure 01: ***************************************************************
  18. * Measure 01: Load image
  19. read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-17.12-Progress/examples/images/zeiss1.png')
  20. * Measure 01: Execute measurements
  21. measure_pos (Image, MsrHandle_Measure_01_0, 0.4, AmplitudeThreshold, 'all', 'all', Row_Measure_01_0, Column_Measure_01_0, Amplitude_Measure_01_0, Distance_Measure_01_0)
  22. * Measure 01: Do something with the results
  23. * Measure 01: Clear measure when done
  24. close_measure (MsrHandle_Measure_01_0)
复制代码


回复

使用道具 举报

快速回复 返回列表 客服中心 搜索