Alignment Method of an Axis Based on Camera Calibration in a Rotating Optical Measurement System

The alignment problem of a rotating optical measurement system composed of a charge-coupled device (CCD) camera and a turntable is discussed. The motion trajectory model of the optical center (or projection center in the computer vision) of a camera rotating with the rotating device is established. A method based on camera calibration with a two-dimensional target is proposed to calculate the positions of the optical center when the camera is rotated by the turntable. An auxiliary coordinate system is introduced to adjust the external parameter matrix of the camera to map the optical centers on a special fictitious plane. The center of the turntable and the distance between the optical center and the rotation center can be accurately calculated by the least square planar circle fitting method. Lastly, the coordinates of the rotation center and the optical centers are used to provide guidance for the installation of a camera in a rotation measurement system. Simulations and experiments verify the feasibility of the proposed method.


Introduction
In recent years, an optical measurement method based on the photogrammetry principle [1][2][3] has been developed rapidly because of its high speed, non-contact, high accuracy and flexibility. Optical measurement is one of the effective methods for coordinate measurement, trajectory measurement or surface reconstruction. It is widely used in different fields such as three-dimensional (3D) sensor measurement, panoramic image mosaic, aerospace, virtual reality (VR), augmented reality (AR), industrial manufacturing and so on [4][5][6][7][8][9].
In the large-scale scene or 360-degree annular area measurement, due to the limitation of the field of view (FOV) of the camera, a single lens camera cannot cover the whole measurement range of the target. Therefore, scanning photography [10] is employed, in which a rotating mechanism rotating around a fixed point enables the camera to enlarge the measuring range by acquiring images from multiple angles. Theoretically, adjacent images taken by the camera rotating around its projection center can be matched by a purely projective transformation of their regions of overlap without requiring the three-dimensional shape of the scene [11][12][13]. In order to facilitate calculation and later data fusion, it is crucial to coincide the optical center of the camera with the rotation center of the rotating mechanism in practice for the creation of panoramic images. Here, the optical center of the camera is the origin of the camera coordinate system in the computer vision. It is also called the projection center in many references and corresponds to the first nodal point (or principle node) of the camera lens installed in the same medium. For the close-range applications, the misalignment of the two centers will be introduced into the final results and the images may not be spliced well. For simplicity, in the rest of this article, the "optical center of the camera" is abbreviated as "optical center".
The alignment of a rotating optical measurement system has always been a hot topic in many fields and has aroused the research interest of many researchers. Carlo Tomasi et al. [11] proposed a centering procedure, in which the rotation center was aligned by moving the camera via the translation platform with the help of the transition line of far and nearby targets, and the location accuracy can reach one tenth of a millimeter. Antero Kukko et al. [14] designed special calibration target "cones" to align the optical center with the rotation center to realize the adjustment of the digital camera to a spherical panoramic camera head. The achieved projection center uncertainty was approximated to be about 1 mm. Kauhanen et al. [15] developed a method to find the rotation center based on the camera calibration method, in which a three-dimensional calibration target is employed. The X, Y and Z shifts for the correction of the camera location were obtained by a numerical method. The standard deviation between the projection center and the rotation center after calibration could reach 0.161 mm. On the contrary, in some studies, the relationship between the camera and the rotation mechanism is calculated by the system calibration in advance, and then it is substituted into the final image mosaic [16][17][18]. For instance, Zhang Zuxun et al. [19,20] designed a measuring system named Photo Total Station System (PTSS), within which a metric camera with known internal parameters was rigidly installed on the telescope of the total station to extend the FOV and improve the accuracy. Zhang et al. [21] designed a theodolite-camera (TC) measurement system consisting of a theodolite and a camera for precise measurement at large viewing angles. The total station or theodolite can provide the spatial coordinates of the control points, which can be used to establish the relationship of the camera while rotating. This kind of measurement system needs a complicated calculation process to eliminate the influence of the misalignment between the optical center and the rotation center.
For any rotating optical measurement system, the motion trajectory of the optical center will be a circle centered on the rotation center. If the radius of the circle is equal to 0, it means that the optical center coincides with the rotation center. Otherwise, the optical center is not matched with the rotation center. However, since the imaging system is composed of multiple lenses, it is hard to accurately calculate and determine the real position of the optical center. Therefore, it is a challenge to guarantee a good alignment between the optical center and the rotation center, and any misalignment could affect the subsequent information stitching.
In order to calculate the coordinates of the optical center and rotation center to solve the alignment problem, the idea of camera calibration [22][23][24][25][26] is introduced. In this paper, we propose a method based on Zhang's camera calibration principle [27] to calculate the positions of the optical center in a unified world coordinate system from the external parameters (including translation vector and rotation matrix) of the camera in a rotating optical measurement system composed of a non-metric camera and a general rotating platform. With the rotation of the turntable, a set of external parameter matrices are obtained, from which a series of optical centers can be calculated to find out the rotation center by the least square circle (LSC) fitting method. The optical center and the rotation center provide the guidance for installation of the camera in a rotating measurement system. In order to reduce the fitting complexity and improve the fitting accuracy, we introduce an auxiliary plane coordinate system to map the optical centers on a unified virtual plane before circle fitting. In addition, for reducing the errors, we collect the images when the camera rotates from different positions, and multiple sets of optical centers are calculated simultaneously to obtain multiple fitted circle centers. The weighted algorithm is used to determine the final rotation center. Computer simulations and some experiments verify that the method can guide the installation and adjustment of the rotating optical measurement system. The rest of the paper is organized as follows: Section 2 illustrates the principle of the proposed method. Section 3 shows some simulations to validate the proposed method. Section 4 displays some experimental results to validate the proposed method and discusses the strengths and contributions of the proposed method. Section 5 summarizes this paper.

