1、使用halcon助手快速导出几何匹配实现流程
1)选择助手->打开新Matching
2)选择创建模板,加载图片,比如D:/1.bmp
3)选择绘制轴平行矩形,生产ROI
4)选择代码生成,将产生如下代码
* Matching 01: BEGIN of generated code for model initialization
set_system ('border_shape_models', 'false')
* Matching 01: Obtain the model image
read_image (Image, 'D:/1.bmp')
* Matching 01: build the ROI from basic regions
gen_rectangle1 (ModelRegion, 234.167, 234.833, 293.722, 351.5)
* Matching 01: reduce the model template
reduce_domain (Image, ModelRegion, TemplateImage)
* Matching 01: create the shape model
create_shape_model (TemplateImage, 4, rad(0), rad(360), rad(1.7774), ['none','n