In this repository, we do camera calibration from scratch. For convenience, we will use some opencv libraries when it is nothing to do with camera calibration(e.g. reading images or finding chessboard corners). The purpose of this repository is to know camera calibration better.
The way to find the chessboard corners is not the key part in this repository, so we utilized the function in OpenCV directly.
NOTE: We follow the algorithms and the notations written in chapter 4 in reference [2]. It doesn't optimize the code(may be slow) but keep the order the same as in reference [2].
Camera Number: Monocular only
Camera(Projection) Model: pinhole
Distortion Model: radial distortion
In this repository, we follow the list of symbols and notation defined in table 1 in reference [2] and
always use terms 'model points' and 'sensor points'.
Some other common terms refer to the same things are defined as follows:
- Points in 3D world coordinate: model points, target points, object points
- Points in 2D image(sensor) coordinate: image points, sensor points
Focal Length | Principal Point | Skew | Distortion | Reprojection Error(avg.) |
---|---|---|---|---|
(534.744914, 534.993645) | (342.223774, 232.569257) | 0.598208 | (-0.298821, 0.138997) | 0.143098 |
NOTE: The result will a litte different because of the result of LM algorithm may be different.
If someone wants to improve the result more, the following reference may help:
- Liu, Zhen, et al. "High-accuracy calibration of low-cost camera using image disturbance factor." Optics Express 24.21 (2016): 24321-24336.
- Datta, Ankur, Jun-Sik Kim, and Takeo Kanade. "Accurate camera calibration using iterative refinement of control points." 2009 IEEE 12th International Conference on Computer Vision Workshops, ICCV Workshops. IEEE, 2009.
- Zhang, Zhengyou. "A flexible new technique for camera calibration." IEEE Transactions on pattern analysis and machine intelligence 22.11 (2000): 1330-1334.
- Burger, Wilhelm. "Zhang’s camera calibration algorithm: in-depth tutorial and implementation." HGB16-05 (2016): 1-6.
- How SVD solve the direct linear transformation(DLT) problem for estimating the homography in step 1?
- Basic concepts of the homography explained with code - OpenCV
- CSE/EE486 Computer Vision I, Robert Collins