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

Approximate an affine transformation from point correspondences.

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

The point correspondences are passed in the tuples (Px,Py) and (Qx,Qy), 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 (Px,Py) and the transformed points (Qx,Qy), 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    / ||


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 (Row,Column). 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.


Parameters

Px (input_control)
point.x-array -> real
X coordinates of the original points.

Py (input_control)
point.y-array -> real
Y coordinates of the original points.

Qx (input_control)
point.x-array -> real
X coordinates of the transformed points.

Qy (input_control)
point.y-array -> real
Y coordinates of the transformed points.

HomMat2D (output_control)
hom_mat2d-array -> real
Output transformation matrix.


Parallelization Information

vector_to_hom_mat2d is reentrant and processed without parallelization.


Possible Successors

affine_trans_image


Alternatives

dvf_to_hom_mat2d


See also

affine_trans_image, optical_flow_match


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH