opencvcameracamera-calibration

OpenCV camera calibration is inconsistent


I am trying to calibrate my camera using OpenCV. I am using the following guide:

https://docs.opencv.org/4.8.0/d4/d94/tutorial_camera_calibration.html

However I am finding that the results I get for the camera matrix depend heavily on how far the calibration images are from the camera. Is this supposed to be the case? There doesn’t seem to be any discussion as to how far the images should be from the camera in the guide.

Ultimately I want to use the camera matrix that I get from calibration in a call to solvePnP to get the pose of an object. If the camera matrix depends on the position of the calibration grid then the results of the solvePnP calculation will also depend on that.

What am I missing?


Solution

  • Camera calibration is fundamentally a data fitting procedure, similar to least squares fitting of a line to data. A good fit requires enough quality data to constraint the model well. Otherwise, the smallest amount of noise affects the parameters. I suspect that you get very uncertain results when calibrating with a checkerboard far away, which therefor only covers a small part of the image. A few tips: