I recently wanted to use AprilCal from the April Robotics Toolkit‘s camera suite for camera calibration but to write my code in OpenCV. I got a bit stuck converting between formats so Andrew Richardson helped me out.
1) Run AprilCal’s calibration.
2) Enter the GUI’s command line mode and export to a bunch of different model formats with
3) Find the file for CaltechCalibration,kclength=3.config which orders the distortion paramters like this: radial_1, radial_2, tangential_1, tangential_2, radial_3.
4) Your OpenCV camera matrix is:
[ fc 0 cc ] M = [ 0 fc cc ] [ 0 0 1 ]
5) Your OpenCV distortion vector is:
kc kc D = lc lc kc