]>
Calculates affine transform from points to such that
The transformation is parameterized in terms of a transformation matrix and a 2-element displacement vector .
| Syntax: | [A,B] = calcAffine(x,y,u,v); | |
|---|---|---|
| Inputs: | x,y | Initial coordinates |
| u,v | Final coordinates | |
| Outputs: | A | Transformation matrix |
| B | Displacement vector | |
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 maps from to such that the mean square error between the given and the calculated is minimized.