icp icon indicating copy to clipboard operation
icp copied to clipboard

why did this ? what's the meaning?

Open duguguang opened this issue 2 years ago • 1 comments

if (R.determinant() < 0 ){
    Vt.block<1,3>(2,0) *= -1;
    R = Vt.transpose()*U.transpose();
}

duguguang avatar Oct 11 '22 07:10 duguguang

In 3D geometry, the matrix Vt is used to calculate the rotation matrix R. The check if (R.determinant() < 0) is performed to ensure that R is a proper rotation matrix. If the determinant of R is negative, it means that the transformation involves a reflection. In such cases, the line you mentioned is applied to correct the reflection by negating the third row of the transposed matrix Vt.

zlg9folira avatar Jan 19 '24 23:01 zlg9folira