对应示例程序:
apply_metrology_model.hdev
目标:在具有挑战性的条件下,使用计量模型以亚像素精度测量圆和矩形
思路为:
1.创建计量模型模板
2.根据先验知识生成相关图形形状,如矩形,圆,并将其加入到创建的模板中
3.设置模板的相关参数,包括图像大小,容忍度等
4.读入图像,并执行计量模型,测量并拟合计量模型中所有计量对象的几何形状
5.提取测量结果,测量的轮廓,定位区域,后补区域
图像:
代码:
dev_update_off ()
read_image (Image, 'pads')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
set_display_font (WindowHandle, 14, 'mono', 'true', 'false')
*
* Define the approximate position and the measure
* tolerance for the circles
*定义圆的近似位置和测量公差
RowCircle := [52:89:500]
CircleInitRow := [RowCircle,RowCircle]
CircleInitColumn