title: 3D reconstruction using stereo vison - theory
body: <p>I am currently reading into the topic of stereo vision, using the book of Hartley&amp;Zimmerman alongside some papers, as I am trying to develop an algorithm capable of creating elevation maps from two images. </p>
  
  <p>I am trying to come up with the basic steps for such an algorithm. This is what I think I have to do:</p>
  
  <p>If I have two images I somehow have to find the fundamental matrix, F, in order to find the actual elevation values at all points from triangulation later on. If the cameras are calibrated this is straightforward if not it is slightly more complex (plenty of methods for this can be found in H&amp;Z). </p>
  
  <p>It is necessary to know F in order to obtain the epipolar lines. These are lines that are used in order to find image point x in the first image back in the second image. </p>
  
  <p>Now comes the part were it gets a bit confusing for me:
  Now I would start taking a image point <code>x_i</code> in the first picture and try to find the corresponding point <code>x_i’</code> in the second picture, using some matching algorithm. Using triangulation it is now possible to compute the real world point X and from that it’s elevation. This process will be repeated for every pixel in the right image. </p>
  
  <p>In the perfect world (no noise etc) triangulation will be done based on </p>
  
  <p><code>x1=P1X
      x2=P2X</code></p>
  
  <p>In the real world it is necessary to find a best fit instead. </p>
  
  <p>Doing this for all pixels will lead to the complete elevation map as desired, some pixels will however be impossible to match and therefore can't be triangulated. </p>
  
  <p>What confuses me most is that I have the feeling that Hartley&amp;Zimmerman skip the entire discussion on how to obtain your point correspondences (matching?) and that the papers I read in addition to the book talk a lot about disparity maps which aren’t mentioned in H&amp;Z at all.  However I think I understood correctly that the disparity is simply the difference <code>x1_i- x2_i</code>?</p>
  
  <p>Is this approach correct, and if not where did I make mistakes?</p>