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?

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
farzin parsa
  • 537
  • 2
  • 9
  • 33

1 Answers1

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)

James Johnston
  • 9,264
  • 9
  • 48
  • 76
pichsenmeister
  • 2,132
  • 4
  • 18
  • 34
  • 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? – farzin parsa Jul 12 '13 at 18:35
  • 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 http://stackoverflow.com/questions/16639106/camera-motion-from-corresponding-images for further information – pichsenmeister Jul 13 '13 at 11:38
  • 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; – farzin parsa Jul 16 '13 at 04:31
  • 3
    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 computation – pichsenmeister Jul 16 '13 at 09:36