MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

### Discover what MATLAB® can do for your career.

 Subject: Manifold Intersection From: Gus Lott Date: 21 Jun, 2012 16:58:05 Message: 1 of 5 Hi All, I have the following problem. Two 6-dimensional matrix bases out of the set of all 3x3 matrices. X = a*X1 + b*X2 + c*X3 + d*X4 + e*X5 + f*X6 Y = a*Y1 + b*Y2 + c*Y3 + d*Y4 + e*Y5 + f*Y6 Here, the basis matrices (Xi,Yi) are derived from a set of homogeneous constraints on an 18 parameter space. Xi and Yi are known. I'd like to find a value for a,b,c,d,e,f that bring X and Y as close to the manifold of 3x3 orthogonal matrices, SO(3), as possible. That is, I have solved up to this linear null space and have the final constraint that X and Y are orthogonal matrices (i.e. 3D rotations). The only solutions I can come up with involve things like X'X = I and these end up with a bunch of polynomial equations in terms of the variables in the equation. Does anyone know of a linear method for such a solution? Warm Regards, Gus Lott
 Subject: Manifold Intersection From: Matt J Date: 21 Jun, 2012 20:47:07 Message: 2 of 5 "Gus Lott" wrote in message ... > > That is, I have solved up to this linear null space and have the final constraint that X and Y are orthogonal matrices (i.e. 3D rotations). ============ If you require 3D rotations, then orthogonality of X and Y will not be enough. It is also required that their determinants equal 1 (as opposed to -1). So do you require rotations, or merely orthogonality?
 Subject: Manifold Intersection From: Gus Lott Date: 21 Jun, 2012 21:59:08 Message: 3 of 5 "Matt J" wrote in message ... > If you require 3D rotations, then orthogonality of X and Y will not be enough. It is also required that their determinants equal 1 (as opposed to -1). So do you require rotations, or merely orthogonality? Hi Matt, Merely orthogonal is all I need. Det(X) = 1 is not a requirement. Thanks
 Subject: Manifold Intersection From: Matt J Date: 22 Jun, 2012 12:28:06 Message: 4 of 5 Here's something you might do, though it might be a bit of a compromise Let Rx and Ry be the unknown 3x3 rotation matrices and let E=eye(3). What I'm thinking is that you pose the following minimization problem min. sum_i   norm(Rx*E(:,i)+tx-( a*X1 + b*X2 + c*X3 + d*X4 + e*X5 + f*X6)*E(:,i))).^2+   norm(Ry*E(:,i)+ty-( a*Y1 + b*Y2 + c*Y3 + d*Y4 + e*Y5 + f*Y6)*E(:,i))).^2 For fixed Rx,tx and Ry,ty this is just a linear least squares problem in a,b,c,d, easily solved using \. For fixed a,b,c,d,e,f, it reduces to two absolute orientation problems and can be solved using this FEX file http://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-orientation-horns-method You can therefore minimize iteratively/alternatingly over (Rx,tx,Ry,ty) and (a,b,c,d,e,f) in a block coordinate descent approach. Worth a try anyway.... The compromise is that the solutions Rx and Ry will in fact be constrained to det=1. You also want get a pure rotation as a solution. There will be translations tx and ty as well.
 Subject: Manifold Intersection From: Matt J Date: 22 Jun, 2012 19:23:06 Message: 5 of 5 "Matt J" wrote in message ... > > Here's something you might do, though it might be a bit of a compromise > > Let Rx and Ry be the unknown 3x3 rotation matrices and let E=eye(3). What I'm thinking is that you pose the following minimization problem > > min. sum_i > norm(Rx*E(:,i)+tx-( a*X1 + b*X2 + c*X3 + d*X4 + e*X5 + f*X6)*E(:,i))).^2+ > norm(Ry*E(:,i)+ty-( a*Y1 + b*Y2 + c*Y3 + d*Y4 + e*Y5 + f*Y6)*E(:,i))).^2 > > I found a simpler variation of my proposal above, which doesn't constrain the solution to det(Rx)=det(Ry)=1 and doesn't require translation terms tx,ty. What you do is minimize the following f(Rx,Ry,a,b,c,d,e,f)=    norm(Rx- ( a*X1 + b*X2 + c*X3 + d*X4 + e*X5 + f*X6)), 'fro').^2+    norm(Ry- ( a*Y1 + b*Y2 + c*Y3 + d*Y4 + e*Y5 + f*Y6)), 'fro').^2 You would use the same iterative alternating approach as before. However, the minimization with respect to Rx,Ry can be done more simply using this result http://people.csail.mit.edu/bkph/articles/Nearest_Orthonormal_Matrix.pdf