solvePnPRansac(), ipoints.isContinuous() error

asked 2014-03-26 13:44:42 -0600

jay gravatar image

Hi,

I'm very new to openCV-python so I'm sorry if this is more obvious to others. I'm trying to run the example pose estimation code that is supplied in the documentation. I'm able to generate the appropriate camera calibration values using the example code. However, the pose estimation always fails at the solvePNPRansac() function with the failed assertion ipoints.isContinuous(), see error below:

OpenCV Error: Assertion failed (ipoints.isContinuous()) in solvePnPRansac, file /tmp/opencv-wcmo/opencv-2.4.8.2/modules/calib3d/src/solvepnp.cpp, line 286
Traceback (most recent call last):
  File "pose.py", line 45, in <module>
    rvecs, tvecs, inliers = cv2.solvePnPRansac(objp, corners2, mtx, dist)
cv2.error: /tmp/opencv-wcmo/opencv-2.4.8.2/modules/calib3d/src/solvepnp.cpp:286: error: (-215) ipoints.isContinuous() in function solvePnPRansac

Any suggestions on how I might fix this would be greatly appreciated.

Thanks!

edit retag flag offensive close merge delete

Comments

Sorry, I figured it out but according to the forum rules I can't answer my own question for another day.

Turns out I wasn't passing solvePnPRansac any valid data for the image points, corners2. It seems that cornerSubPix() wasn't producing any output.

jay gravatar imagejay ( 2014-03-27 10:30:28 -0600 )edit