projective_trans_region — Apply a projective transformation to a region.
projective_trans_region applies the projective
transformation specified by the homogeneous matrix
on the regions in
Regions and returns the transformed
For creation and interpretation details of this matrix see also
If 'clip_region' is set to its default value
set_system('clip_region', 'true') or if
the transformation is degenerated and thus produces infinite
regions, the output region is clipped by the rectangle with upper
left corner (0, 0) and lower right corner ('width',
'height'), where 'width' and 'height' are
system variables (see also
'clip_region' is 'false', the output region is not
clipped except by the maximum supported coordinate size
'MAX_FORMAT'. This may result in extremely memory and time
intensive computations, so use with care.
The used coordinate system is the same as in
means that in fact not
HomMat2D is applied but a modified
version. Therefore, applying
projective_trans_region corresponds to
the following chain of transformations, which is applied to each point
of the region (input and output
pixels as homogeneous vectors):
As an effect, you might get unexpected results when creating projective transformations based on coordinates that are derived from the region, e.g., by operators like
area_center. For example, if you use this operator to calculate the center of gravity of a rotationally symmetric region and then rotate the region around this point using
hom_mat2d_rotate, the resulting region will not lie on the original one. In such a case, you can compensate this effect by applying the following translations to
HomMat2Dbefore using it in
For an explanation of the different 2D coordinate systems used in HALCON, see the introduction of chapter Transformations / 2D Transformations.
Homogeneous projective transformation matrix.
Interpolation method for the transformation.
Default value: 'bilinear'
List of values: 'bilinear', 'nearest_neighbor'