I came across some code that takes some orthogonal matrix $R$ and computes the SVD of it $U, S, V^T = SVD(R)$ and then they compute the quantity $UV$ with the comment: Transformation of R into - in Frobenius sense - next orthonormal matrix. I'm trying to figure out what this means, and why they did this.

Not sure if it's relevant to this question, but this code tries recovering a rotation and translation from a homography matrix.


  • $\begingroup$ If you post more code maybe I can help. So far the only thing I notice is that since $R$ is ortogonal and $R = U \Sigma V^t$, than $\Sigma$ is full rank with diagonals $\pm 1$ since an ortogonal matriz preserves norm. Then $\Sigma ^2 = I$. Using it $R = U \Sigma V^t \to RV = U \Sigma \to RV\Sigma = U \to RV\Sigma V = UV $, it helps? $\endgroup$ – Lucas Resende Jun 13 '18 at 2:36
  • $\begingroup$ @LucasResende thanks. I have linked the full script in my original post. So it seems like you are saying they just for back the same R? Not sure what the point of this is $\endgroup$ – Carpetfizz Jun 13 '18 at 2:38

My impression is as follows: before they "transform $R$ to the nearest orthogonal matrix", $R$ might not be exactly orthogonal (my guess is that this is a result of errors due to rounding or approximation along the way). In order to have an $R$ which is exactly orthogonal, the use the $R$ that they found and produce the nearest (exactly) orthogonal matrix.

  • $\begingroup$ Thanks, that makes a lot of sense. Do you also happen to know why one would divide all the columns of a (potential) rotation matrix by the norm of the first column, prior to doing this procedure? As evidenced by here $\endgroup$ – Carpetfizz Jun 13 '18 at 4:37
  • $\begingroup$ No ideas there. $\endgroup$ – Omnomnomnom Jun 13 '18 at 14:27

Your Answer

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.