Principle
In this section, we explain the basic composition of the proposed rotating optical measurement system and the related techniques for finding out the rotation center.

The Composition of the Rotating Optical Measurement System
The established rotating optical measurement system and the calibration unit include a checkerboard target, a camera, servo control units, computer processing units, etc. The schematic diagram of the measurement system is shown in Figure 1a.

Principle
In this section, we explain the basic composition of the proposed rotating optical measurement system and the related techniques for finding out the rotation center.

The Composition of the Rotating Optical Measurement System
The established rotating optical measurement system and the calibration unit include a checkerboard target, a camera, servo control units, computer processing units, etc. The schematic diagram of the measurement system is shown in Figure 1a. In Figure 1a, the camera is placed on the servo control units composing of a rotating platform and two translation platforms perpendicular to each other. The two translation platforms are fixed on the turntable to move the camera for multiple calibrations and final alignment. Or is the rotation axis of the turntable. Oc-XcYcZc is the camera coordinate system, and Ow-XwYwZw is the fixed world coordinate system. We will give the explanations about these coordinate systems in Section 2.2. The checkerboard target is fixed in front of the system for camera calibration. A sequence of the images, which include the whole checkerboard or a part of the checkerboard, will be collected while the camera is rotated by the turntable.

Imaging Model
First, we give an introduction about the imaging model of the rotating optical measurement system. As shown in Figure 1b, Or is the rotating axis, P is a point on the target, and P1 and P2 are its imaging points when the camera is rotated to Position 1 and Position 2. Oc1 and Oc2 are the optical centers for the two shots, respectively. When the optical center coincides with the rotation center, r0. The positions of the rotation center and optical centers can be obtained with our method. They can be used to guide the alignment of the optical center and rotation center by adjusting the distance and direction of the camera movement. The details will be presented in the next sections. In Figure 1a, the camera is placed on the servo control units composing of a rotating platform and two translation platforms perpendicular to each other. The two translation platforms are fixed on the turntable to move the camera for multiple calibrations and final alignment. O r is the rotation axis of the turntable. O c -X c Y c Z c is the camera coordinate system, and O w -X w Y w Z w is the fixed world coordinate system. We will give the explanations about these coordinate systems in Section 2.2. The checkerboard target is fixed in front of the system for camera calibration. A sequence of the images, which include the whole checkerboard or a part of the checkerboard, will be collected while the camera is rotated by the turntable.

