# Efficient algorithm for numerical estimation of 3D rotation matrix

I am writing a computer vision related program and stuck on a problem. I have a system of quadratic equations

where M is a constant 3x3 matrix, is the 3x3 identity matrix, and we are solving for the 3x3 matrix R.

The first set of equations contains 6 independent equations which leaves us with 3 degrees of freedom of SO(3) group. The second set of 3 equations just states that the matrix is symmetric.

Since this program will repeatedly solve these equations, I am searching for an efficient algorithm which I can run on Raspberry Pi, i.e. not monsters like Matlab, Mathematica or root.

• This problem is equivalent to: given a constant 3x3 matrix $P$, find a symmetric 3x3 matrix $S$ such that $SPS = \mathbb{I}$ (take $P=(M^{-1})^T M^{-1}$ and $R = S (M^{-1})^T$). That gives you 9 quadratic equations in 6 unknowns. I don't know if that helps. – D.W. Mar 22 '19 at 19:40
• P is a symmetric matrix, so it is still 6 equations. – Vahagn Mar 23 '19 at 8:25
• Can I ask some more about the underlying problem? Are you trying to match point correspondences? Because if so, that's a fairly well-understood problem. – Pseudonym Mar 25 '19 at 22:15