# Alignment Method of an Axis Based on Camera Calibration in a Rotating Optical Measurement System
## 2 Principle
### Steps to Determine the Rotation Center of the Rotating Optical Measurement System
#### 2.3.1 Calculate the Optical Center of the Camera  
In the traditional camera calibration method based on the pinhole camera model, the camera's internal and external parameters are calculated from feature points with known world coordinates and corresponding image coordinates. The relationship between the camera coordinate system and world coordinate system is described by the rotation matrix \(R\) and translation vector \(T\). \(R\) and \(T\) reflect the spatial position of the camera in the fixed world coordinate system. If the homogeneous coordinates of the points in the world coordinate system \(M=(X_{w},Y_{w},Z_{w},\textbf{1})^{\text{T}}\) and their image coordinates \(m=(u,v,1)^{\text{T}}\) are known, the relationship between \(M=(X_{w},Y_{w},Z_{w},\textbf{1})^{\text{T}}\) and \(m=(u,v,1)^{\text{T}}\) is described as  
\[s\left[\begin{array}{c}u\\ v\\ 1\end{array}\right]=\left[\begin{array}{ccc}f_{x}&\alpha&u_{0}&0\\ 0&f_{y}&v_{0}&0\\ 0&0&1&0\end{array}\right]\left[\begin{array}{cc}\textbf{R}&\textbf{T}\\ 0^{\text{T}}&1\end{array}\right]\left[\begin{array}{c}X_{w}\\ Y_{w}\\ Z_{w}\\ 1\end{array}\right]=\textbf{{A}}\left[\begin{array}{cc}\textbf{R}&\textbf{T} \\ 0^{\text{T}}&1\end{array}\right]\left[\begin{array}{c}X_{w}\\ Y_{w}\\ Z_{w}\\ 1\end{array}\right], \tag{1}\]  
where \(s\) is an arbitrary non-zero scale factor; \(f_{x}\) and \(f_{y}\) are scale factors of the \(u\)-axis and \(v\)-axis, respectively; \(\alpha\) is the skew factor of two image axes; and \((u_{0},v_{0})\) is the principal point of the camera. Rotation matrix \(R\) is an orthogonal unit matrix, \(T\) is a three-dimensional translation vector, and \(A\) is the internal parameter matrix of the camera, defined as  
\[\textbf{{A}}=\left[\begin{array}{ccc}f_{x}&\alpha&u_{0}&0\\ 0&f_{y}&v_{0}&0\\ 0&0&1&0\end{array}\right]\!\!\!. \tag{2}\]  
In [PERSON]'s method [27], the target plane is located on the \(X_{w}\mathcal{O}_{w}Y_{w}\) plane of the world coordinate system, where \(Z_{w}=0\). Equation (1) is simplified as Equation (3),  
Figure 3: The flow chart of the procedure.  
\[sm=\mathbf{H}M, \tag{3}\]  
where \(\mathbf{H}=[h_{1}\ h_{2}\ h_{3}]=\lambda A\ [r_{1}\ r_{2}\ t]\) is a 3\(\times\)3 matrix and \(\lambda\) is a constant. The homography matrix \(\mathbf{H}\) sets up the mapping between the points on the target with the points on the image. Multiple target images with different poses (at least two in theory) are needed to calculate the internal and external parameters of the camera.  
In our calibration, for providing the fixed reference world coordinate system, we keep the target still and rotate the camera to calibrate \(\mathbf{R}\) and \(\mathbf{T}\). Assuming the coordinates of a point are \(M_{c}\) in the camera coordinate system and \(M_{w}\) in the world coordinate system, the relationship between \(M_{c}\) and \(M_{w}\) is connected by the following rigid motion equation:  
\[M_{c}=\mathbf{R}M_{w}+\mathbf{T}. \tag{4}\]  
If \(M_{c}\) is known, \(M_{w}\) can be obtained by Equation (5):  
\[M_{w}=\mathbf{R}^{-1}(M_{c}-\mathbf{T}). \tag{5}\]  
Since the rotation matrix \(\mathbf{R}\) is an orthogonal unit matrix, \(\mathbf{R}^{\rm T}=\mathbf{R}^{-1}\), Equation (5) can be rewritten as  
\[M_{w}=\mathbf{R}^{\rm T}(M_{c}-\mathbf{T}). \tag{6}\]  
The coordinates \((0,0,0)\) of the optical center in camera coordinate system can be mapped to the world coordinate system by Equation (6). The motion trajectory of the optical centers should be a circular arc on the turntable plane when the camera is rotated by the turntable. In practice, with the help of auxiliary coordinate system \(O_{p}\)-\(X_{p}Y_{p}Z_{p}\), Equation (7) is needed to map the optical centers on the plane parallel to \(O_{w}\)-\(Y_{w}Z_{w}\),  
\[M_{w}=\mathbf{R}_{cp}\mathbf{R}^{\rm T}(M_{c}-\mathbf{T}), \tag{7}\]  
where \(\mathbf{R}_{cp}\) is a 3\(\times\)3 rotation matrix, which describes the rotation relationship between the camera coordinate system and auxiliary coordinate system.