Imaging Model
First, we give an introduction about the imaging model of the rotating optical measurement system. As shown in Figure 1b, O r is the rotating axis, P is a point on the target, and P 1 and P 2 are its imaging points when the camera is rotated to Position 1 and Position 2. O c1 and O c2 are the optical centers for the two shots, respectively. O c1 Z c1 and O c2 Z c2 are the optical axis directions of the camera, O i -u i v i (i = 1, 2) are the image coordinate systems, and the origin is O i . The rotating angle between where f is the focal length of the camera. If the optical center deviates from the rotation axis of the turntable, O c1 and O c2 should be on a circle centered on the rotation center; that is, O r O c1 = O r O c2 = r, where r is the radius of the circle. When the optical center coincides with the rotation center, r→0. The positions of the rotation center and optical centers can be obtained with our method. They can be used to guide the alignment of the optical center and rotation center by adjusting the distance and direction of the camera movement. The details will be presented in the next sections.
Theoretically, the sequential positions of the optical centers should be located at the whole circle as evenly as possible when the camera is rotated by the turntable. However, the obtained positions could only be located at a small arc of the circle, because it is almost impossible to provide a very large and circular calibration target. In order to improve the calculation accuracy of the rotation center, the camera is moved to different positions to collect multiple groups of images to obtain multiple sets of optical centers. Only if the turntable plane is parallel to the plane O w -Y w Z w and the optical axis of the camera is perpendicular to the target at each initial position, the motion trajectory of the optical center is on the concentric circular arc parallel to O w -Y w Z w . However, for an actual rotating optical measurement system, the above conditions may not be met in the calibration process, which makes the obtained fitted circles not concentric. For overcoming the problem, we introduced an auxiliary coordinate system, O p -X p Y p Z p . The relationship between O p -X p Y p Z p and O w -X w Y w Z w is depicted in Figure 2. The auxiliary coordinate system helps us map the multiple sets of optical centers to the plane parallel to O w -Y w Z w to find out the rotation center by fitting planar concentric circles.
Ow-XwYwZw is depicted in Figure 2. The auxiliary coordinate system helps us map the multiple sets of optical centers to the plane parallel to Ow-YwZw to find out the rotation center by fitting planar concentric circles.
Here, we emphasize the four coordinate systems used in the calibration for clarity. 1. World Coordinate System Ow-XwYwZw is a right-handed (Xw-Yw-Zw), orthogonal, three-dimensional coordinate system, whose original point Ow is established on the upper left corner of the fixed checkerboard plane; that is, Zw=0 for points on the fixed checkerboard plane. The world coordinate system is selected as reference coordinate system during calibration.

Image Coordinate System
Oi-uivi is an orthogonal coordinate system fixed in the image plane of the camera, where the ui and vi axes are parallel to the upper and side edges of the sensor array, respectively, and the origin Oi is located at the upper left corner of the array. 3. Camera Coordinate System Oci-XciYciZci is a right-handed (Xci-Yci-Zci), orthogonal coordinate system. The origin Oci is located at the camera's optical center, and the Zci axis is perpendicular to the image plane and coincides with the optical axis of the camera. The Xci and Yci axes are parallel to the ui and vi axes of the Oi-uivi, respectively. The plane where Zci =f is the image plane, where f is the principal distance between the optical center and the image plane. 4. Auxiliary Coordinate System Op-XpYpZp is a right-handed (Xp-Yp-Zp), orthogonal coordinate system. Its origin Op is located at the optical center. The plane XpOpZp is a virtual plane, whose axis of Xp and Yp are parallel to that of Yw and Xw in the same direction, respectively, and the axis of Zp is parallel to that of Zw in the opposite direction.  Here, we emphasize the four coordinate systems used in the calibration for clarity.

Steps to Determine the Rotation Center of the Rotating Optical Measurement System
, orthogonal, three-dimensional coordinate system, whose original point O w is established on the upper left corner of the fixed checkerboard plane; that is, Z w = 0 for points on the fixed checkerboard plane. The world coordinate system is selected as reference coordinate system during calibration.

2.
Image Coordinate System O i -u i v i is an orthogonal coordinate system fixed in the image plane of the camera, where the u i and v i axes are parallel to the upper and side edges of the sensor array, respectively, and the origin O i is located at the upper left corner of the array.

3.
Camera Coordinate System O ci -X ci Y ci Z ci is a right-handed (X ci -Y ci -Z ci ), orthogonal coordinate system. The origin O ci is located at the camera's optical center, and the Z ci axis is perpendicular to the image plane and coincides with the optical axis of the camera. The X ci and Y ci axes are parallel to the u i and v i axes of the O i -u i v i , respectively. The plane where Z ci = f is the image plane, where f is the principal distance between the optical center and the image plane.

4.
Auxiliary Coordinate System O p -X p Y p Z p is a right-handed (X p -Y p -Z p ), orthogonal coordinate system. Its origin O p is located at the optical center. The plane X p O p Z p is a virtual plane, whose axis of X p and Y p are parallel to that of Y w and X w in the same direction, respectively, and the axis of Z p is parallel to that of Z w in the opposite direction.

