Ask Your Question
0

fisheye.cpp:424: error: (-215) (K.depth() ...can anyone know the solution? [closed]

asked 2017-06-22 11:32:36 -0600

quadro gravatar image

Hi,

I tried a OpenCV Aruco board project in Python; https://github.com/LongerVision/OpenC...

And I got the error below;

"map1, map2 = cv2.fisheye.initUndistortRectifyMap(camera_matrix, dist_coeffs, r, new_camera_matrix, image_size, cv2.CV_16SC2) cv2.error: C:\projects\opencv-python\opencv\modules\calib3d\src\fisheye.cpp:424: error: (-215) (K.depth() == CV_32F || K.depth() == CV_64F) && (D.depth() == CV_32F || D.depth() == CV_64F) in function cv::fisheye::initUndistortRectifyMap"

And this was the problematic line; map1, map2 = cv2.fisheye.initUndistortRectifyMap(camera_matrix, dist_coeffs, r, new_camera_matrix, image_size, cv2.CV_16SC2)

Anyone know solutions to fix it?

Thank you very much!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by quadro
close date 2020-04-01 07:36:03.389322

Comments

what are camera_matrix, dist_coeffs ? it complains about the wrong type of those.

berak gravatar imageberak ( 2017-06-22 11:37:42 -0600 )edit
1

Yes, this is the problem, but I don't know what is this files;Here load the files, but I just find one in the directory;

# Load Calibrated Parameters
calibrationFile = "C:\Users\gergely\Desktop\kiserlet\python\OpenCV_Examples-master\OpenCV_Examples-master\01_internal_camera_calibration\calibration.yaml"
calibrationParams = cv2.FileStorage(calibrationFile, cv2.FILE_STORAGE_READ)
camera_matrix = calibrationParams.getNode("cameraMatrix").mat()
dist_coeffs = calibrationParams.getNode("distCoeffs").mat()
And I printed out;
"calibrationParams = <FileStorage 026640D0>
camera_matrix = None
dist_coeffs = None

Thanks you!

quadro gravatar imagequadro ( 2017-06-22 12:10:01 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-06-22 12:15:53 -0600

berak gravatar image

updated 2017-06-22 12:21:51 -0600

try to replace \ with / in the path to calibration file, it probably did not read it. also, the node names are: "camera_matrix" and "dist_coeffs", see here

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-06-22 11:32:36 -0600

Seen: 1,054 times

Last updated: Jun 22 '17