Given a $3\times3$ matrix $M$, if we would like to get the closest $\mathrm{SO}(3)$ matrix $R$ that minimizes \begin{equation} \|R-M\|_F \end{equation}

then $R$ = $UV^{T}$ where $U$ and $V^{T}$ are the orthogonal matrices from the singular value decompositon of $M$. i.e. $M = U\Sigma V^{T}$ as explained in this answer. When $UV$ is not a "special" orthogonal matrix i.e. $det(UV^{T}) = -1$ we replace the singular vector $u_3$ by $-u_3$.

My question is why only $u_3$ and why not any other column of $U$ or row of $V^{T}$?

(Posting this as a question instead of a comment since I don't have enough reputation yet, sorry!)

New contributor
Karnik Ram is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • $\begingroup$ You must mean $\det(UV^{T}) = -1$ $\endgroup$ – Jean Marie Becker Aug 14 at 16:03
  • $\begingroup$ Oops, yes thanks! $\endgroup$ – Karnik Ram Aug 14 at 17:09

By right-multiplying both $R$ and $M$ by $V$ and left-multiplying by $U^T$ you are leaving the objective invariant. Now the new $M$ is diagonal (actually, it's $\Sigma$), and it's not hard to convince yourself that so should the new $R$ be. If $\det(UV^T) = -1$, then the constraint means $R$ is a diagonal matrix with $\pm 1$ as its diagonal entries, and an odd number of $-1$s. Since $\Sigma$ is nonnegative, the choice that minimizes the distance is to make the entry corresponding to the smallest diagonal entry in $\Sigma$ the sole $-1$.

  • $\begingroup$ Thanks for your answer! I am able to convince myself that the new rotation $R'$ (after left-multiplying and right-multiplying $R$) should be diagonal, but I am unable to understand why it should have a determinant of -1. I think the old rotation, $R$, should have a determinant of -1 (to make $det(U^{T}RV) = 1$ when det(UV^{T} = -1), but then it need not be diagonal? $\endgroup$ – Karnik Ram 2 days ago
  • $\begingroup$ The old rotation R is what you constrain to be in SO(3), so it needs to be determinant 1. If you let $R' = U^T R V$, then you need $\det R' = -1$. $\endgroup$ – Yoav Kallus 2 days ago
  • $\begingroup$ Thanks! I get it now. And negating the last element of $\Sigma$ is equivalent to negating the smallest singular vector of $U$. And we know $R = UV^{T}$. But what seems a little unintuitive to me here is that we're modifying our input $M$ itself to minimize the objective. $\endgroup$ – Karnik Ram 2 days ago

Your Answer

Karnik Ram is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.