I have two images with two sets of corresponding points. In order to align the images I'm trying to compute the similarity matrix that describes the relationship between the corresponding points.
I know it's connected to affine transform:
[x y 1] = [u v 1] [a11 a12 0; a21 a22 0; a31 a32 1]
Rearranging the equation does [x y 1] / [u v 1] give the transform matrix?
Many thanks for any help you can give.
In Matlab,
a = [x y 1] / [u v 1]gives the least squares solution toa*[u v 1]=[x y 1]where
ais a scalar (not what you want).To define an affine transformation in a plane, you need at least three points (and their corresponding points after the transformation).
If
[x1 y1]goes to[u1 v1]etc., then what you want isA = [[x1 y1 1];[x2 y2 1];[x3 y3 1]] \ [[u1 v1];[u2 v2];[u3 v3]].That will make it so
[x y 1]*Ais the transformed position of[x y].