OpenCV Error: Assertion failed when trying to find fundamental matrix from two loaded images

asked 2014-03-12 17:07:36 -0600

aledalgrande gravatar image

updated 2014-03-13 02:09:41 -0600

berak gravatar image

I'm trying to write some code to estimate the fundamental matrix:

img1 = cv2.imread('glassL.jpg')
img2 = cv2.imread('glassR.jpg')
K = calibration['cameraMatrix']
F = cv2.findFundamentalMat(img1, img2, cv2.FM_RANSAC, 0.1, 0.99)

Getting the error:

OpenCV Error: Assertion failed (npoints >= 0 && points2.checkVector(2) == npoints && points1.type() == points2.type()) in findFundamentalMat, file /tmp/opencv-XbIS/opencv-2.4.8.2/modules/calib3d/src/fundam.cpp, line 1103
Traceback (most recent call last):
  File "sfm.py", line 27, in <module>
    F = cv2.findFundamentalMat(img1, img2, cv2.FM_RANSAC, 0.1, 0.99)
cv2.error: /tmp/opencv-XbIS/opencv-2.4.8.2/modules/calib3d/src/fundam.cpp:1103: error: (-215) npoints >= 0 && points2.checkVector(2) == npoints && points1.type() == points2.type() in function findFundamentalMat

Any clue?

edit retag flag offensive close merge delete

Comments

docs say you feed it with pointlists ( chessboard points, or the like ), not images

berak gravatar imageberak ( 2014-03-13 02:11:37 -0600 )edit