Attention
The region of the input image is ignored.
affine_trans_image does not use the HALCON standard coordinate system (with the origin in the center of the first pixel), but instead uses the same coordinate system as in affine_trans_pixel, i.e., the origin lies in the upper left corner of the first pixel. Therefore, applying affine_trans_image corresponds to a chain of transformations (see affine_trans_pixel), which is applied to each point of the image (input and output pixels as homogeneous vectors). As an effect, you might get unexpected results when creating affine transformations based on coordinates that are derived from the image, e.g., by operators like area_center_gray. For example, if you use this operator to calculate the center of gravity of a rotationally symmetric image and then rotate the image around this point using hom_mat2d_rotate, the resulting image will not lie on the original one. In such a case, you can compensate this effect by applying the following translations to HomMat2D before using it in affine_trans_image:
hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp)
hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted)
affine_trans_image(Image, ImageAffineTrans, HomMat2DAdapted,
'constant', 'false')
For an explanation of the different 2D coordinate systems used in HALCON, see the introduction of chapter Transformations / 2D Transformations.
帮助里有写,halcon会直接把图像截断的,如果用的是整个图像region的话