Reputation: 5325
I have two sets of three (non-collinear) points, in three dimensions. I know the correspondence between the points - i.e. set 1 is {A, B, C} and set 2 is {A', B', C'}.
I want to find the combination of translation and rotation that will transform A' to A, B' to B, and C' to C. Note: There is no scaling involved. (I know this for certain, although I am curious about how to handle it if it did exist.)
I found what looks like a solid explanation while trying to work out how to do this. Section 2 (page 3) entitled "Three Point Registration" appears to be what I need to do. I understand steps 1 through 4 and 6 through 7 just fine, but 5 has me stumped.
5. Build the rotation matrices for both point sets:
Rl = [xl, yl, zl], Rr = [xr, yr, zr]
How do I do that???
Later I plan to implement a least squares solution, but I want to do this first.
Upvotes: 2
Views: 1814
Reputation: 918
I'll take a stab at it.
each point gets an equation: a_1x + b_1y + c_1z = d_1, right, so make 2 3x3 matrices of the a,b,c values.
then, since each point is independent of one another, you can solve for the transform between the two matrices, A and A'
T A = A' After some linear algebra,
T = A' inv(A)
Try it in MATLAB and let us know.
Upvotes: 0
Reputation: 46882
this document appears to have an identical copy of that section, but following that is a worked example. i must admit that it's still not clear to me how the step works, but you may find it clearer than me.
update: column 1 of Rl is the x axis constructed earlier ([0,1,0] in terms of the original axes). so i imagine that x, y and z are the axes, as column vectors. which makes sense... and i assume Rr is the same in the other coordinate system.
is that clear?
Upvotes: 1