Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

solvePnPRansac CV_32F error

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

Any tips on this?

Thank you in advance!

solvePnPRansac CV_32F error

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

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.

solvePnPRansac CV_32F error

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

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.