Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all you should check if</p> <pre><code>x' * F * x = 0 </code></pre> <p>for your point correspondences <code>x'</code> and <code>x</code>. This should be of course only the case for the inliers of the fundamental matrix estimation with RANSAC.</p> <p>Thereafter, you have to transform your point correspondences to normalized image coordinates (NCC) like this</p> <pre><code>xn = inv(K) * x xn' = inv(K') * x' </code></pre> <p>where <code>K'</code> is the intrinsic camera matrix of the second image and <code>x'</code> are the points of the second image. I think in your case it is <code>K = K'</code>.</p> <p>With these NCCs you can decompose your essential matrix like you described. You triangulate the normalized camera coordinates and check the depth of your triangulated points. But be careful, in literature they say that one point is sufficient to get the correct rotation and translation. From my experience you should check a few points since one point can be an outlier even after RANSAC.</p> <p>Before you decompose the essential matrix make sure that <code>E=U*diag(1,1,0)*Vt</code>. This condition is required to get correct results for the four possible choices of the projection matrix.</p> <p>When you've got the correct rotation and translation you can triangulate all your point correspondences (the inliers of the fundamental matrix estimation with RANSAC). Then, you should compute the <a href="http://en.wikipedia.org/wiki/Reprojection_error" rel="noreferrer">reprojection error</a>. Firstly, you compute the reprojected position like this</p> <pre><code>xp = K * P * X xp' = K' * P' * X </code></pre> <p>where <code>X</code> is the computed (homogeneous) 3D position. <code>P</code> and <code>P'</code> are the 3x4 projection matrices. The projection matrix <code>P</code> is normally given by the identity. <code>P' = [R, t]</code> is given by the rotation matrix in the first 3 columns and rows and the translation in the fourth column, so that <code>P</code> is a 3x4 matrix. This only works if you transform your 3D position to <a href="https://en.wikipedia.org/wiki/Homogeneous_coordinates" rel="noreferrer">homogeneous coordinates</a>, i.e. 4x1 vectors instead of 3x1. Then, <code>xp</code> and <code>xp'</code> are also homogeneous coordinates representing your (reprojected) 2D positions of your corresponding points.</p> <p>I think the</p> <pre><code>new_pos = old_pos + -R.t()*t; </code></pre> <p>is incorrect since firstly, you only translate the <code>old_pos</code> and you do not rotate it and secondly, you translate it with a wrong vector. The correct way is given above.</p> <p>So, after you computed the reprojected points you can calculate the reprojection error. Since you are working with homogeneous coordinates you have to normalize them (<code>xp = xp / xp(2)</code>, divide by last coordinate). This is given by</p> <pre><code>error = (x(0)-xp(0))^2 + (x(1)-xp(1))^2 </code></pre> <p>If the error is large such as 10^2 your intrinsic camera calibration or your rotation/translation are incorrect (perhaps both). Depending on your coordinate system you can try to inverse your projection matrices. On that account you need to transform them to homogeneous coordinates before since you cannot invert a 3x4 matrix (without the pseudo inverse). Thus, add the fourth row [0 0 0 1], compute the inverse and remove the fourth row.</p> <p>There is one more thing with reprojection error. In general, the reprojection error is the squared distance between your original point correspondence (in each image) and the reprojected position. You can take the square root to get the Euclidean distance between both points.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload