0
votes

I'm doing fisheye camera calibration with Opencv.
I found object points and image points using chessboard image.
The next step is the function
retval, K, D, rvecs, tvecs = cv.fisheye.calibrate(objectPoints, imagePoints, image_size, K, D)

How to get K (Output 3x3 floating-point camera matrix) and D (Output vector of distortion coefficients)? As far as I understand it this function returns these parameters (K and D) but it also asks to pass it as arguments.

1
have a look at the accepted answer to this questionDrBwts
I know this code (it's from Medium . com). There is a lot of strange things in this code, authour doesn't give explanations ("You don’t really need to know what K and D ") so I do not consider it as a valide examplePantemak Savours
you'll notice that K & D are passed as matrices initialized to 0. You dont need to know them before but you do need to pass placeholder for them . Please read the code carefully.DrBwts
And in undistort function should I pass matrices initialized to 0? I see in the code they rewrite it even though they got it from cv.fisheye.calibrate.Pantemak Savours

1 Answers

0
votes

According to OpenCV Documentation, K can be used as an optional initial guess for the camera matrix, if the option is enabled (documentation explains how to do it). Seems you don't have to do it. Distortion (D) is only an output array.