*******图像不变,平移ROI
dev_set_draw('margin')
**读取图像(模板图像)
read_image(Image,'D:/halcon学习/image/模组/模组/1.bmp')
**产生检测ROI
gen_rectangle1(Rectangle,848,237,1001,941)
**产生模板区域
gen_circle(Circle,544,564,241)
**减少定义域
reduce_domain(Image, Circle, ImageReduced)
**创建模板。平移变换,把角度设置为0
create_shape_model (ImageReduced, 'auto', 0, 0, 'auto', 'auto', 'use_polarity', 'auto', 'auto', ModelID)
**获取模板轮廓
get_shape_model_contours(ModelContours, ModelID, 1)
****读取另外一副图像(实时图像)
read_image(Image2,'D:/halcon学习/image/模组/模组/2.bmp')
****几何定位
find_shape_model (Image2, ModelID, 0, 0, 0.5, 1, 0.5, 'least_squares', 0, 0.9, Row, Column, Angle, Score)
***判断是否定位到。如果定位到,进入if
if(