Approximate an affine transformation from point correspondences.
vector_to_hom_mat2d approximates an affine transformation from at least three point correspondences and returns it in form of the homogeneous transformation matrix HomMat2D (siehe hom_mat2d_to_affine_par for the content of the homogeneous transformation matrix).
The point correspondences are passed in the tuples (Rows1,Columns1) and (Rows2,Columns2), 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 (Rows1,Columns1) and the transformed points (Rows2,Columns2), as described in the following equation (points in form of homogeneous vectors):
|| / Rows2[i] \ / Rows1[i] \ ||^2
sum of all || | Columns2[i] | - HomMat2D * | Columns1[i] | || = minimal
|| \ 1 / \ 1 / ||
HomMat2D can be used directly with operators that transform data using affine transformations, e.g., affine_trans_image.
|
Rows1 (input_control) |
point.y-array -> real |
| Row coordinates of the starting points. | |
|
Columns1 (input_control) |
point.x-array -> real |
| Column coordinates of the starting points. | |
|
Rows2 (input_control) |
point.y-array -> real |
| Row coordinates of the end points. | |
|
Columns2 (input_control) |
point.x-array -> real |
| Column coordinates of the end points. | |
|
HomMat2D (output_control) |
affine2d-array -> real |
| Output transformation matrix. | |
| Number of elements: 6 | |
vector_to_hom_mat2d is reentrant and processed without parallelization.
affine_trans_image, optical_flow_match
Basic operators