]> Calculate affine transform

Calculate affine transform

Calculates affine transform from points x y i to u v i such that

u v i = A x y i + B i .

The transformation is parameterized in terms of a 2×2 transformation matrix A and a 2-element displacement vector B.

Function Summary

Syntax: [A,B] = calcAffine(x,y,u,v);
Inputs: x,y Initial coordinates
u,v Final coordinates
Outputs: A Transformation matrix
B Displacement vector

Detailed Descriptions

The affine transform is are 6-parameter transform, so at least three unique pairs of measurements must be supplied. If more than three pairs are supplied (which is recommended), then the calculation of the transform is implemented as a linear least-squares problem. In other words, the transformation A B maps from x y i to u v i such that the mean square error between the given u v i and the calculated u v i is minimized.