Fisheye undistortion with python error

asked 2015-05-12 02:39:57 -0600

dyezepchik gravatar image

Could someone please explain me what is the -215 error? I get this error trying to call cv2.fisheye.calibrate() This is the output: cv2.error: /home/dima/OpenCV/opencv/modules/calib3d/src/fisheye.cpp:695: error: (-215) objectPoints.type() == CV_32FC3 || objectPoints.type() == CV_64FC3 in function calibrate

Also I would appreciate if one could show me any example of doing fisheye routines in python. Thanks a lot for any help!

edit retag flag offensive close merge delete

Comments

Yes, I'm looking for the same kind of examples of how to use the fisheye camera model calibration in Python. I was looking at the source code in version 3 RC1 in the github master branch and the python bindings seem to be exposed for those functions in the header file at opencv/modules/calib3d/include/opencv2/calib3d.hpp. I will confirm later when I install the latest head from source.

opencvslave gravatar imageopencvslave ( 2015-05-29 13:17:20 -0600 )edit

I tried adding a bracket around my image_points and object_points to change their imensions. That gave another error.

I would really like to see a working python-opencv3.0 example of fisheye calibration.

TAXfromDK gravatar imageTAXfromDK ( 2015-07-17 08:59:17 -0600 )edit

I'm experiencing the same problem here. I tried the brackets [] like TAX has, and it gets the function past the CV_ASSERT block. But causes it to fail elsewhere (a_size.width == len) in cv::gemm in core\src\matmul.cpp - which makes me suspect that brackets aren't a real solution.

My finger is pointed at the opencv python bindings in opencv/modules/python/src2/cv2.cpp. I suspect the numpy ndarrays not being converted correctly. But then again, why does non-fisheye calibration still work with these same bindings?

I'd really appreciate someone with python-c++ binding experience to weigh in.

gwillz gravatar imagegwillz ( 2015-09-02 03:52:51 -0600 )edit

Following the comments in issue 5534 I wrote a small wrapper around the python bindings that seems to give a workaround. You can try it: pyfisheye.

amitibo gravatar imageamitibo ( 2015-10-20 08:51:30 -0600 )edit