ClassesClassesClassesClasses | | | | Operators

vector_angle_to_rigidT_vector_angle_to_rigidVectorAngleToRigidvector_angle_to_rigidVectorAngleToRigidVectorAngleToRigid (Operator)

Name

vector_angle_to_rigidT_vector_angle_to_rigidVectorAngleToRigidvector_angle_to_rigidVectorAngleToRigidVectorAngleToRigid — Compute a rigid affine transformation from points and angles.

Signature

vector_angle_to_rigid( : : Row1, Column1, Angle1, Row2, Column2, Angle2 : HomMat2D)

Herror T_vector_angle_to_rigid(const Htuple Row1, const Htuple Column1, const Htuple Angle1, const Htuple Row2, const Htuple Column2, const Htuple Angle2, Htuple* HomMat2D)

Herror vector_angle_to_rigid(const HTuple& Row1, const HTuple& Column1, const HTuple& Angle1, const HTuple& Row2, const HTuple& Column2, const HTuple& Angle2, HTuple* HomMat2D)

void VectorAngleToRigid(const HTuple& Row1, const HTuple& Column1, const HTuple& Angle1, const HTuple& Row2, const HTuple& Column2, const HTuple& Angle2, HTuple* HomMat2D)

void HHomMat2D::VectorAngleToRigid(const HTuple& Row1, const HTuple& Column1, const HTuple& Angle1, const HTuple& Row2, const HTuple& Column2, const HTuple& Angle2)

void HHomMat2D::VectorAngleToRigid(double Row1, double Column1, double Angle1, double Row2, double Column2, double Angle2)

void HOperatorSetX.VectorAngleToRigid(
[in] VARIANT Row1, [in] VARIANT Column1, [in] VARIANT Angle1, [in] VARIANT Row2, [in] VARIANT Column2, [in] VARIANT Angle2, [out] VARIANT* HomMat2d)

void HHomMat2DX.VectorAngleToRigid(
[in] VARIANT Row1, [in] VARIANT Column1, [in] VARIANT Angle1, [in] VARIANT Row2, [in] VARIANT Column2, [in] VARIANT Angle2)

static void HOperatorSet.VectorAngleToRigid(HTuple row1, HTuple column1, HTuple angle1, HTuple row2, HTuple column2, HTuple angle2, out HTuple homMat2D)

void HHomMat2D.VectorAngleToRigid(HTuple row1, HTuple column1, HTuple angle1, HTuple row2, HTuple column2, HTuple angle2)

void HHomMat2D.VectorAngleToRigid(double row1, double column1, double angle1, double row2, double column2, double angle2)

Description

vector_angle_to_rigidvector_angle_to_rigidVectorAngleToRigidvector_angle_to_rigidVectorAngleToRigidVectorAngleToRigid computes a rigid affine transformation, i.e., a transformation consisting of a rotation and a translation, from a point correspondence and two corresponding angles and returns it as the homogeneous transformation matrix HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D. The matrix consists of 2 components: a rotation matrix R and a translation vector t (also see hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotate and hom_mat2d_translatehom_mat2d_translateHomMat2dTranslatehom_mat2d_translateHomMat2dTranslateHomMat2dTranslate):

The coordinates of the original point are passed in (Row1Row1Row1Row1Row1row1,Column1Column1Column1Column1Column1column1), while the corresponding angle is passed in Angle1Angle1Angle1Angle1Angle1angle1. The coordinates of the transformed point are passed in (Row2Row2Row2Row2Row2row2,Column2Column2Column2Column2Column2column2), while the corresponding angle is passed in Angle2Angle2Angle2Angle2Angle2angle2. The following equation describes the transformation of the point using homogeneous vectors:

In particular, the operator vector_angle_to_rigidvector_angle_to_rigidVectorAngleToRigidvector_angle_to_rigidVectorAngleToRigidVectorAngleToRigid is useful to construct a rigid affine transformation from the results of the matching operators (e.g., find_shape_modelfind_shape_modelFindShapeModelfind_shape_modelFindShapeModelFindShapeModel or best_match_rot_mgbest_match_rot_mgBestMatchRotMgbest_match_rot_mgBestMatchRotMgBestMatchRotMg), which transforms a reference image to the current image or (if the parameters are passed in reverse order) from the current image to the reference image.

HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D can be used directly with operators that transform data using affine transformations, e.g., affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage.

Parallelization

Parameters

Row1Row1Row1Row1Row1row1 (input_control)  point.y HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the original point.

Column1Column1Column1Column1Column1column1 (input_control)  point.x HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the original point.

Angle1Angle1Angle1Angle1Angle1angle1 (input_control)  angle.rad HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Angle of the original point.

Row2Row2Row2Row2Row2row2 (input_control)  point.y HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the transformed point.

Column2Column2Column2Column2Column2column2 (input_control)  point.x HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the transformed point.

Angle2Angle2Angle2Angle2Angle2angle2 (input_control)  angle.rad HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Angle of the transformed point.

HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D (output_control)  hom_mat2d HHomMat2D, HTupleHTupleHTupleHHomMat2DX, VARIANTHtuple (real) (double) (double) (double) (double) (double)

Output transformation matrix.

Example (HDevelop)

draw_rectangle2 (WindowID, RowTempl, ColumnTempl, PhiTempl, Length1, Length2)
gen_rectangle2 (Rectangle, RowTempl, ColumnTempl, PhiTempl, Length1, Length2)
reduce_domain (ImageTempl, Rectangle, ImageReduced)
create_template_rot (ImageReduced, 4, 0, rad(360), rad(1), 'sort', \
                     'original', TemplateID)
while (true)
    best_match_rot_mg (Image, TemplateID, 0, rad(360), 30, 'true', 4, Row, \
                       Column, Angle, ErrMatch)
    if (ErrMatch<255)
        vector_angle_to_rigid (Row, Column, Angle, RowTempl, \
                               ColumnTempl, 0, HomMat2D)
        affine_trans_image (Image, ImageAffinTrans, HomMat2D, 'constant', \
                            'false')
    endif
endwhile
clear_template (TemplateID)

Possible Predecessors

best_match_rot_mgbest_match_rot_mgBestMatchRotMgbest_match_rot_mgBestMatchRotMgBestMatchRotMg, best_match_rotbest_match_rotBestMatchRotbest_match_rotBestMatchRotBestMatchRot

Possible Successors

hom_mat2d_inverthom_mat2d_invertHomMat2dInverthom_mat2d_invertHomMat2dInvertHomMat2dInvert, affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage, affine_trans_regionaffine_trans_regionAffineTransRegionaffine_trans_regionAffineTransRegionAffineTransRegion, affine_trans_contour_xldaffine_trans_contour_xldAffineTransContourXldaffine_trans_contour_xldAffineTransContourXldAffineTransContourXld, affine_trans_polygon_xldaffine_trans_polygon_xldAffineTransPolygonXldaffine_trans_polygon_xldAffineTransPolygonXldAffineTransPolygonXld, affine_trans_point_2daffine_trans_point_2dAffineTransPoint2daffine_trans_point_2dAffineTransPoint2dAffineTransPoint2d

Alternatives

vector_to_rigidvector_to_rigidVectorToRigidvector_to_rigidVectorToRigidVectorToRigid

See also

vector_field_to_hom_mat2dvector_field_to_hom_mat2dVectorFieldToHomMat2dvector_field_to_hom_mat2dVectorFieldToHomMat2dVectorFieldToHomMat2d

Module

Foundation


ClassesClassesClassesClasses | | | | Operators