# Iterative Camera Calibration Method Based on Concentric Circle Grids
## 2 Materials and Methods
### Iterative Camera Calibration Algorithm Considering Lens Distortion  
In camera calibration, the existence of lens distortion leads to the projection of a circle as a distorted ellipse, rather than a true ellipse. The center of the distorted ellipse, determined by fitting the boundary points with an ellipse, may vary from the center of the perspective ellipse. As shown in Figure 4, the distorted ellipse differs significantly from the perspective ellipse. Consequently, \(\mathbf{P}_{u}\) does not coincide with the actual projection \(\mathbf{\hat{P}}_{u}\) of the concentric circle center. The distorted image coordinate of the feature point on the normalized plane can be expressed as:  
\[\left\{ \begin{array}{l}x_{d}=x_{c}+x_{c}\big{(}k_{1}r_{c}^{2}+k_{2}r_{c}^{4} \big{)}+2P_{1}x_{c}y_{c}+P_{2}\big{(}r_{c}^{2}+2x_{c}^{2}\big{)}\\ y_{d}=y_{c}+y_{c}\big{(}k_{1}r_{c}^{2}+k_{2}r_{c}^{4}\big{)}+P_{1}\big{(}r_{c}^ {2}+2y_{c}^{2}\big{)}+2P_{2}x_{c}y_{c}\end{array} \right. \tag{11}\]  
where \((x_{c},y_{c})\) are the undistorted image coordinate of the feature point; \(k_{1},k_{2}\) are the radial distortion coefficients; \(P_{1}\), \(P_{2}\) are the tangential distortion coefficients; \(r_{c}^{2}=x_{c}^{2}+y_{c}^{2}\) is the distance between the image point and the principal point. Figure 4: Difference between distorted ellipse and perspective ellipse. \((x_{c},y_{c})\) can be calculated using:  
\[\lambda \begin{bmatrix}x_{c}\\ y_{c}\\ 1\end{bmatrix} = \begin{bmatrix}\mathbf{R}&\mathbf{T}\end{bmatrix}\begin{bmatrix}x_{w}\\ y_{w}\\ z_{w}\\ 1\end{bmatrix}  \tag{12}\]  
Then, the real camera model can be expressed by:  
\[ \begin{bmatrix}u\\ v\\ 1\end{bmatrix} =\mathbf{K} \begin{bmatrix}x_{d}\\ y_{d}\\ 1\end{bmatrix} . \tag{13}\]  
The Zhang calibration method involves obtaining the camera parameters through the minimization of the reprojection constraint:  
\[ \begin{split}\mathbf{J}=\sum_{i=1}^{n}\sum_{j=1}^{m}\Bigl{\|}\mathbf{P}_{u _{ij}}-\mathbf{P}^{\prime}_{u_{ij}}(\mathbf{K},\mathbf{D},\mathbf{R}_{i},\mathbf{T}_{i},\mathbf{P}_{w_{ i}})\Bigr{\|}^{2}.\end{split}  \tag{14}\]  
where \(\mathbf{P}_{u_{ij}}\) is the imaged center of the \(j\)-th feature point on the \(i\)-th calibration image, \(i=1,2,\ldots,n,j=1,2,\ldots,m\); \(\mathbf{P}^{\prime}_{u_{ij}}(\mathbf{K},\mathbf{D},\mathbf{R}_{i},\mathbf{T}_{i},\mathbf{P}_{w_{i}})\) is the projection of the concentric circle center \(\mathbf{P}_{w_{ij}}\); and \(\mathbf{D}\) represents the distortion coefficients. The intrinsic and extrinsic parameters of the camera are first obtained by calculating the homography matrix \(\mathbf{H}\) of several calibration images and the Levenberg-Marquardt optimization algorithm is used to solve Equation (14). This section presents a method for iteratively adjusting the calibration parameters. Give the radius \(r_{in}\), \(r_{out}\) and the center \(\mathbf{P}_{w_{i}}\) of the concentric circle. The calibration consists of the following steps:  
Step 1: Calculate the imaged concentric circle center \(\mathbf{P}_{u_{ij}}\) and by Equation (10) and exploit the correspondence between \(\mathbf{P}_{u_{ij}}\) and \(\mathbf{P}_{w_{i}}\). According to the Zhang calibration method [28], the initial camera parameters \(\mathbf{K}^{(0)},\mathbf{D}^{(0)}\) are determined. Step 2: Select \(k\) uniformly distributed points on each circle and calculate the projection points. Step 3: Fit the ellipse by using the projection points that belong to the same circle and obtain the fitted concentric circle center \(\left(u^{f}_{ij},\
u^{f}_{ij}\right)\) according to Equation (10). Meanwhile, the projection imaged center \(\left(u^{p}_{ij},\
u^{p}_{ij}\right)\) of \(\mathbf{P}_{w_{i}}\) is calculated using Equations (11)-(13). Step 4: Calculate the position deviation \(\left(\Delta u_{ij},\Delta v_{ij}\right)\) between \(\left(u^{f}_{ij},\
u^{f}_{ij}\right)\) and \(\left(u^{p}_{ij},\
u^{p}_{ij}\right)\), and compensate for \(\mathbf{P}_{u_{ij}}\).