# Iterative Camera Calibration Method Based on Concentric Circle Grids
## 2 Materials and Methods  
### Concentric Circle Center Location Method Based on Cross-Ratio Invariance  
The pinhole camera model is the most commonly used in computer vision, as shown in Figure 1. The relationship between the space point \(\mathbf{P}_{w}(x_{w},y_{w},z_{w})\) in the world coordinate system and the projection point \(\mathbf{P}_{u}(u,v)\) on the image plane can be expressed as follows [28]:  
\[s \begin{bmatrix}u\\ v\\ 1\end{bmatrix} =\mathbf{K}[\mathbf{R}\quad\mathbf{T}] \begin{bmatrix}x_{w}\\ y_{w}\\ z_{w}\\ 1\end{bmatrix} = \begin{bmatrix}f_{u}&0&u_{0}&0\\ 0&f_{v}&v_{0}&0\\ 0&0&1&0\end{bmatrix}\begin{bmatrix}\mathbf{R}&\mathbf{T}\\ \mathbf{0}&\mathbf{1}\end{bmatrix}\begin{bmatrix}x_{w}\\ y_{w}\\ z_{w}\\ 1\end{bmatrix} . \tag{1}\]  
where, \(s\) is a scale factor; \(\mathbf{K}\) is the intrinsic parameter matrix of the camera; \(f_{u}f_{v}\) denote the focal length coordinate of the camera; \((u_{0},v_{0})\) is the principal point coordinate of the camera; and \(\mathbf{R}\) and \(\mathbf{T}\) respectively represent a \(3\times 3\) rotation matrix and a \(3\times 1\) translation vector between the world coordinate system and the camera coordinate system. Figure 1: Pinhole camera model. The coordinate of the feature point on the planar calibration target \(z_{w}=0\), let us use \(r_{i}\) to denote the \(i\)-th column of the rotation matrix \(R\). According to Equation (1), we have:  
\[s \begin{bmatrix}u\\ v\\ 1\end{bmatrix} =\mathbf{K} \begin{bmatrix}r_{1}&r_{2}&r_{3}&\mathbf{T}\end{bmatrix} \begin{bmatrix}x_{w}\\ y_{w}\\ 0\\ 1\end{bmatrix} =\mathbf{K} \begin{bmatrix}r_{1}&r_{2}&\mathbf{T}\end{bmatrix} \begin{bmatrix}x_{w}\\ y_{w}\\ 1\end{bmatrix} . \tag{2}\]  
Therefore, Equation (2) can be expressed as:  
\[s \begin{bmatrix}u\\ v\\ 1\end{bmatrix} =\mathbf{H} \begin{bmatrix}x_{w}\\ y_{w}\\ 1\end{bmatrix} = \begin{bmatrix}h_{11}&h_{12}&h_{13}\\ h_{21}&h_{22}&h_{23}\\ h_{31}&h_{32}&h_{33}\end{bmatrix} ^{-1} \begin{bmatrix}x_{w}\\ y_{w}\\ 1\end{bmatrix} . \tag{3}\]  
where, \(\mathbf{H}\) is a homography matrix, \(\mathbf{H}=\mathbf{K} \begin{bmatrix}r_{1}&\mathbf{r}_{2}&\mathbf{T}\end{bmatrix} \). On the planar target, let the circle center be at the origin of the world coordinate system and \(r\) be the radius. Then, the circle can be represented in the matrix form as:  
\[\mathbf{C}= \begin{bmatrix}1&0&0\\ 0&1&0\\ 0&0&-r^{2}\end{bmatrix}  \tag{4}\]  
In the perspective projection, the circle is imaged into an ellipse, we have:  
\[s\mathbf{E}=\mathbf{H}^{-\mathrm{T}}\mathbf{C}\mathbf{H}^{-1}. \tag{5}\]  
where, \(\mathbf{E}= \begin{bmatrix}A&C/2&D/2\\ C/2&B&E/2\\ D/2&E/2&F\end{bmatrix} \) is the conic coefficient matrix of the ellipse. According to Equations (3)-(5), the parameters of the conic coefficient matrix can be obtained:  
\[A ={h_{11}}^{2}+{h_{21}}^{2}-{h_{31}}^{2}r^{2} \tag{6}\] \[B ={h_{12}}^{2}+{h_{22}}^{2}-{h_{32}}^{2}r^{2}\] \[C =2\big{(}h_{11}h_{12}+h_{21}h_{22}-h_{31}h_{32}r^{2}\big{)}\] \[D =2\big{(}h_{11}h_{13}+h_{21}h_{23}-h_{31}h_{33}r^{2}\big{)}\] \[E =2\big{(}h_{12}h_{13}+h_{22}h_{23}-h_{32}h_{33}r^{2}\big{)}\] \[F ={h_{13}}^{2}+{h_{23}}^{2}-{h_{33}}^{2}r^{2}\]  
And the ellipse center \(\big{(}e_{x},e_{y}\big{)}\) is:  
\[e_{x} =\left(CE-2 BD\right)/\big{(}4 AB-C^{2}\big{)}=\left(m_{1}r^{2}+n_{ 1}\right)/\left(mr^{2}+n\right) \tag{7}\] \[e_{y} =\left(CD-2 AE\right)/\big{(}4 AB-C^{2}\big{)}=\left(m_{2}r^{2}+n_{ 2}\right)/\left(mr^{2}+n\right)\]  
The factors \(m,m_{1},m_{2},n,n_{1},n_{2}\) can be calculated with the parameters in the homography matrix \(\mathbf{H}\). When \(r\) is set to \(0\), let \(\big{(}c_{x},c_{y}\big{)}\) be the imaged circle center. The slope \(k\) of the straight line determined by \(\big{(}e_{x},e_{y}\big{)}\) and \(\big{(}c_{x},c_{y}\big{)}\) can be calculated as follows:  
\[k=\frac{e_{y}-c_{y}}{e_{x}-c_{x}}=\frac{m_{2}n-n_{2}m}{m_{1}n-n_{1}m} \tag{8}\]  
In Equation (8), \(k\) is a constant that is not related to the radii of the circle.