Steps to Determine the Rotation Center of the Rotating Optical Measurement System
The procedure for determining the rotation center of the rotating optical measurement system is divided into three steps. First, we collect images when the camera rotates from different positions (i) and calibrate the internal parameters and external parameters (rotation matrix R and translation vector T) of the camera by Zhang's method. Then we can get the coordinates of the optical centers in the unified world coordinate system. Second, with the help of the auxiliary coordinate system, we calculate the rotation center by the LSC fitting method from the obtained world coordinates of the optical centers. At last, the final rotation center is obtained through a weighted algorithm. The flow chart of the procedure is shown in Figure 3.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 5 of 18 The procedure for determining the rotation center of the rotating optical measurement system is divided into three steps. First, we collect images when the camera rotates from different positions (i) and calibrate the internal parameters and external parameters (rotation matrix R and translation vector T) of the camera by Zhang's method. Then we can get the coordinates of the optical centers in the unified world coordinate system. Second, with the help of the auxiliary coordinate system, we calculate the rotation center by the LSC fitting method from the obtained world coordinates of the optical centers. At last, the final rotation center is obtained through a weighted algorithm. The flow chart of the procedure is shown in Figure 3.

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=(Xw, Yw, Zw, 1) T and their image coordinates m=(u, v, 1) T are known, the relationship between M=(Xw, Yw, Zw, 1) T and m=(u, v, 1) T is described as where s is an arbitrary non-zero scale factor; fx and fy are scale factors of the u-axis and v-axis, respectively; α is the skew factor of two image axes; and (u0, v0) 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 In Zhang's method [27], the target plane is located on the XwOwYw plane of the world coordinate system, where Zw=0. Equation (1) is simplified as Equation (3), 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 , 1) T and their image coordinates m = (u, v, 1) T are known, the relationship between M = (X w , Y w , Z w , 1) T and m = (u, v, 1) T is described as 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; α 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 In Zhang's method [27], the target plane is located on the X w O w Y w plane of the world coordinate system, where Z w = 0. Equation (1) is simplified as Equation (3), where is a 3×3 matrix and λ is a constant. The homography matrix 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 R and 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: If M c is known, M w can be obtained by Equation (5): Since the rotation matrix R is an orthogonal unit matrix, R T = R −1 , Equation (5) can be rewritten as 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 where R cp is a 3×3 rotation matrix, which describes the rotation relationship between the camera coordinate system and auxiliary coordinate system.

Method for Coincidence of the Optical Center and the Rotation Center
Since not enough of the optical centers can be obtained when the camera is rotating at one position, the camera is moved to different positions to collect more images, as shown in Figure 4, where c i (i = 1, 2, 3) represent the three initial positions of the camera. In order to easily move the camera through the translations to align the rotation center, we need c 1 c 2 ⊥c 1 c 3 , c 1 If Mc is known, Mw can be obtained by Equation (5): Since the rotation matrix R is an orthogonal unit matrix, R T = R -1 , Equation (5) can be rewritten as 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 Op-XpYpZp, Equation (7) is needed to map the optical centers on the plane parallel to Ow-YwZw, where Rcp is a 3×3 rotation matrix, which describes the rotation relationship between the camera coordinate system and auxiliary coordinate system.

Method for Coincidence of the Optical Center and the Rotation Center
Since not enough of the optical centers can be obtained when the camera is rotating at one position, the camera is moved to different positions to collect more images, as shown in Figure 4, where ci (i=1,2,3) represent the three initial positions of the camera. In order to easily move the camera through the translations to align the rotation center, we need c1c2⊥c1c3, c1c2∥OwZw, c1c3∥ OwYw.  The LSC fitting [28] is performed to calculate the rotation center, which satisfies that the sum of the squares of the distances between each sample point and the fitting curve must be minimized. Let (y 0 , z 0 ) be the two-dimensional (2D) coordinates of the rotation center and (y j , z j ) (j = 1~N, N is the number of camera rotation) be the 2D coordinates of the optical centers projected onto the Y w O w Z w plane. In order to obtain (y 0 , z 0 ), the objective function is Theoretically, the radius of the fitted circle varies when the camera is moved, but the circle centers should remain unchanged. However, there are deviations among the fitted centers O ri in the actual fitting. The initial rotation center O r is decided by the average of the O ri . We adjust the camera to O r and calibrate the camera again to get a set of new optical centers O' rj , whose average is O' r . The weighted average value of O ri and O' r is taken as the final rotation center O r = (O y , O z ). The calculation formula is as follows: where O ym and O zm represent the coordinates of the fitted circle centers O ri and O' r in the Y w and Z w directions, respectively; m = 1, 2, . . . n+1, where n is the number of the fitted circles. k ym and k zm represent the weighted factors, respectively, which are decided by the variance σ m = (σ ym , σ zm ) of each group of the optical centers by Equations (11) and (12),

