通过模板匹配找到所有模板位置,并且当单击某个模板时,选中某个模板
read_image (Image, 'C:/Users/22967/Desktop/晶圆找位置/0.bmp')
dev_close_window ()
dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle)
dev_display (Image)* draw_circle (3600, Row, Column, Radius)
* gen_circle (Circle, Row, Column, Radius)
gen_circle (Circle, 317.5, 423.5, 31.241)
reduce_domain (Image, Circle, ImageReduced)
create_ncc_model (ImageReduced, 'auto', rad(-45), rad(90), 'auto', 'use_polarity', ModelID)
find_ncc_model (Image, ModelID, rad(-45), rad(90), 0.8, 0, 0.5, 'true', 0, Row1, Column1, Angle, Score)
disp_circle (WindowHandle, Row1, Column1, Score*25)
* Image Acquisition 01: Code generated by Image Acquisition 01
list_files ('C:/Users/22967/Desktop/晶圆找位置', ['files','follow_links'], ImageFiles)
tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles)
for Index := 0 to |ImageFiles| - 1 by 1read_image (Image, ImageFiles[Index])find_ncc_model (Image, ModelID, rad(-45), rad(90), 0.8, 0, 0.5, 'true', 0, Row1, Column1, Angle, Score)gen_circle (Circle1, Row1, Column1, Score*25)while (1)dev_display (Image)draw_point (WindowHandle, Row2, Column2)gen_region_points (Region, Row2, Column2)select_shape_proto (Circle1, Region, SelectedRegions, 'overlaps_abs', 1, 5)count_obj (SelectedRegions, Number)if(Number>0)dev_display (Image)dev_display (SelectedRegions)endifwait_seconds (1)endwhilestop ()endfor
运行结果