Operator Reference

hom_mat2d_to_affine_parT_hom_mat2d_to_affine_parHomMat2dToAffineParHomMat2dToAffineParhom_mat2d_to_affine_par (Operator)

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

Signature

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

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

void HomMat2dToAffinePar(const HTuple& HomMat2D, HTuple* Sx, HTuple* Sy, HTuple* Phi, HTuple* Theta, HTuple* Tx, HTuple* Ty)

double HHomMat2D::HomMat2dToAffinePar(double* Sy, double* Phi, double* Theta, double* Tx, double* Ty) const

static void HOperatorSet.HomMat2dToAffinePar(HTuple homMat2D, out HTuple sx, out HTuple sy, out HTuple phi, out HTuple theta, out HTuple tx, out HTuple ty)

double HHomMat2D.HomMat2dToAffinePar(out double sy, out double phi, out double theta, out double tx, out double ty)

def hom_mat2d_to_affine_par(hom_mat_2d: Sequence[float]) -> Tuple[float, float, float, float, float, float]

Description

hom_mat2d_to_affine_parhom_mat2d_to_affine_parHomMat2dToAffineParHomMat2dToAffineParhom_mat2d_to_affine_par computes the affine transformation parameters corresponding to the homogeneous 2D transformation matrix HomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d. The parameters SxSxSxsxsx and SySySysysy determine how the transformation scales the original x- and y-axes, respectively. The two scaling factors are always positive. The angle ThetaThetaThetathetatheta describes whether the transformed coordinate axes are orthogonal (ThetaThetaThetathetatheta = 0) or slanted. If , the transformation contains a reflection. The angle PhiPhiPhiphiphi determines the rotation of the transformed x-axis with respect to the original x-axis. The parameters TxTxTxtxtx and TyTyTytyty determine the translation of the two coordinate systems. The matrix HomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d can be constructed from the six transformation parameters by the following operator sequence:

hom_mat2d_identity(HomMat2DIdentity)hom_mat2d_identity(HomMat2DIdentity)HomMat2dIdentity(HomMat2DIdentity)HomMat2dIdentity(HomMat2DIdentity)hom_mat2d_identity(HomMat2DIdentity)
hom_mat2d_scale(HomMat2DIdentity, Sx, Sy, 0, 0, HomMat2DScale)hom_mat2d_scale(HomMat2DIdentity, Sx, Sy, 0, 0, HomMat2DScale)HomMat2dScale(HomMat2DIdentity, Sx, Sy, 0, 0, HomMat2DScale)HomMat2dScale(HomMat2DIdentity, Sx, Sy, 0, 0, HomMat2DScale)hom_mat2d_scale(HomMat2DIdentity, Sx, Sy, 0, 0, HomMat2DScale)
hom_mat2d_slant(HomMat2DScale, Theta, 'y', 0, 0, HomMat2DSlant)hom_mat2d_slant(HomMat2DScale, Theta, "y", 0, 0, HomMat2DSlant)HomMat2dSlant(HomMat2DScale, Theta, "y", 0, 0, HomMat2DSlant)HomMat2dSlant(HomMat2DScale, Theta, "y", 0, 0, HomMat2DSlant)hom_mat2d_slant(HomMat2DScale, Theta, "y", 0, 0, HomMat2DSlant)
hom_mat2d_rotate(HomMat2DSlant, Phi, 0, 0, HomMat2DRotate)hom_mat2d_rotate(HomMat2DSlant, Phi, 0, 0, HomMat2DRotate)HomMat2dRotate(HomMat2DSlant, Phi, 0, 0, HomMat2DRotate)HomMat2dRotate(HomMat2DSlant, Phi, 0, 0, HomMat2DRotate)hom_mat2d_rotate(HomMat2DSlant, Phi, 0, 0, HomMat2DRotate)
hom_mat2d_translate(HomMat2DRotate, Tx, Ty, HomMat2D)hom_mat2d_translate(HomMat2DRotate, Tx, Ty, HomMat2D)HomMat2dTranslate(HomMat2DRotate, Tx, Ty, HomMat2D)HomMat2dTranslate(HomMat2DRotate, Tx, Ty, HomMat2D)hom_mat2d_translate(HomMat2DRotate, Tx, Ty, HomMat2D)

This is equivalent to the following chain of transformation matrices:

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

HomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d (input_control)  hom_mat2d HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Input transformation matrix.

SxSxSxsxsx (output_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Scaling factor along the x direction.

SySySysysy (output_control)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Scaling factor along the y direction.

PhiPhiPhiphiphi (output_control)  angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Rotation angle.

ThetaThetaThetathetatheta (output_control)  angle.rad HTuplefloatHTupleHtuple (real) (double) (double) (double)

Slant angle.

TxTxTxtxtx (output_control)  point.x HTuplefloatHTupleHtuple (real) (double) (double) (double)

Translation along the x direction.

TyTyTytyty (output_control)  point.y HTuplefloatHTupleHtuple (real) (double) (double) (double)

Translation along the y direction.

Result

If the matrix HomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d is non-degenerate and represents an affine transformation (i.e., not a projective transformation), hom_mat2d_to_affine_parhom_mat2d_to_affine_parHomMat2dToAffineParHomMat2dToAffineParhom_mat2d_to_affine_par returns 2 ( H_MSG_TRUE) . Otherwise, an exception is raised.

Possible Predecessors

vector_to_hom_mat2dvector_to_hom_mat2dVectorToHomMat2dVectorToHomMat2dvector_to_hom_mat2d, vector_to_rigidvector_to_rigidVectorToRigidVectorToRigidvector_to_rigid, vector_to_similarityvector_to_similarityVectorToSimilarityVectorToSimilarityvector_to_similarity, vector_to_anisovector_to_anisoVectorToAnisoVectorToAnisovector_to_aniso, point_line_to_hom_mat2dpoint_line_to_hom_mat2dPointLineToHomMat2dPointLineToHomMat2dpoint_line_to_hom_mat2d

Possible Successors

hom_mat2d_translatehom_mat2d_translateHomMat2dTranslateHomMat2dTranslatehom_mat2d_translate, hom_mat2d_scalehom_mat2d_scaleHomMat2dScaleHomMat2dScalehom_mat2d_scale, hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotatehom_mat2d_rotate, hom_mat2d_slanthom_mat2d_slantHomMat2dSlantHomMat2dSlanthom_mat2d_slant

Module

Foundation