|
频域自相关变换
- * 使用自相关频域分析法分析wafer上的单个die的位置
- * wafer是一种特殊的结构,相同的die重复出现的一个晶圆
- *
- dev_update_off ()
- read_image (Wafer, 'wafer/wafer_dies')
- get_image_size (Wafer, Width, Height)
- dev_close_window ()
- dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
- dev_display (Wafer)
- *
- * Compute the auto-correlation of the wafer image
- * 时域到频域
- rft_generic (Wafer, ImageFFT, 'to_freq', 'n', 'complex', Width)
- correlation_fft (ImageFFT, ImageFFT, ImageCorrelation)
- * 频域到时域
- rft_generic (ImageCorrelation, ImageFFTInv, 'from_freq', 'n', 'real', Width)
- *
- * 计算相连dies之间的位置
- local_max_sub_pix (ImageFFTInv, 'gauss', 3, 0.0001, Row, Column)
- *
- * 绘制第5个die到第6个die的距离图,第5个die到第9个die的距离图
- I0 := 5
- I1 := 6
- I2 := 9
- gen_arrow_contour_xld (Arrow, subset(Row,[I0,I0]), subset(Column,[I0,I0]), subset(Row,[I1,I2]), subset(Column,[I1,I2]), 15, 15)
- gen_cross_contour_xld (Cross, Row, Column, 20, rad(45))
- distance_pp (Row[I0], Column[I0], Row[I1], Column[I1], DistHor)
- distance_pp (Row[I0], Column[I0], Row[I2], Column[I2], DistVert)
- *
- * Display the results
- dev_display (Wafer)
- disp_message (WindowHandle, ['Auto-correlation of the wafer image...','...corresponds to the die pitch'], 'image', 12, 12, 'black', 'true')
- dev_set_color ('yellow')
- dev_display (Arrow)
- disp_message (WindowHandle, DistHor$ '.2f' + ' px', 'image', Row[I0] - 25, (Column[I0] + Column[I1]) * .5 - 50, 'yellow', 'false')
- disp_message (WindowHandle, DistVert$ '.2f' + ' px', 'image', (Row[I2] + Row[I0]) * .5 - 15, Column[I0] - 100, 'yellow', 'false')
- dev_set_color ('green')
- dev_display (Cross)
复制代码
参考:
【1】Halcon 例程学习之频域自相关变换( correlation_fft)
【2】仿射变换:水平矫正
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|