I have a certain matrix .... How do I know the transformation matrix multiplied by ... if the output is also given as a matrix
1 view (last 30 days)
Show older comments
4 Comments
Roger Stafford
on 18 Mar 2014
You need four, not three, pairs of known (x,y,z) & (x',y',z') values. Otherwise, the transformation matrix is not uniquely determined. Given four pairs, you can use matlab's matrix right division (slash) to find the matrix.
Answers (2)
Roger Stafford
on 19 Mar 2014
Edited: Roger Stafford
on 19 Mar 2014
"Then the solution is" should read: "then one of infinitely many solutions is." What you have here are twelve equations and sixteen unknowns, so the problem is underdetermined with only three pairs. You could also say a solution is:
[x1',x2',x3';y1',y2',y3';z1',z2',z3';1,1,1] / ...
[x1 ,x2 ,x3 ;y1 ,y2 ,y3 ;z1 ,z2 , z3;1,1,1]
for which I believe matlab gives a least squares solution chosen out of, as I say, infinitely many possible solutions.
2 Comments
Matt J
on 19 Mar 2014
Edited: Matt J
on 19 Mar 2014
Was this meant to be a comment to my Answer?
I'm reading between the lines a bit here, but I don't think there are truly meant to be infinite solutions. Rather, I htink that the question was under-specified. The fact that the vectors multiplied here are of the form [x;y;z;1], plus the fact that only 3 input pairs are available for the problem, suggests that the OP is really trying to represent a 3D affine transformation
[x';y';z'] = A*[x;y;z]+b
in 4D homogeneous coordinates. This means the final matrix has to be of the form
H = [A,b;[0 0 0 1]]
and the idea is to solve for the 3x3 matrix A and 3x1 translation b.
Roger Stafford
on 19 Mar 2014
Yes, Matt, you are probably right. It isn't the question Ameer asked, but it may be what was meant.
See Also
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!