title: Decomposition of essential matrix leads to wrong rotation and translation
body: <p>I am doing some SfM and having troubles getting R and T from the essential matrix.</p>
  
  <p>Here is what I am doing in sourcecode:</p>
  
  <pre><code>Mat fundamental = Calib3d.findFundamentalMat(object_left, object_right);
  Mat E = new Mat();
  
  Core.multiply(cameraMatrix.t(), fundamental, E); // cameraMatrix.t()*fundamental*cameraMatrix;
  Core.multiply(E, cameraMatrix, E);
  
  Mat R = new Mat();
  Mat.zeros(3, 3, CvType.CV_64FC1).copyTo(R);
  
  Mat T = new Mat();
  
  calculateRT(E, R, T);
  
  where `calculateRT` is defined as follows:
  
  private void calculateRT(Mat E, Mat R, Mat T) {
  
      /*
       * //-- Step 6: calculate Rotation Matrix and Translation Vector
          Matx34d P;
          //decompose E 
          SVD svd(E,SVD::MODIFY_A);
          Mat svd_u = svd.u;
          Mat svd_vt = svd.vt;
          Mat svd_w = svd.w;
          Matx33d W(0,-1,0,1,0,0,0,0,1);//HZ 9.13
          Mat_&lt;double&gt; R = svd_u * Mat(W) * svd_vt; //
          Mat_&lt;double&gt; T = svd_u.col(2); //u3
  
          if (!CheckCoherentRotation (R)) {
              std::cout&lt;&lt;"resulting rotation is not coherent\n";
              return 0;
          }
       */
      Mat w = new Mat();
      Mat u = new Mat();
      Mat vt = new Mat();
  
      Core.SVDecomp(E, w, u, vt, Core.DECOMP_SVD); // Maybe use flags
      Mat W = new Mat(new Size(3,3), CvType.CV_64FC1);
      W.put(0, 0, W_Values);
  
      Core.multiply(u, W, R);
      Core.multiply(R, vt, R);
  
      T = u.col(2);
  }
  </code></pre>
  
  <p>And here are the results of all matrizes after and during calculation.</p>
  
  <pre><code>    Number matches: 10299
      Number of good matches: 590
      Number of obj_points left: 590.0
  
  
           CameraMatrix: 
                          [1133.601684570312,         0,             639.5;
                                 0 ,          1133.601684570312,     383.5;
                                 0,                   0,               1]
  
  
         DistortionCoeff: [0.06604336202144623; 0.21129509806633; 0; 0; -1.206771731376648]
  
  
      Fundamental: 
      [4.209958176688844e-08, -8.477216249742946e-08, 9.132798068178793e-05;
      3.165719895008366e-07, 6.437858397735847e-07, -0.0006976204595236443;
      0.0004532506630569588, -0.0009224427024602799, 1]
  
      Essential: 
      [0.05410018455525099, 0, 0;
      0, 0.8272987826496967, 0;
      0, 0, 1]
  
      U: (SVD)
      [0, 0, 1;
       0, 0.9999999999999999, 0;
       1, 0, 0]
  
      W: (SVD) 
      [1; 0.8272987826496967; 0.05410018455525099]
  
      vt: (SVD)
      [0, 0, 1;
       0, 1, 0;
       1, 0, 0]
  
  
      R: 
      [0, 0, 0;
       0, 0, 0;
       0, 0, 0]
  
      T: 
      [1; 0; 0]
  </code></pre>
  
  <p>And for completion here are the image I am using: <a href="https://drive.google.com/file/d/0Bx9OKnxaua8kXzRFNFRtMlRHSzg/edit?usp=sharing" rel="nofollow">left</a> and <a href="https://drive.google.com/file/d/0Bx9OKnxaua8kd3hyMjN1Zll6ZkE/edit?usp=sharing" rel="nofollow">right</a>.</p>
  
  <p>Before calulation of FeaturePoints and so on, I am doing an undistrortion of the images.</p>
  
  <p>Can someone point out where something is goind wrong or what I am doing wrong?  </p>
  
  <p>edit: Question
  Is it possible that my fundamental matrix is equals to the essential matrix as I am in the calibrated situation and Hartley and zissermann says: </p>
  
  <p><em>„11.7.3 The calibrated case: 
  In the case of calibrated cameras normalized image coordinates may be used, and the essential matrix E computed instead of the fundamental matrix”</em></p>