*本例子演示了使用变化模板进行打印质量检测,模板用单张图像训练而来。
*在应用检测之前,检测图像被放大或缩小,但是在同样的灰度范围
- This example demonstrates the print inspection using
- a variation model. The variation model is trained
- using a single model image. Before applying the print inspection,
- the images are scaled to the same gray value range like the model.
*关闭更新
dev_update_off ()
*关闭窗体
dev_close_window ()
- 读取模板图像,初始化显示
- Read model image and init visualization
*读取图像
read_image (ModelImage, ‘cap_illumination/cap_illumination_01’)
*获取图像尺寸
get_image_size (ModelImage, Width, Height)
*打开新窗体
dev_open_window (0, 0, Width / 2, Height / 2, ‘black’, WindowHandle)
*设置字体
set_display_font (WindowHandle, 14, ‘mono’, ‘true’, ‘false’) - 分割模板区域
- Segment model region
*显示模板图像
dev_display (ModelImage)
*获取模板区域
get_model_region (ModelImage, RegionRO