Herror T_hom_mat2d_to_affine_par (
    Htuple *HomMat2D,
    Htuple *Sx,
    Htuple *Sy,
    Htuple *Phi,
    Htuple *Theta,
    Htuple *Tx,
    Htuple *Ty
)

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

T_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 -> Htuple . double
Input transformation matrix.
Number of elements: 6

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

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

Phi (output_control)
angle.rad -> Htuple . double *
Rotation angle.

Theta (output_control)
angle.rad -> Htuple . double *
Slant angle.

Tx (output_control)
point.x -> Htuple . double *
Translation along the x direction.

Ty (output_control)
point.y -> Htuple . double *
Translation along the y direction.


Result

If the matrix HomMat2D is non-degenerate, T_hom_mat2d_to_affine_par returns H_MSG_TRUE. Otherwise, an exception is raised.


Possible Predecessors

vector_to_hom_mat2d, T_vector_to_rigid, T_vector_to_similarity


Possible Successors

hom_mat2d_identity, hom_mat2d_translate, hom_mat2d_scale, hom_mat2d_rotate, T_hom_mat2d_slant


Module

Basic operators


Copyright © 1996-2000 MVTec Software GmbH