Camera calibration - RobinAmsters/benchmarking GitHub Wiki

Pinhole camera's typically have a certain degree of radial and tangential distortion, which makes lines which are straigth in real life, appear curved on an image. The effect typically gets worse when approaching the edge of the image. These effects influence the accuracy of object tracking. To counteract this, the camera first needs to be calibrated. The calibrate_camera script calculates the calibration parameters based on images of a checkerboard pattern. Example images are provided to demonstrate the working of the file in the example_data folder. When using your own images, pay attention to the following points:

  • Make sure you adjust the cbrow and cbcol parameters according to the rows and colums of your own checkerboard pattern, respectively.
  • Measure the square size and change the square_size variable if neccesary.
  • Use at least 10 (good) images of your checkerboard pattern. More images can provide better results, but only up to a certain point. A good rule of thumb is to take 15 calibration pictures. Be sure to change the orientation of the checkerboard and to calibrate at the heigth of the object you later want to track.
  • Do not change the camera position during or after calibration.
  • Check the reprojection error (should be as close to zero as possible, but aim for at least lower than 0.2)

For more detailed information, please visit the OpenCV documentation.