1.
read_contour_xld_dxf (Contours, DXFFliePath, [], [], DxfStatus)
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_scale (HomMat2DIdentity, Scale, Scale, 0, 0, HomMat2DScale)
*将任意仿射2D变换,即缩放、旋转、平移和倾斜(倾斜)应用于轮廓中给定的xld轮廓
*并以ContoursAffineTrans的形式返回变换后的轮廓
affine_trans_contour_xld (Contours, ContoursAffinTrans, HomMat2DScale)
copy_obj (ContoursAffinTrans, ImageCleared, 1, -1)
*主要应用于模板在X和Y方向有相同的形变的场合
create_scaled_shape_model_xld (ImageCleared, ‘auto’, 0, 360, ‘auto’, 0.9, 1.1, ‘auto’, [‘none’,‘no_pregeneration’], ‘ignore_local_polarity’, 5, ModelID)
find_scaled_shape_model (Image, ModelID, 0, 360, 0.9, 1.1, 0.8, 0, 0.5, ‘least_squares’, 0, 0.9, Row, Column, Angle, Scale, Score)
for MatchingObjIdx := 0 to |Score| - 1 by 1
hom_mat2d_identity (HomMat2)
hom_mat2d_scale (HomMat2, Scale[MatchingObjIdx], Scale[MatchingObjIdx], 0, 0, HomMat2)
hom_mat2d_rotate (HomMat2, Angle[MatchingObjIdx], 0, 0, HomMat2)
hom_mat2d_translate (HomMat2, Row[MatchingObjIdx], Column[MatchingObjIdx], HomMat2)
affine_trans_contour_xld (ModelContours, TransContours, HomMat2)
dev_display (TransContours)
endfor
return ()
2
**1、**Halcon读取dxf文件,得到的是dxf文件的机械坐标数值,举例说明:
*Create locally deformable model
read