vector_to_hom_mat2dT_vector_to_hom_mat2dVectorToHomMat2dVectorToHomMat2dvector_to_hom_mat2d (Operator)

Name

vector_to_hom_mat2dT_vector_to_hom_mat2dVectorToHomMat2dVectorToHomMat2dvector_to_hom_mat2d — Approximate an affine transformation from point correspondences.

Signature

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

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

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

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

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

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

def vector_to_hom_mat2d(px: Sequence[float], py: Sequence[float], qx: Sequence[float], qy: Sequence[float]) -> Sequence[float]

Description

vector_to_hom_mat2dvector_to_hom_mat2dVectorToHomMat2dVectorToHomMat2dVectorToHomMat2dvector_to_hom_mat2d approximates an affine transformation from at least three point correspondences and returns it as the homogeneous transformation matrix HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d (see hom_mat2d_to_affine_parhom_mat2d_to_affine_parHomMat2dToAffineParHomMat2dToAffineParHomMat2dToAffineParhom_mat2d_to_affine_par for the content of the homogeneous transformation matrix).

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. If more than three point correspondences are passed, the transformation is overdetermined. In this case, the returned transformation is the transformation that minimizes the distances between the input points (PxPxPxPxpxpx,PyPyPyPypypy) and the transformed points (QxQxQxQxqxqx,QyQyQyQyqyqy), as described in the following equation (points as homogeneous vectors):

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

Attention

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.

Execution Information

Parameters

PxPxPxPxpxpx (input_control)  point.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

X coordinates of the original points.

PyPyPyPypypy (input_control)  point.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Y coordinates of the original points.

QxQxQxQxqxqx (input_control)  point.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

X coordinates of the transformed points.

QyQyQyQyqyqy (input_control)  point.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Y coordinates of the transformed points.

HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d (output_control)  hom_mat2d HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Output transformation matrix.

Possible Successors

affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image, affine_trans_image_sizeaffine_trans_image_sizeAffineTransImageSizeAffineTransImageSizeAffineTransImageSizeaffine_trans_image_size, affine_trans_regionaffine_trans_regionAffineTransRegionAffineTransRegionAffineTransRegionaffine_trans_region, affine_trans_contour_xldaffine_trans_contour_xldAffineTransContourXldAffineTransContourXldAffineTransContourXldaffine_trans_contour_xld, affine_trans_polygon_xldaffine_trans_polygon_xldAffineTransPolygonXldAffineTransPolygonXldAffineTransPolygonXldaffine_trans_polygon_xld, affine_trans_point_2daffine_trans_point_2dAffineTransPoint2dAffineTransPoint2dAffineTransPoint2daffine_trans_point_2d

Alternatives

vector_to_anisovector_to_anisoVectorToAnisoVectorToAnisoVectorToAnisovector_to_aniso, vector_to_similarityvector_to_similarityVectorToSimilarityVectorToSimilarityVectorToSimilarityvector_to_similarity, vector_to_rigidvector_to_rigidVectorToRigidVectorToRigidVectorToRigidvector_to_rigid

See also

vector_field_to_hom_mat2dvector_field_to_hom_mat2dVectorFieldToHomMat2dVectorFieldToHomMat2dVectorFieldToHomMat2dvector_field_to_hom_mat2d, point_line_to_hom_mat2dpoint_line_to_hom_mat2dPointLineToHomMat2dPointLineToHomMat2dPointLineToHomMat2dpoint_line_to_hom_mat2d

Module

Foundation