Camera calibration field of view

Hi everyone,
I am using this code to calibrate camera to compensate for massive barrel distortion of my camera (it’s Boson Flir thermal camera).

It works fine, but the problem is that it reduces the field of view significantly. Is this normal, or is it a problem of my calibration data set? Say, that in my case, the checkerboard pattern isn’t ever close enough to the edges? Not sure if that would result in smaller FOV or just inaccurate results near the edges…

Either way, is there something I can do to have larger FOV? I don’t need the data to be accurate near the boundaries, but it would still be useful to have at least something…

Thanks
Jan

Having calibration points close to the edges/corners of your image will improve the accuracy in that area, but it shouldn’t reduce reduce your FOV. To get a larger FOV in your undistorted image you might want to look into getOptimalNewCameraMatrix() - the result of this gets used in cv::undistort() or initUndistortRectifyMap() as the newCameraMatrix parameter.

You mention that your lens is highly distorted. In my experience the getOptimalNewCameraMatrix() doesn’t always behave well with high distortion lenses, particularly if the input to calibration doesn’t extend into the corners. By varying the alpha parameter to getOptimalNewCameraMatrix you control how much of the original image gets displayed in the output image - the trade-off is that not all pixels in your output image will have data to fill them, so they will be black. For example, see this post with a full-size undistorted image:

One thing you might try if you haven’t is using an Charuco (chessboard + aruco codes) calibration target as it can handle images where the full target isn’t visible. This makes it much easier to get points that extend into the corners of the image.

1 Like

Hi Steve,
thanks for the suggestions. Will give it a try.

Hi, you’re right. With alpha == 1.0, the picture looks nowhere near to what is displayed on those images you linked. In my (high-distortion) case the edges wrap together creating a sort of self-folded blob.

Anyway, I was able to get a better result with alpha == 0.2. The FOV is larger and the picture is still usable. That said, the OP is answered. Thanks a lot.

Jan

Yes - the folded blob issue is real. Getting more calibration points near the edge of the image will help with that (again, the Charuco calibration target makes this easy because you don’t have to see the full target) I have achieved the best results with the CALIB_RATIONAL_MODEL flag, so if you are using the 5 parameter model you might do better with the rational (8 parameter) model.

Good luck.

I see your point, but I don’t think that would work well in my case. As mentioned in the OP, this is a thermal camera and having a visible chessboard alone with enough contrast is difficult enough as it is and requires 2 or 3 people to operate. One to manipulate the chessboard on a broomstick while making sure to stay out of the picture (because to person would be the hottest - i.e. most white - thing, reducing the contrast), to keep IR light pointed to the chessboard at all times and to manipulate the SW :smiley:

The problem was that the heat tends to dissipate on the chessboard throughout time, so you cannot keep the session too long. Those small aruco markers would most likely not end up having enough contrast.

I will keep this in mind though, and try it in the end if I have some spare time.

Thanks for all the useful info. Either way it’s going to come in handy :slight_smile: