read_image (ModelImage, ‘C:/Users/Administrator/Desktop/Halcon/棋盘格/Picture/LT/17_17_04.bmp’)
draw_rectangle1 (200000, Row1, Col1, Row2, Col2)
gen_rectangle1(ModelROI, Row1, Col1, Row2, Col2)
reduce_domain (ModelImage, ModelROI, ImageROI)
- 创建一个不可缩放的区域匹配模型(输入图形模板名称、金字塔层数、初始角度、角度范围、旋转角度的步长、
-
模型优化和模型创建方法、匹配方法、对比度、输入图像与匹配度最小差别(小于对比度)、输出模型)
create_shape_model (ImageROI, 4, 0, 0, ‘auto’, ‘none’, ‘use_polarity’, 30, 10, Model)
- 创建轮廓匹配模型图形(输入图像、输出图像基于金字塔的影像、输出模型区域、使用金字塔的层数、设置对比度)
inspect_shape_model (ImageROI, ShapeModelImage, ShapeModelRegion, 1, 30) - 提取轮廓匹配模型的外形轮廓(输出外形轮廓、输入匹配模型、输入复制外形金字塔层数)
get_shape_model_contours (ShapeModel, Model, 1) - 保存模板
write_shape_model (Model, ‘C:/Users/Administrator/Desktop/模板/Circle.shm’) - 保存模板轮廓
write_contour_xld_dxf (ShapeModel, ‘C:/Users/Administrator/Desktop/模板/CircleSquare.dxf’)