Constructing a similarity matrix between points

380 Views Asked by At

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.

1

There are 1 best solutions below

0
On

In Matlab, a = [x y 1] / [u v 1] gives the least squares solution to

a*[u v 1]=[x y 1]

where a is 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 is

A = [[x1 y1 1];[x2 y2 1];[x3 y3 1]] \ [[u1 v1];[u2 v2];[u3 v3]].

That will make it so [x y 1]*A is the transformed position of [x y].