Ask Your Question

Revision history [back]

Wrong Epipolar lines, No Visual sanity

Hi, I've tried using the code given https://docs.opencv.org/3.2.0/da/de9/tutorial_py_epipolar_geometry.html to find the epipolar lines, but instead of getting the output given in the link, I am getting the following output. image description

but when changing the line F, mask = cv2.findFundamentalMat(pts1,pts2,cv2.FM_LMEDS) to F, mask = cv2.findFundamentalMat(pts1,pts2,cv2.FM_RANSAC) i.e: using RANSAC algorithm to find Fundamental matrix instead of LMEDS this is the following output. image description

When the same line is replaced with F, mask = cv2.findFundamentalMat(pts1,pts2,cv2.FM_8POINT) i.e: use eight point algorithm this is the following output. image description

All of the above about output does not have any visual sanity nor anyway near to close to the given output in opencv documentation for finding epipolar lines. But ironically, if the same code if executed by changing the algorithm to find fundamental matrix in this particular sequence

  1. FM_LMEDS
  2. FM_8POINT
  3. FM_7POINT
  4. FM_LMEDS

most accurate results are generated. This is the output. image description

I thought we are suppose to get the above output in one run of any of the algorithm (with the variations in matrix values and error). Am I running the code incorrectly? What is that I've to do, to get the correct epipolar lines (i.e.; visually sane)? I am using opencv version 3.3.0 and python 2.7. Looking forward for reply. Thank you.