Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is an extremely broad question, here is a general outline of one way you could do it...</p> <ul> <li><p>Find strong <em>features</em> or <em>corners</em> on both images using <code>cvGoodFeaturesToTrack()</code></p></li> <li><p>Pass the features you found into <code>cvFindCornerSubPix()</code> to get more precise floating point representations of the locations of strong <em>features</em></p></li> <li><p>Calculate the optical flow between the two images using the sub-pixel features from the last step using <code>cvCalcOpticalFlowPyrLK</code> or another optical flow function. (I like <code>cvCalcOpticalFlowPyrLK()</code>)</p></li> </ul> <p><em>This is where it gets tricky</em>... in order to rectify images it helps to have some knowledge about the intrinsic camera properites (field of view, focal length) especially if you are planning to do some kind of 3d reconstruction or compute disparity correspondence. Since you didn't mention anything about a calibrated camera set up I will continue on the <em>uncalibrated</em> algorithm.</p> <ul> <li><p>You will need to find the Fundamental Matrix which encodes all aspects of the scene used to compute a rectification matrix. Use <code>cvFindFundamentalMatrix()</code> to do this.</p></li> <li><p>Armed with the Fundamental Matrix you must now find the Homography Matrix, which will map both images to the same plane. Use <code>cvStereoRectifyUncalibrated()</code> to do this. Although the name would suggest that it is rectifying your images it is NOT, it just returns homography matrices that you can USE to rectify your images.</p></li> <li><p>Finally, using the Homography matrices from the last step you can rectify both images by calling <code>cvInitUndistortRectifyMap()</code> to get a remap matrix and then pass that into <code>cvRemap()</code> to do the actual remapping.</p></li> </ul> <p>I must warn you that there are <em>many</em> parameters that go into <em>each</em> of these library calls and you will have to manipulate <em>many</em> matrices and <em>many</em> images, not to mention without the intrinsic camera calibration details you will have to make many assumptions that could drastically affect your results... It is no easy task.</p> <hr> <p>I would recommend buying and/or reading <a href="http://oreilly.com/catalog/9780596516130">Learning OpenCV</a> if you want to learn more, it is far beyond the scope of a short paragraph on stackoverflow to expect to learn all of this :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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