Computer Simulation
In order to verify our method, we carried out computer simulations. The simulated camera had the following parameters: f x = f y = 1700.00 pixels, u 0 = 600.00 pixels, v 0 = 500.00 pixels and α = 0. The size of a square of the simulated checkerboard is 14.175 × 14.175 mm. The simulated rotation center in the world coordinate system is O r = (−80.00, −50.00, 900.00) mm. The simulated camera is placed at Cr = (−80.00, −33.31, 852.87) mm, Cg = (−80.00, −5.26, 852.85) mm and Cb = (−80.00, −33.37, 821.75) mm in the world coordinate system and 50.00 mm, 65.00 mm and 80.00 mm away from the rotation center, respectively, as shown in Figure 5.
For each position, 20 pairs of external parameter matrices (R and T) were assigned to simulate the movement of the camera. A total of 60 simulated images "seen" by the camera were substituted into Zhang's method to calculate the internal parameters A and external parameters R and T, from which the positions of the optical centers were obtained. Then 3.5% Gaussian noise was added to affect the coordinates of each pixel of the images; the same operation is performed to calculate A, R and T and the optical centers. The obtained internal parameters in both cases are shown in Table 1. The trajectories of the three groups of the optical centers projected on the Y w O w Z w plane are shown in Figure 6. Figure 6a is the result without noise, and Figure 6b is the result with noise. The fitted circle curves by the LSC fitting method are shown in Figure 7. The fitted centers and radii are shown in Table 2. Appl. Sci. 2020, 10, x FOR PEER REVIEW 8 of 18 For each position, 20 pairs of external parameter matrices (R and T) were assigned to simulate the movement of the camera. A total of 60 simulated images "seen" by the camera were substituted into Zhang's method to calculate the internal parameters A and external parameters R and T, from which the positions of the optical centers were obtained. Then 3.5% Gaussian noise was added to affect the coordinates of each pixel of the images; the same operation is performed to calculate A, R and T and the optical centers. The obtained internal parameters in both cases are shown in Table 1. The trajectories of the three groups of the optical centers projected on the YwOwZw plane are shown in Figure 6. Figure 6a is the result without noise, and Figure 6b is the result with noise. The fitted circle curves by the LSC fitting method are shown in Figure 7. The fitted centers and radii are shown in Table 2.     For each position, 20 pairs of external parameter matrices (R and T) were assigned to simulate the movement of the camera. A total of 60 simulated images "seen" by the camera were substituted into Zhang's method to calculate the internal parameters A and external parameters R and T, from which the positions of the optical centers were obtained. Then 3.5% Gaussian noise was added to affect the coordinates of each pixel of the images; the same operation is performed to calculate A, R and T and the optical centers. The obtained internal parameters in both cases are shown in Table 1. The trajectories of the three groups of the optical centers projected on the YwOwZw plane are shown in Figure 6. Figure 6a is the result without noise, and Figure 6b is the result with noise. The fitted circle curves by the LSC fitting method are shown in Figure 7. The fitted centers and radii are shown in Table 2.      It can be seen from Table 2 that the three circle centers and radii are the same as the setting values without considering noise. When there is 3.5% Gaussian noise, the average of the three circle centers is O r = (−49.98, 900.02) mm, and the errors of the fitted center and radius are less than 0.05 mm and 0.19 mm, respectively. These results confirm that the proposed method can be used to locate the rotation center in the rotating optical measurement system.

Experimental Setting
We carried out experiments to verify our method. The experimental setup is shown in Figure 8a. The rotation control system is composed of a CCD camera (model: Bammer camera TXG50; resolution: 1224 × 1025 pixels) with a 16 mm focus length imaging lens (model: MA1214M-MP), two translation stages (Zolix TSA50-C electric translation platform, with a repositioning precision less than 5 µm; PI-M406, with a repositioning precision of 0.078 µm) and a turntable (Zolix RAP200 electric rotation platform, with a repositioning precision less than 0.005 • ). The translation stages are fixed on the rotation platform, and the camera is fixed on a translation stage. The stepper motor controls the camera to move along the Y w and Z w axes and rotate with the turntable, respectively. During the experiment, the exposure time of the camera is 12,000 µs. The checkerboard image (the size of a square is 14.175 × 14.175 mm) is displayed on an LCD screen (Philips 190V with a resolution of 1440 × 900 pixels; the dot pitch is 0.2835 mm/pixel). The LCD display screen keeps still during the calibration process. Since the LCD display has a completely pure plane and the screen glass is very thin, the refraction phenomenon can be ignored. Of course, a checkerboard target with a higher machining accuracy can also be employed for providing feature points with higher accuracy.

Determination of the Rotation Center
In the experiment, the camera is respectively placed at three different positions, as shown in Figure 4, where c1c2⊥c1c3, c1c2 = c1c3 = 20 mm. At each initial position, the camera is rotated 16 times, for a total of 22.5 degrees with 1.5 degrees per step. Therefore, in total, 48 frame patterns will be

