*模板匹配
gen_rectangle2 (Rectangle1, 1558, 1148, 0, 222, 322)
reduce_domain (ImageAffinTrans, Rectangle1, ImageReduced)
binary_threshold (ImageReduced, Region, 'max_separability', 'dark', UsedThreshold)
connection (Region, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'row', 'and', 1560, 1564)
reduce_domain (ImageReduced, SelectedRegions, ImageReduced1)
create_shape_model (ImageReduced1, 'auto', 0, rad(360), 'auto', 'auto', 'use_polarity', 60, 10, ModelID)
inspect_shape_model (ImageReduced1, ModelImages, ModelRegions, 6, 30)
*设置图像原点
area_center (SelectedRegions, Area, RowModel, ColumnModel)
set_shape_model_origin(ModelID, -RowModel, -ColumnModel)
get_shape_model_contours (ShapeModel, ModelID, 1)