Извлечь перевод и вращение из фундаментальной матрицы

Я пытаюсь получить векторы перемещения и вращения из вычисленной фундаментальной матрицы. Я использую OpenCV, и общий подход взят из Википедии. Мой код выглядит так:

//Compute Essential Matrix
Mat A = cameraMatrix(); //Computed using chessboard
Mat F = fundamentalMatrix(); //Computed using matching keypoints
Mat E = A.t() * F * A;

//Perfrom SVD on E
SVD decomp = SVD(E);

//U
Mat U = decomp.u;

//S
Mat S(3, 3, CV_64F, Scalar(0));
S.at(0, 0) = decomp.w.at(0, 0);
S.at(1, 1) = decomp.w.at(0, 1);
S.at(2, 2) = decomp.w.at(0, 2);

//V
Mat V = decomp.vt; //Needs to be decomp.vt.t(); (transpose once more)

//W
Mat W(3, 3, CV_64F, Scalar(0));
W.at(0, 1) = -1;
W.at(1, 0) = 1;
W.at(2, 2) = 1;

cout < "computed rotation: " < endl;
cout < U * W.t() * V.t() < endl;
cout < "real rotation:" < endl;
Mat rot;
Rodrigues(images[1].rvec - images[0].rvec, rot); //Difference between known rotations
cout < rot < endl;

Ответы на вопрос(2)

Ваш ответ на вопрос