Determination of the Rotation Center
In the experiment, the camera is respectively placed at three different positions, as shown in Figure 4, where c 1 c 2 ⊥c 1 c 3 , c 1 c 2 = c 1 c 3 = 20 mm. At each initial position, the camera is rotated 16 times, for a total of 22.5 degrees with 1.5 degrees per step. Therefore, in total, 48 frame patterns will be captured during the rotation of the turntable and divided into three sets. One set of the patterns is shown in Figure 8b. The screen is placed within the depth of field of the camera lens to avoid the influence of the defocus on the calibration results. The external parameter matrices (R and T) are obtained by Zhang's method, in which the calculated R and T are almost lens-distortion-free. The re-projective pixel error of the calibration results was 0.039 pixels in our experiment.
From the rotation matrices obtained by the calibration, the rotation angles γ ix (j), γ iy (j) and γ iz (j) (i = 1, 2, 3, j = 1, 2, ..., 16) of the X w , Y w and Z w axes of the world coordinate system with respect to the X c , Y c and Z c axes of the camera coordinate system of the initial position can be calculated, respectively. Theoretically, if the optical axis Z c of the camera at initial position is parallel to Z w and the plane O c -X c Z c is parallel to the plane O w -Y w Z w , the rotation angle γ iy (j) should be equal to the actual rotation angle of the turntable, and the rotation angle γ ix (j), γ iz (j) = 0 when the camera is rotated around the Y c axis, as shown in Figure 9a. Three sets of the angle curves are marked with a different color in the figure, where the horizontal axis represents the times of the camera's rotation, which is marked as N = 16(i − 1) + 1~16i. In fact, the rotation angles γ ix (j) and γ iz (j) fluctuate around 0 degree. We use γ' ix (j), γ' iz (j) and γ' iy (j) to express the calculated three rotation angles, respectively, as shown in Figure 9b. If the three angles are used to calculate the optical centers directly, the three fitted centers will not be concentric on the plane O w -Y w Z w . Figure 10a,b shows the projection of optical centers on the plane O w -Y w Z w and the fitted trajectory, respectively. The deviations of the circle centers are large, by which the rotation center can not be found accurately. With the help of the auxiliary coordinate system O p -X p Y p Z p , the optical centers can be mapped on a plane parallel to O w -Y w Z w through the rotation matrix R cp . In R cp , the three rotation angles are ∆γ ix (j) = γ' ix (j) − γ ix (j), ∆γ iy (j) = γ' iy (j) − γ iy (j) and ∆γ iz (j) = γ' iz (j) − γ iz (j). After the angle correction with R cp , the optical centers calculated by Equation (7) are unified to the same world coordinate system.  Three sets of the optical centers and the fitted circular arcs with different radii on the O w -Y w Z w plane are shown in Figure 11a Table 3. The average value of the three fitted centers is O r = (−55.20, 961.67) mm, which is regarded as the initial value of the rotation center.
(a) (b) Figure 10. (a) Projection of the optical centers on the YwOwZw plane; (b) fitted circular curve (red*, green* and blue* are the fitted centers of the three fitted curves marked by c1, c2 and c3, respectively).
Three sets of the optical centers and the fitted circular arcs with different radii on the Ow-YwZw plane are shown in Figure 11a,b. Employing the optical center coordinates, the distance among c1, c2 and c3 are calculated, c1c2 = 20.16 mm and c1c3 = 20.08 mm. The errors of the distance are 0.78% and 0.42%, respectively. The fitting results and the root mean square error (RMSE) of the three groups are displayed in Table 3. The average value of the three fitted centers isOr = (-55.20, 961.67) mm, which is regarded as the initial value of the rotation center.  In order to obtain a more accurate rotation center, we adjusted the camera toOr, employing the translation stages along the Yw and Zw directions, respectively, and rotated the camera 16 times to calculate the optical centers O'rj, which are distributed over a small range, as shown in Figure 12 Table 4. It is obvious that Or is more reliable thanOr. These results indicate that the camera's optical center has been positioned accurately with the rotation center of the turntable and the systematic uncertainty in our method remains about 0.1 mm.  In order to obtain a more accurate rotation center, we adjusted the camera to O r , employing the translation stages along the Y w and Z w directions, respectively, and rotated the camera 16 times to calculate the optical centers O' rj , which are distributed over a small range, as shown in Figure 12 Table 4. It is obvious that O r is more reliable than O r . These results indicate that the camera's optical center has been positioned accurately with the rotation center of the turntable and the systematic uncertainty in our method remains about 0.1 mm. calculate the optical centers O'rj, which are distributed over a small range, as shown in Figure 12. The average value of O'rj is O'r = (-54.59, 962.05) mm. The final rotation center Or is calculated by employing Or1, Or2, Or3 and O'r using Equations (9)- (12), where Or = (-54.69, 961.96) mm. The camera is moved to Or and rotated 16 times to calculate the optical centers O''rj. The standard deviation (STD) of O'rj relative toOr and O''rj relative to Or in the Yw and Zw directions are shown in Table 4. It is obvious that Or is more reliable thanOr. These results indicate that the camera's optical center has been positioned accurately with the rotation center of the turntable and the systematic uncertainty in our method remains about 0.1 mm.

