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 describes whether the transformed coordinate axes are orthogonal (Theta = 0) or slanted. 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)

This is equivalent to the following chain of transformation matrices:

             / 1 0 +Tx \   / cos(Phi) -sin(Phi) 0 \   / 1 -sin(Theta) 0 \   / Sx 0  0 \
  HomMat2D = | 0 1 +Ty | * | sin(Phi)  cos(Phi) 0 | * | 0  cos(Theta) 0 | * | 0  Sy 0 |
             \ 0 0  1  /   \    0         0     1 /   \ 0     0       1 /   \ 0  0  1 /


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.


Parallelization Information

hom_mat2d_to_affine_par is reentrant and processed without parallelization.


Possible Predecessors

vector_to_hom_mat2d, vector_to_rigid, vector_to_similarity


Possible Successors

hom_mat2d_translate, hom_mat2d_scale, hom_mat2d_rotate, hom_mat2d_slant


Module

Basic operators



Copyright © 1996-2005 MVTec Software GmbH