mirror of
https://github.com/opencv/opencv.git
synced 2026-10-01 04:03:49 +03:00
Add more references. Update missing references with webarchive. Use mathbf for matrices. Check that the determinant of the rotation matrix is not negative (reflection), and correct it if it is the case.
This commit is contained in:
1 parent
db5b22e895
commit
a04f9e7a59
4 files changed
+70
-49
No files matched your search
@@ -109,9 +109,18 @@ void poseEstimationFromCoplanarPoints(const string &imgPath, const string &intri
|
||||
|
||||
//! [polar-decomposition-of-the-rotation-matrix]
|
||||
cout << "R (before polar decomposition):\n" << R << "\ndet(R): " << determinant(R) << endl;
|
||||
Mat W, U, Vt;
|
||||
Mat_<double> W, U, Vt;
|
||||
SVDecomp(R, W, U, Vt);
|
||||
R = U*Vt;
|
||||
double det = determinant(R);
|
||||
if (det < 0)
|
||||
{
|
||||
Vt.at<double>(2,0) *= -1;
|
||||
Vt.at<double>(2,1) *= -1;
|
||||
Vt.at<double>(2,2) *= -1;
|
||||
|
||||
R = U*Vt;
|
||||
}
|
||||
cout << "R (after polar decomposition):\n" << R << "\ndet(R): " << determinant(R) << endl;
|
||||
//! [polar-decomposition-of-the-rotation-matrix]
|
||||
|
||||
|
||||
Reference in new issue
Block a user