Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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?

click to hide/show revision 2
retagged

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

berak gravatar image

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

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?