Does anyone know of any standard algorithms to determine an affine transformation matrix based upon a set of known points in two co-ordinate systems?
Does anyone know of any standard algorithms to determine an affine transformation matrix based
Share
Affine transformations are given by 2×3 matrices. We perform an affine transformation M by taking our 2D input (x y), bumping it up to a 3D vector (x y 1), and then multiplying (on the left) by M.
So if we have three points (x1 y1) (x2 y2) (x3 y3) mapping to (u1 v1) (u2 v2) (u3 v3) then we have
You can get M simply by multiplying on the right by the inverse of
A 2×3 matrix multiplied on the right by a 3×3 matrix gives us the 2×3 we want. (You don’t actually need the full inverse, but if matrix inverse is available it’s easy to use.)
Easily adapted to other dimensions. If you have more than 3 points you may want a least squares best fit. You’ll have to ask again for that, but it’s a little harder.