*许多模具通常蚀刻在晶圆上。在单曲之前模具可以由模具粘合机拾取并放置在引线上框架,它们必须从晶圆上切下来。镜子模具是用于确定切割过程的参数。
*在这里,镜子模具的位置是使用基于形状的匹配。
1、读取图片
dev_update_off ()
*关闭窗口
dev_close_window ()
*读取图片
read_image (Image, 'wafer/wafer_mirror_dies_01')
*打开自适应图片的窗口
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
*设置显示字体
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
*设置线的宽度
dev_set_line_width (3)
*显示图片
dev_display (Image)
disp_message (WindowHandle, 'Determine the position of mirror dies on the wafer', 'window', 12, 12, 'black', 'true')
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
2、创建模板
*抠图
gen_rectangle1 (Rectangle, 362, 212, 414, 262)
reduce_domain (Image, Rectangle, ImageReduced)
*创建模板
create_shape_model (ImageReduced, 'auto', rad(0), rad(1), 'auto', 'auto', 'use_polarity', 'auto', 'auto', ModelID)
*得到轮廓
get_shape_model_contours (ModelContours, ModelID, 1)
3、开始进行匹配
*阅读图片并进行处理
*开始进行for循环
for Index := 1 to 4 by 1
read_image (Image, 'wafer/wafer_mirror_dies_' + Index$'02')
*确定后视镜模具的位置,并计算找到位置所需的运行时间
count_seconds (S1)
*开始匹配
find_shape_model (Image, ModelID, rad(0), rad(1), 0.5, 0, 0.0, 'least_squares', 2, 0.5, Row, Column, Angle, Score)
count_seconds (S2)
Runtime := (S2 - S1) * 1000
*显示结果
gen_cross_contour_xld (Cross, Row, Column, 6, rad(45))
dev_display (Image)
dev_display_shape_matching_results (ModelID, 'lime green', Row, Column, Angle, 1, 1, 0)
dev_set_color ('orange')
dev_display (Cross)
disp_message (WindowHandle, |Score| + ' mirror dies located in ' + Runtime$'.1f' + ' ms', 'window', 12, 12, 'black', 'true')
if (Index != 4)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
endif
endfor
注:此处有个特别的算子,使得结果更加清晰可见
*为每个输入点生成一个十字形状的XLD轮廓。
gen_cross_contour_xld (Cross, Row, Column, 6, rad(45))