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.
Thanks!
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.