ClassesClassesClassesClasses | | | | Operators

vector_to_anisoT_vector_to_anisoVectorToAnisovector_to_anisoVectorToAnisoVectorToAniso (Operator)


vector_to_anisoT_vector_to_anisoVectorToAnisovector_to_anisoVectorToAnisoVectorToAniso — Approximate an anisotropic similarity transformation from point correspondences.


vector_to_aniso( : : Px, Py, Qx, Qy : HomMat2D)

Herror T_vector_to_aniso(const Htuple Px, const Htuple Py, const Htuple Qx, const Htuple Qy, Htuple* HomMat2D)

Herror vector_to_aniso(const HTuple& Px, const HTuple& Py, const HTuple& Qx, const HTuple& Qy, HTuple* HomMat2D)

void VectorToAniso(const HTuple& Px, const HTuple& Py, const HTuple& Qx, const HTuple& Qy, HTuple* HomMat2D)

void HHomMat2D::VectorToAniso(const HTuple& Px, const HTuple& Py, const HTuple& Qx, const HTuple& Qy)

void HOperatorSetX.VectorToAniso(
[in] VARIANT Px, [in] VARIANT Py, [in] VARIANT Qx, [in] VARIANT Qy, [out] VARIANT* HomMat2d)

void HHomMat2DX.VectorToAniso(
[in] VARIANT Px, [in] VARIANT Py, [in] VARIANT Qx, [in] VARIANT Qy)

static void HOperatorSet.VectorToAniso(HTuple px, HTuple py, HTuple qx, HTuple qy, out HTuple homMat2D)

void HHomMat2D.VectorToAniso(HTuple px, HTuple py, HTuple qx, HTuple qy)


vector_to_anisovector_to_anisoVectorToAnisovector_to_anisoVectorToAnisoVectorToAniso approximates an anisotropic similarity transformation, i.e., a transformation consisting of a rotation, a non-uniform scaling, and a translation, from at least three point correspondences and returns it as the homogeneous transformation matrix HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D. The matrix consists of 3 components: a scaling matrix S with non-identical scaling in the x and y directions, a rotation matrix R, and a translation vector t (also see hom_mat2d_scalehom_mat2d_scaleHomMat2dScalehom_mat2d_scaleHomMat2dScaleHomMat2dScale, hom_mat2d_rotatehom_mat2d_rotateHomMat2dRotatehom_mat2d_rotateHomMat2dRotateHomMat2dRotate, and hom_mat2d_translatehom_mat2d_translateHomMat2dTranslatehom_mat2d_translateHomMat2dTranslateHomMat2dTranslate):

                              / 1 0 tx \   / R00 R01 0 \   / Sx 0  0 \
  HomMat2D  =  | R*S  t |  =  | 0 1 ty | * | R10 R11 0 | * | 0  Sy 0 |  =  H(t) * H(R) * H(S)
               | 0 0  1 |     \ 0 0 1  /   \  0   0  1 /   \ 0  0  1 /

The point correspondences are passed in the tuples (PxPxPxPxPxpx,PyPyPyPyPypy) and (QxQxQxQxQxqx,QyQyQyQyQyqy), where corresponding points must be at the same index positions in the tuples. The transformation is always overdetermined. Therefore, the returned transformation is the transformation that minimizes the distances between the original points (PxPxPxPxPxpx,PyPyPyPyPypy) and the transformed points (QxQxQxQxQxqx,QyQyQyQyQyqy), as described in the following equation (points as homogeneous vectors):

             || / Qx[i] \                / Px[i] \ ||^2
 sum of all  || | Qy[i] |  -  HomMat2D * | Py[i] | ||  =  minimum
             || \  1    /                \  1    / ||

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

In an anisotropic similarity transformation, as defined above, the points are first scaled and then rotated. Sometimes, a transformation in which the points are first rotated and then scaled is useful. This kind of transformation can be computed with vector_to_anisovector_to_anisoVectorToAnisovector_to_anisoVectorToAnisoVectorToAniso by passing the point correspondences in the opposite order, i.e., the points (PxPxPxPxPxpx,PyPyPyPyPypy) are passed in the parameters (QxQxQxQxQxqx,QyQyQyQyQyqy) and vice versa. The resulting transformation must then be inverted with hom_mat2d_inverthom_mat2d_invertHomMat2dInverthom_mat2d_invertHomMat2dInvertHomMat2dInvert.


It should be noted that homogeneous transformation matrices refer to a general right-handed mathematical coordinate system. If a homogeneous transformation matrix is used to transform images, regions, XLD contours, or any other data that has been extracted from images, the row coordinates of the transformation must be passed in the x coordinates, while the column coordinates must be passed in the y coordinates. Consequently, the order of passing row and column coordinates follows the usual order (RowRowRowRowRowrow,ColumnColumnColumnColumnColumncolumn). This convention is essential to obtain a right-handed coordinate system for the transformation of iconic data, and consequently to ensure in particular that rotations are performed in the correct mathematical direction.

Furthermore, it should be noted that if a homogeneous transformation matrix is used to transform images, regions, XLD contours, or any other data that has been extracted from images, it is assumed that the origin of the coordinate system of the homogeneous transformation matrix lies in the upper left corner of a pixel. The image processing operators that return point coordinates, however, assume a coordinate system in which the origin lies in the center of a pixel. Therefore, to obtain a consistent homogeneous transformation matrix, 0.5 must be added to the point coordinates before computing the transformation.



PxPxPxPxPxpx (input_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

X coordinates of the original points.

PyPyPyPyPypy (input_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Y coordinates of the original points.

QxQxQxQxQxqx (input_control)  point.x-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

X coordinates of the transformed points.

QyQyQyQyQyqy (input_control)  point.y-array HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Y coordinates of the transformed points.

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

Output transformation matrix.

Possible Successors

hom_mat2d_inverthom_mat2d_invertHomMat2dInverthom_mat2d_invertHomMat2dInvertHomMat2dInvert, affine_trans_imageaffine_trans_imageAffineTransImageaffine_trans_imageAffineTransImageAffineTransImage, affine_trans_image_sizeaffine_trans_image_sizeAffineTransImageSizeaffine_trans_image_sizeAffineTransImageSizeAffineTransImageSize, 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


vector_to_hom_mat2dvector_to_hom_mat2dVectorToHomMat2dvector_to_hom_mat2dVectorToHomMat2dVectorToHomMat2d, vector_to_similarityvector_to_similarityVectorToSimilarityvector_to_similarityVectorToSimilarityVectorToSimilarity, vector_to_rigidvector_to_rigidVectorToRigidvector_to_rigidVectorToRigidVectorToRigid

See also




ClassesClassesClassesClasses | | | | Operators