OpenCV CV_32F Error [closed]

asked 2015-09-11 09:30:05 -0500

Roque gravatar image

Hello folks,

First time here, so forgive me if I do something wrong. Of course, if you need more info on the problem, tell me!

I got the following error after running solvePnPRansac:

OpenCV Error: Assertion failed (opoints.depth() == CV_32F) in solvePnPRansac, file /build/buildd/opencv-2.4.8+dfsg1/modules/calib3d/src/solvepnp.cpp, line 284
[ERROR] [WallTime: 1441804199.566629] bad callback: <bound method image_converter.callback of <__main__.image_converter instance at 0x7fbe65cfd050>>
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/topics.py", line 702, in _invoke_callback
    cb(msg)
  File "./image_pos_processing.py", line 195, in callback
    self.rvec, self.tvec, inliers = cv2.solvePnPRansac(np.array(self.WorldPointCoords), self.ImageCoords, self.cameraMatrix, self.distCoeffs, self.rvec, self.tvec, self.extrinsicGuess, self.RansacIterations, self.reprojectionError,flags=self.RansacMethod)
error: /build/buildd/opencv-2.4.8+dfsg1/modules/calib3d/src/solvepnp.cpp:284: error: (-215) opoints.depth() == CV_32F in function solvePnPRansac

Here are the parameters I am sending to the algorithm, ordered:

[[ 0.26   0.01  -0.02 ]
 [ 0.025 -0.19   0.005]
 [ 0.015  0.215  0.01 ]
 [ 0.185 -0.015 -0.17 ]]
[[271 382]
 [566 194]
 [301 213]
 [157 158]]
[[ 829.411513    0.        317.462981]
 [   0.        828.855954  246.688352]
 [   0.          0.          1.      ]]
[-0.03096   0.126496  0.002959 -0.004002  0.      ]
-1
-1
False
500
10.0
1 -> CV_P3P

Any tips on this?

Thank you in advance!

EDIT: If I cast the arrays to int type with .astype(int) it returns the same error.

edit retag flag offensive reopen merge delete

Closed for the following reason OpenCV Question: THe OpenCV community prefers to answer questions at: http://answers.opencv.org/questions/ by tfoote
close date 2015-09-11 12:15:37.004854