Verification
Two experiments are designed to prove whether the optical center is aligned with the rotation center by our method after the camera has fixed the position O r .

Calculating the Angle Formed by the Two Space Points M 1 , M 2 and the Optical Center
In the experiment, we calculated the angle α formed by the two space points M 1 , M 2 and the optical center, as shown in Figure 13. When the optical center coincides with the rotation center, the angle α shall remain unchangeable when the camera is rotated. However, when the optical center does not coincide with the rotation center, the angle will change with the rotation of the camera on the turntable; that is, α 1 α 2 .

Verification
Two experiments are designed to prove whether the optical center is aligned with the rotation center by our method after the camera has fixed the position Or. In the experiment, we calculated the angle α formed by the two space points M1, M2 and the optical center, as shown in Figure 13. When the optical center coincides with the rotation center, the angle α shall remain unchangeable when the camera is rotated. However, when the optical center does not coincide with the rotation center, the angle will change with the rotation of the camera on the turntable; that is, α1 ≠ α2. In the experiment, the four points pairs with different positions on the checkerboard plane are selected to calculate the angle αk (k=1~4) and marked as a red circle, green triangle, pink diamond and blue square, as shown in Figure 14. Sixteen angles αk (j) (j=1, 2, ..., 16) are calculated when camera is rotated under the condition of the coaxial; the four angle curves are shown in Figure 15a and the four difference curves of the adjacent angles are shown in Figure 15b. We moved the camera away from the rotation center; the calculated angle curves are shown in Figure 15c and the four difference curves of the adjacent angles are shown in Figure 15d. The standard deviation of the four sets of angles in both cases are shown in Table 5. It can be seen from Figure 15 and Table 5 that the In the experiment, the four points pairs with different positions on the checkerboard plane are selected to calculate the angle α k (k = 1~4) and marked as a red circle, green triangle, pink diamond and blue square, as shown in Figure 14. Sixteen angles α k (j) (j = 1, 2, . . . , 16) are calculated when camera is rotated under the condition of the coaxial; the four angle curves are shown in Figure 15a and the four difference curves of the adjacent angles are shown in Figure 15b. We moved the camera away from the rotation center; the calculated angle curves are shown in Figure 15c and the four difference curves of the adjacent angles are shown in Figure 15d. The standard deviation of the four sets of angles in both cases are shown in Table 5. It can be seen from Figure 15 and Table 5 that the angles α k of the four groups of marker points in the coaxial are basically unchanged, and the standard deviation of the angles in the coaxial is obviously smaller than that in the off-axis. It indicates that the optical center coincides with the rotation center of the turntable.      In the experiment, we compared the camera coordinates of the spatial points on the target before and after camera rotation. Employing the imaging model, as shown in Figure 1b, the coordinates of spatial point P are (X cl , Y cl , Z cl ) and (X cr , Y cr , Z cr ) in camera coordinate system O c1 -X c1 Y c1 Z c1 and O c2 -X c2 Y c2 Z c2 , respectively. If the plane O c -X c Z c is parallel to plane O w -Y w Z w , when the optical center coincides with the rotation center, the relationship between (X cl , Y cl , Z cl ) and (X cr , Y cr , Z cr ) is expressed by Equation (13), where , and θ is the rotation angle of the turntable.
Otherwise, if the optical center deviates from the rotation center, the relationship between (X cl , Y cl , Z cl ) and (X cr , Y cr , Z cr ) should be expressed by Equation (14), where T is the translation vector between O c1 -X c1 Y c1 Z c1 and O c2 -X c2 Y c2 Z c2 . We shot the checkerboard images when the camera is rotated by the turntable with a different rotation angle θ i and extracted checkerboard corners as marked points. Employing their homogeneous coordinates (X wi , Y wi , Z wi , 1) T in the world coordinate system, image coordinates (u i , v i , 1) T , and the internal parameter matrix A, the rotation matrix R i and translation vector T i between the world coordinate system and the camera coordinate system at different position can be obtained from Equation (1). Then the coordinates (X ci , Y ci , Z ci , 1) T of the marked points can be calculated by Equation (15), Assume that (X cl , Y cl , Z cl ) and (X cr , Y cr , Z cr ) stand for the original coordinates and the coordinates after camera rotation of a spatial point, respectively. The coordinates (X' cl , Y' cl , Z' cl ) stands for the resulted coordinates calculated by Equation (13) from the coordinates (X cr , Y cr , Z cr ). We can compare (X' cl , Y' cl , Z' cl ) with the original coordinates (X cl , Y cl , Z cl ). If they are equal, it is proved that the optical center coincides with the rotation center; otherwise, it is indicated that the optical center of the camera deviates from the center of the turntable.
We first align the optical center with the rotation center by our proposed method. The camera captures the target images when the turntable rotates 0 • , 6 • , 9 • and 12 • , respectively, as shown in Figure 16. The original position of the camera corresponds to 0 • . The coordinates (X cl , Y cl , Z cl ) and (X cri , Y cri , Z cri ) (i = 1, 2, 3) of the marked points are calculated, respectively. Employing Equation (13), (X' cli , Y' cli , Z' cli ) can be calculated by multiplying the corresponding rotation matrix R θi . Comparing them with the coordinates (X cl , Y cl , Z cl ), we can see that the coordinates coincide accurately, as shown in Figure 17, where the original coordinates (X cl , Y cl , Z cl ) are marked as red "+" and the resulted coordinates (X' cli , Y' cli , Z' cli ) are marked as blue "o"; the circular zones are the enlarged parts. The standard deviation in the X c and Y c directions are shown in Table 6.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 16 of 18 coordinates (X'cli, Y'cli, Z'cli) are marked as blue "o"; the circular zones are the enlarged parts. The standard deviation in the Xc and Yc directions are shown in Table 6. We deviated the optical center from the rotation center and repeated the above steps. The captured target images are shown in Figure 18. When Ri acts on the coordinates (Xcri, Ycri, Zcri) (i =1,2,3) of the marked points, there is a significant deviation, as shown in Figure 19. The standard deviation in the Xc and Yc directions are shown in Table 6.  coordinates (X'cli, Y'cli, Z'cli) are marked as blue "o"; the circular zones are the enlarged parts. The standard deviation in the Xc and Yc directions are shown in Table 6.
(a) (b) (c) (d) We deviated the optical center from the rotation center and repeated the above steps. The captured target images are shown in Figure 18. When Ri acts on the coordinates (Xcri, Ycri, Zcri) (i =1,2,3) of the marked points, there is a significant deviation, as shown in Figure 19. The standard deviation in the Xc and Yc directions are shown in Table 6.   We deviated the optical center from the rotation center and repeated the above steps. The captured target images are shown in Figure 18. When R θi acts on the coordinates (X cri , Y cri , Z cri ) (i = 1, 2, 3) of the marked points, there is a significant deviation, as shown in Figure 19. The standard deviation in the X c and Y c directions are shown in Table 6.  Table 6. We deviated the optical center from the rotation center and repeated the above steps. The captured target images are shown in Figure 18. When Ri acts on the coordinates (Xcri, Ycri, Zcri) (i =1,2,3) of the marked points, there is a significant deviation, as shown in Figure 19. The standard deviation in the Xc and Yc directions are shown in Table 6.  The experiments verify that our method can align the optical center with the rotation center. When the optical center coincides with the rotation center, the extracted marked points coincide with each other when R θi acts on the coordinates after camera rotation, and the alignment errors in the X c and Y c directions are quite small. Otherwise, the deviation in the X c , Y c direction is large. (a) (b) (c) Figure 19. The comparative diagrams of the marked points of (a) 6°; (b) 9°; (c) 12°. Figure 19. The comparative diagrams of the marked points of (a) 6 • ; (b) 9 • ; (c) 12 • .

Conclusions
We propose a method based on camera calibration with a two-dimensional target to solve the problem of the alignment of the camera's optical center and the rotation center in a rotating optical measurement system composed of a camera and a rotating platform. An auxiliary plane coordinate system is introduced to adjust the external parameter matrix of the camera. The rectified external parameter matrix is used to calculate the optical centers in the unified world coordinate system. Multiple fitted circles can determine the rotation center more accurately than a single fitted circle, which will provide a higher precision in the following application, such as a panoramic mosaic. Simulations and experiments verified the effectiveness of the proposed method.
It should be noted that the optical center of the initial position of the camera should be kept at an appropriate distance from the rotation center during calibration to increase the accuracy of the circle fitting. By the way, although this paper only discusses the alignment of the optical center of the camera with a one-dimensional rotating optical system, the proposed method can also be extended in principle to the problem in the alignment of the optical center with the rotating axis of a two-dimensional rotating optical system. However, the current experimental setup is only suitable for the alignment problem of one-dimensional rotating optical systems. In the following work, we will find a device suitable for two-dimensional (pitch and yaw) rotating platforms.