Ask Your Question
0

Python findFundamentalMat

asked 2012-07-12 06:58:34 -0600

Tommy gravatar image

updated 2012-07-13 01:56:26 -0600

Kirill Kornyakov gravatar image

I keep getting the error:

Traceback (most recent call last):
  File "OpenCVTest.py", line 73, in <module>
    (retval,mask) = cv.findFundamentalMat(c1,c2)
cv2.error: /tmp/homebrew-opencv-2.4.2-OdWH/OpenCV-2.4.2/modules/calib3d/src/fundam.cpp:1103: error: (-215) npoints >= 0 && points2.checkVector(2) == npoints && points1.type() == points2.type() in function findFundamentalMat

Where c1 and c2 are 8 by 2 ndarrays.

It works in cv, but not in cv2. Is this a bug or am I doing something wrong?

I am using OpenCV 2.4.2 in Python 2.7.3.

Thanks!

edit retag flag offensive close merge delete

Comments

Did you check if their types are same ? The point coordinates should be floating-point (single or double precision).

Abid Rahman K gravatar imageAbid Rahman K ( 2012-07-12 12:08:10 -0600 )edit

OMG, what a newbie mistake.. Yeah, you are right! They were int64, when they should have been float64. I assumed that they were float by default, but apparently not.

Thanks!

Tommy gravatar imageTommy ( 2012-07-13 13:45:39 -0600 )edit
1

If it solves your problem, you can accept answer below and close this session.

Abid Rahman K gravatar imageAbid Rahman K ( 2012-07-13 23:19:07 -0600 )edit

Ok. Thanks!

Tommy gravatar imageTommy ( 2012-07-14 02:42:35 -0600 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2012-07-13 23:19:27 -0600

Abid Rahman K gravatar image

From documentation of cv2.FindFundamentalMat():

points1 – Array of N points from the first image. The point coordinates should be floating-point (single or double precision).

points2 – Array of the second image points of the same size and format as points1 .

Check if your inputs are floating point type.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-07-12 06:58:34 -0600

Seen: 4,661 times

Last updated: Jul 13 '12