hom_mat2d_to_affine_par ( : : HomMat2D : Sx, Sy, Phi, Theta, Tx, Ty )

Compute the affine transformation parameters from a homogeneous 2D transformation matrix.

hom_mat2d_to_affine_par computes the affine transformation parameters corresponding to the homogeneous 2D transformation matrix HomMat2D. The parameters Sx and Sy determine how the transformation scales the original x- and y-axes, respectively. The two scaling factors are always positive. The angle Theta determines how the transformed coordinate axes deviate from orthogonality. For Theta = 0, the two coordinate axes are orthogonal. If Theta > pi/2 the transformation contains a reflection. The angle Phi determines the rotation of the transformed x-axis with respect to the original x-axis. The parameters Tx and Ty determine the translation of the two coordinate systems. The Matrix HomMat2D can be constructed from the six transformation parameters by the following operator sequence:

  hom_mat2d_identity (HomMat2DIdentity)
  hom_mat2d_scale (HomMat2DIdentity, Sx, Sy, 0, 0, HomMat2DScale)
  hom_mat2d_slant (HomMat2DScale, Theta, 'y', 0, 0, HomMat2DSlant)
  hom_mat2d_rotate (HomMat2DSlant, Phi, 0, 0, HomMat2DRotate)
  hom_mat2d_translate (HomMat2DRotate, Tx, Ty, HomMat2D)


Parameters

HomMat2D (input_control)
affine2d-array -> real
Input transformation matrix.
Number of elements: 6

Sx (output_control)
real -> real
Scaling factor along the x direction.

Sy (output_control)
real -> real
Scaling factor along the y direction.

Phi (output_control)
angle.rad -> real
Rotation angle.

Theta (output_control)
angle.rad -> real
Slant angle.

Tx (output_control)
point.x -> real
Translation along the x direction.

Ty (output_control)
point.y -> real
Translation along the y direction.


Result

If the matrix HomMat2D is non-degenerate, hom_mat2d_to_affine_par returns 2 (H_MSG_TRUE). Otherwise, an exception is raised.


Possible Predecessors

vector_to_hom_mat2d, vector_to_rigid, vector_to_similarity


Possible Successors

hom_mat2d_identity, hom_mat2d_translate, hom_mat2d_scale, hom_mat2d_rotate, hom_mat2d_slant


Module

Basic operators


Copyright © 1996-2000 MVTec Software GmbH