Correct way to extract Translation from Essential Matrix through SVD
Asked Answered
U

1

10

I calibrated my camera and found the intrinsic parameters(K). Also I have calculated the Fundamental Matrix (F).

Now E= K_T* F * K . So far so good.

Now we pass the Essential Matrix(E) to the SVD to use the decomposition values (U,W,V) to extract the Rotation and Translation:

 essentialMatrix = K.Transpose().Mul(fund).Mul(K);
 CvInvoke.cvSVD(essentialMatrix, wMatrix, uMatrix, vMatrix, Emgu.CV.CvEnum.SVD_TYPE.CV_SVD_DEFAULT);

** Question) At this point, two methods have been proposed, and it has confused me which one really give out the right answer- specifically for Translation:

At first method enter link description here the author suggests to compute the R,T as following:

enter image description here

But in Second method [http://isit.u-clermont1.fr/~ab/Classes/DIKU-3DCV2/Handouts/Lecture16.pdf] the author provides another formula for T which is +U , -U as shown below:

enter image description here

I am implementing this on C# .Net using openCv libraries. Anybody knows which Translation Formula is the right one?

Udometer answered 11/4, 2013 at 4:15 Comment(1)
The link for the second method is dead. The document moved to: igt.ip.uca.fr/~ab/Classes/DIKU-3DCV2/Handouts/Lecture16.pdfOnder
C
4

the first solution shows the matrix representation of the cross product with vector t (so first solution = [t]x ), while the second solution shows just the translation vector t (https://en.wikipedia.org/wiki/Essential_matrix).

The definition of [t]x is:

enter image description here

(from http://gandalf-library.sourceforge.net/tutorial/report/img148.png)

Cayes answered 19/5, 2013 at 18:50 Comment(4)
In First solution, T1,T2 are nonZero 3X3 matrices but in fact as a translation t , I need 3X1 matrix. how should I extract 3X1 from a nonZero 3X3 matrix without losing information?Udometer
if you extract translation with SVD, the translation vector is SVD(E).u.col(2), as it is described in the second method of your post. how do you extract your 3x3 translation matrix? you can also look at #16639606 for further informationCayes
I used the 1st method mentioned above to extract T1,T2 that either are 3X3. Am I doing something wrong? In the link provided, again the guy jumped from calculation of t1,t2 to t without mentioning the conversion/relation between t1,t2 and t as I restate it below: t1 = decomp.u.col(2); //u3 t2 = -decomp.u.col(2); //u3 new_pos = old_pos + -R.t()*t;Udometer
since you're are using SVD, your translation vector (3x1) is the 3rd column of U (decomp.u.col(2) returns a 3x1 vector). by using SVD, you get 4 possible solutions, 2 for R and 2 for t. to get the correct solution of both, you can use triangulation. if you read the other question carefully, you'll see that between ` t1\t2 = decomp.u.col(2);` and new_pos = old_pos + -R.t()*t; the triangulation is done (link provided in other question). Also read the comments, which points out a mistake in SVD computationCayes

© 2022 - 2024 — McMap. All rights reserved.