projective_trans_image_size — Apply a projective transformation to an image and specify the output
projective_trans_image_size applies the projective
transformation (homography) determined by the homogeneous
HomMat2D on the input image
Image and stores the result into the output image
TransImage will be clipped at the output dimensions
Width. Apart from this,
projective_trans_image_size is identical to its alternative
The used coordinate system is the same as in
affine_trans_pixel. This means that in fact not
HomMat2D is applied but a modified version. Therefore,
projective_trans_image_size corresponds to the following
chain of transformations, which is applied to each point (Row_i,
Col_i) of the image (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
image, e.g., by operators like
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
before using it in
hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp) hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted) projective_trans_image_size(Image, TransImage, HomMat2DAdapted, 'bilinear', Width, Height, 'false')
For an explanation of the different 2D coordinate systems used in HALCON, see the introduction of chapter Transformations / 2D Transformations.
projective_trans_image_size can be executed on OpenCL devices if
the input image does not exceed the maximum size of image objects of the
selected device and the parameter
TransformDomain is set to
The result can diverge slightly from that calculated on the CPU.
→object (byte* / uint2* / real*) *allowed for compute devices
→object (byte / uint2 / real)
Homogeneous projective transformation matrix.
Interpolation method for the transformation.
Default value: 'bilinear'
List of values: 'bilinear', 'nearest_neighbor'
Output image width.
Output image height.
Should the domain of the input image also be transformed?
Default value: 'false'
List of values: 'false', 'true'
List of values (for compute devices): 'false'