QQ登录

只需一步,快速开始

1.6 halcon利用测量助手测量芯片引脚高度

[ 复制链接 ]
前面的多个帖子有测量助手的介绍,也有测量函数的介绍,这个帖子介绍使用测量助手来测量芯片引脚的高度。

打开测量助手窗口,
载入磁盘图片,C:/Users/Public/Documents/MVTec/HALCON-17.12-Progress/examples/images/ic_pin.png
用工具栏上绘制直线工具,在芯片引脚上绘制直线。
鼠标右键确认后,可在边缘选项卡上,一边调整参数 如平滑,最小边缘幅度等,一边查看窗口图片上显示的效果。

1.6 halcon利用测量助手测量芯片引脚高度

1.6 halcon利用测量助手测量芯片引脚高度

可以在结果选项卡内查看计算数据结果,也可在代码生成选项卡内,点击 插入代码,生成如下 代码,
* Measure 01: Code generated by Measure 01
* Measure 01: Prepare measurement
AmplitudeThreshold := 32
RoiWidthLen2 := 5.5
set_system ('int_zooming', 'true')
* Measure 01: Coordinates for line Measure 01 [0]
LineRowStart_Measure_01_0 := 57.5
LineColumnStart_Measure_01_0 := 71.5415
LineRowEnd_Measure_01_0 := 59.5
LineColumnEnd_Measure_01_0 := 912.392
* Measure 01: Convert coordinates to rectangle2 type
TmpCtrl_Row := 0.5*(LineRowStart_Measure_01_0+LineRowEnd_Measure_01_0)
TmpCtrl_Column := 0.5*(LineColumnStart_Measure_01_0+LineColumnEnd_Measure_01_0)
TmpCtrl_Dr := LineRowStart_Measure_01_0-LineRowEnd_Measure_01_0
TmpCtrl_Dc := LineColumnEnd_Measure_01_0-LineColumnStart_Measure_01_0
TmpCtrl_Phi := atan2(TmpCtrl_Dr, TmpCtrl_Dc)
TmpCtrl_Len1 := 0.5*sqrt(TmpCtrl_Dr*TmpCtrl_Dr + TmpCtrl_Dc*TmpCtrl_Dc)
TmpCtrl_Len2 := RoiWidthLen2
* Measure 01: Create measure for line Measure 01 [0]
* Measure 01: Attention: This assumes all images have the same size!
gen_measure_rectangle2 (TmpCtrl_Row, TmpCtrl_Column, TmpCtrl_Phi, TmpCtrl_Len1, TmpCtrl_Len2, 988, 1018, 'nearest_neighbor', MsrHandle_Measure_01_0)
* Measure 01: ***************************************************************
* Measure 01: * The code which follows is to be executed once / measurement *
* Measure 01: ***************************************************************
* Measure 01: Load image
read_image (Image, 'C:/Users/Public/Documents/MVTec/HALCON-17.12-Progress/examples/images/ic_pin.png')
* Measure 01: Execute measurements
measure_pairs (Image, MsrHandle_Measure_01_0, 1.5, AmplitudeThreshold, 'all', 'all', Row1_Measure_01_0, Column1_Measure_01_0, Amplitude1_Measure_01_0, Row2_Measure_01_0, Column2_Measure_01_0, Amplitude2_Measure_01_0, Width_Measure_01_0, Distance_Measure_01_0)
* Measure 01: Do something with the results
* Measure 01: Clear measure when done
close_measure (MsrHandle_Measure_01_0)




回复

使用道具 举报

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