A Stereo Calibration Method of Multi-Camera Based on Circular Calibration Board

: In the application of 3D reconstruction of multi-cameras, it is necessary to calibrate the camera used separately, and at the same time carry out multi-stereo calibration, and the calibration accuracy directly affects the effect of the 3D reconstruction of the system. Many researchers focus on the optimization of the calibration algorithm and the improvement of calibration accuracy after obtaining the calibration plate pattern coordinates, ignoring the impact of calibration on the accuracy of the calibration board pattern coordinate extraction. Therefore, this paper proposes a multi-camera stereo calibration method based on circular calibration plate focusing on the extraction of pattern features during the calibration process. This method preforms the acquisition of the subpixel edge acquisition based on Franklin matrix and circular feature extraction of the circular calibration plate pattern collected by the camera, and then combines the Zhang’s calibration method to calibrate the camera. Experimental results show that compared with the traditional calibration method, the method has better calibration effect and calibration accuracy, and the average reprojection error of the multi-camera is reduced by more than 0.006 pixels.


Introduction
Multi-camera calibration is a key step to achieve multi-vision detection and multi-view stereo vision. The following purposes can be achieved through multi-camera calibration, the first is to determine the conversion relationship between the three-dimensional points in the real scene and the pixels in the image, the second is to determine the distortion factor in the camera imaging process for image correction, and the third is to reduce the requirements on the acquisition equipment through calibration technology. Theoretically, the optical axis of multiple cameras needs to be kept parallel or maintain the same tilt angle, which is difficult to achieve in practice. Stereo calibration can calculate the relative posture between multiple cameras, thereby reducing the equipment requirements, which is conducive to the application of multi-eye vision inspection technology in real production.
Camera calibration is to solve the basic parameters of camera imaging and the orientation of the world coordinate system by using the mapping relationship between the three-dimensional object position of the known feature point and the two-dimensional image coordinate according to the geometric model of camera imaging [1]. According to the different solution methods of calibration parameters and reference objects, camera calibration technology is mainly divided into three types: traditional calibration method, self-calibration method and active visual calibration method [2]. The most representative is the Zhang's calibration method with chessboard as the calibration image in the traditional calibration method [3]. The method uses an international chess pattern calibration board as the calibration object, and uses the camera to shoot the calibration object in different directions and different postures for many times. The one-to-one correspondence between the image points and the three-dimensional space points is established to calibrate the camera by extracting the corner points in the calibration object. This method is simple and efficient, is often used in the calibration process. The latest monocular camera calibration algorithm based on improved particle swarm algorithm proposed by Tian et al. effectively overcomes the problem of falling into local optimal solution [4].
In the process of using checkerboard calibration, the accuracy of corner point extraction is greatly affected by noise and image quality, while circular features have strong inhibition of noise and high recognition rate, so circular features play an important role in the visual system. Heikkila et al. [5] firstly proposed the use of a circular pattern as a calibration target, and repeatedly corrected the perspective effect by obtaining the centroid of the circular pattern, realizing the real-time calibration of the camera of the precision 3D vision system. Shan et al. [6] used the Cannny-Zernike combined algorithm to achieve subpixel positioning of the center coordinates of the circle calibration template, and proposed a circle center sorting method based on triangle markers, using the distance between the two solid circles on the diagonal of the solid circle target as a constraint condition, and optimizing the external parameters of the camera with Levenberg-Marquardt (LM), which had good calibration accuracy and degree of automation. In the latest, Chen et al. [7] used computersimulated random speckles as calibration targets, combined with advanced digital image correlation (DIC) algorithms to accurately match the control points of the calibration targets with the corresponding points on the captured calibration images, and realized the accurate extraction of parameters inside and outside the camera.
In view of the influence of the accuracy of the feature extraction of the calibration pattern on the calibration results in the calibration process, this paper uses the circle as the basic pattern of the calibration plate. Firstly, the collected images are preprocessed such as greyscale. At the same time, the single circle in the circular calibration plate image is segmented for subpixel edge detection, and the subpixel circular edge with higher accuracy is obtained [8], and then the characteristic circle center is obtained by using the image moment method, and finally the camera calibration is combined with Zhang Zhengyou calibration method, and the experimental results show that the proposed method has a better calibration effect and accuracy.
This article is organized as follows: Section 2 introduces the imaging model and calibration method of the camera; Section 3 details the image acquisition platform used, explaining the proposed camera calibration method and experimental steps; Section 4 conducts experiments and analyzes the experimental data and obtains experimental results; and finally, in Section 5, the full text is summarized.

Camera Model
In the process of stereoscopic perception, a series of coordinate systems must be constructed as references, usually divided into world coordinate systems, camera coordinate systems, image coordinate systems, and pixel coordinate systems [9], as shown in Figure 1. In Figure 1, O 1 -uv, represents a pixel coordinate system in which u and v represent the theoretical position of a pixel in the image, rather than their true physical position in the image. O c -Z c is called the optical axis, and the point at which O c -Z c is defined to intersect with the image plane represents the "principal point". O 2 -xy represents the physical coordinate system, which truly reflects the actual position of the pixel point, and the coordinate origin is the main point. In order to facilitate the mutual conversion between the pixel coordinate system and the physical coordinate system, the physical coordinate system is usually projected along the O c X c Y c plane along the O c -Z c axis to construct a conversion relationship, as shown in Equation (1), d x , d y denotes the physical size of each pixel. O c -X c Y c Z c represents the camera coordinate system, and the optical center is defined as O c . O c O 2 is the focal length of the camera. The plane in the pixel coordinate system is called the image plane. The projection point of a point P in the image plane is p 1 (x, y) and P(X c , Y c , Z c ) in the camera coordinate system. The conversion relationship between the image coordinate system and the camera coordinate system can be obtained without considering the distortion, such as Equation (2).
The world coordinate system is constructed, in order to accurately describe the position of the camera in space and the position of the object in three-dimensional space, as shown in O w -X w Y w Z w in Figure 1, it can be represented by a rotation matrix R and a translation matrix T, as shown in Equation (3).
The above camera imaging model is an ideal imaging model without external interference. Camera manufacturing, installation and other processes will cause a variety of errors, resulting in a variety of nonlinear distortions of the camera, in practical applications. The nonlinear distortion factors of the camera should be considered in camera calibration to correct the ideal camera imaging model, in order to enable the camera to obtain more accurate calibration results. Considering the lens distortion, there is a certain offset between the actual imaging point and the theoretical imaging point, and the offset in the x and y directions can be expressed by Equation (4), and r 2 The first term on the right side of Equation (4) is radial distortion; The second is centrifugal distortion; k 1 , k 2 , k 3 and p 1 , p 2 are radial and tangential distortion coefficients, respectively. Three radial distortion coefficients k 1 , k 2 , k 3 and two tangential distortion coefficients p 1 , p 2 are obtained by using the least square method, and the maximum likelihood estimation method is used for optimization to make the calibration results more accurate [10].

The Method of Camera Calibration
Camera calibration method are relatively mature technologies in the field of computer vision, and many researchers have achieved remarkable results for decades. Camera calibration technology was first applied to photogrammetry [11]. The camera is calibrated by making connections by means of mathematical parsing. With the prevalence of calibration method based on checkerboard pattern proposed by Zhang et al., many researchers have made many improvements on this basis. He et al. [12] combined with K-SVD sparse dictionary learning to construct sparse dictionary in chessboard image, and update camera changes in time to achieve high precision and high efficiency camera calibration.
Compared with monocular camera calibration, multi-camera calibration requires two or more cameras to share the same coordinate space. The relationship between the two camera coordinates sharing the same object is estimated by epipolar geometry in the process of stereo camera calibration as shown in Figure 2. The imaging coordinates of a point p in space on two camera planes C 1 and C 2 are p 1 and p 2 , we can use the basic relation p 1 Fp 2 = 0 to estimate the basic matrix F. Camera calibration is the most basic part of the visual system. In the case of complex scenes and large amount of computing, the main research content is high precision, high efficiency, high robustness, but also to consider the cost of the calibration process.
Generally, according to the spatial dimension of the calibration target, it can be divided into four categories [13]: calibration based on three-dimensional objects [14], calibration based on two-dimensional plane [3], calibration based on one-dimensional segmentation [15] and zero-dimensional self-calibration method [16]. The method used in this paper is camera calibration using a two-dimensional pattern with flexibility and ease of operation.
The two-dimensional calibration template was originally realized by detecting the square corner points. With the application of circular calibration pattern, Wang et al. [17] proposed the Pascal theorem under the circular calibration template, solved the circular point image by Newton's iteration method, and then converted the absolute quadratic curve constraint into a Pascal line constraint to calibrate the camera internal reference, expanding the application scope of calibration. Xu et al. [18] proposed to use two intersecting coplanar circles as calibration templates, using the theory of two intersecting circles at intersection points on the projection plane and a kernel line geometry to solve the dot image, and linearly determine the internal reference by linearly determining the dot images in three images in different directions of the same pattern.

Proposed Method
This paper focuses on the extraction of calibration pattern of calibration circular calibration plate in the calibration process of multi-camera. After obtaining multiple groups of calibration plate pictures taken by cameras in different positions, after grayscale preprocessing, each circular pattern is divided, and the F matrix is used for sub-pixel edge extraction and circle center feature calculation. Finally, combined with Zhang's calibration method, stereo calibration of multi-camera is carried out. The specific process is as follows in Figure 3.

Image Acquisition and Preprocessing
In this paper, three industrial USB cameras, equipped with IMX317 photosensitive chip, with an imaging size of 1.62 µm × 1.62 µm and a pixel of 1280 × 960, are combined together by 3D printing structural parts as Figure 4.
Three cameras were used to take pictures of different positions of the circular calibration plate at the same time, and multiple calibration plate pictures were obtained, and 16 groups of original images with the best effect were screened out. Then the image is transformed into grayscale, as shown in Figure 5.

Sub-Pixel Circular Edge Detection Based on Franklin Matrix
The accuracy of edge detection of center calibration pattern directly affects the extraction of center, thus affecting the final camera calibration result. In this paper, a sub-pixel image edge detection algorithm based on Franklin moment proposed by Wu et al. is used [19]. According to the polar definition of Franklin moment, it can be seen that Franklin moment are orthogonality and rotation invariance. Because when the image is rotated by an angle ϕ the relationship between the Franklin moment F nm after the image and the Franklin moment F nm before rotation is Equation (5).
It can be concluded from Equation (5) that after an image is rotated, the mode of its Franklin moment will not change, only the phase angle will change. Therefore, using the feature that the image moment characteristics include the parameters of the edge model, the parameters of the edge can be estimated based on the characteristic information of the Franklin moment, so as to realize the precise positioning of the edge [20]. Franklin subpixel edge detection model is shown in Figure 6. In Figure 6, line L, represents the ideal edge, and the unit circle is divided into two gray regions by line L. h is the background gray level, k is the step height (gray difference), and l is the vertical distance of the center of the circle. The two dashed lines ab and cd correspond to the image edge under the conditions of Franklin moments of different orders.
The specific values are given by Equations (16) and (17). ϕ is the included angle between the vertical line segment from the center of the circle to the edge and the X-axis. Figure 6b is obtained by rotating the angle ϕ clockwise from Figure 6a, where lines ab and cd are parallel to the Y-axis.
In Equation (5), when m = 0, F n0 = F n0 ; when n = 1 and m = 1, there is: Let Re[F 11 ] and Im[F 11 ] represent the real part and imaginary part of F 11 , respectively, then we can get: It can be seen from Figure 6b that the rotated image f (x, y) is axisymmetric about x, and it can be obtained: Im F 11 = 0 from Equation (8), can be into Equation (7) to obtain: The rotation angle ϕ can be easily obtained from Equation (9): According to the template in Figure 6a, Franklin moments of each order of the rotated image can be obtained: According to Equations (11)-(15), the expression using parameters can be solved: After the above derivation, the sub-pixel edge detection formula is derived according to Figure 6 after obtaining the key parameters ϕ, l, k [19]: In Equation (20), (x s , y s ) is subpixel coordinates of image edges, (x, y) is the coordinates of the midpoint in Figure 6a. Considering the Franklin template has N × N amplification effect, it can make the positioning more accurate. The definition of edge is as follows: x s y s = x y + lN 2 cos ϕ sin ϕ The size of the template directly affects the results of edge detection. In this paper, the 7 × 7 template for constructing Franklin moments is selected. The conventional algorithm of sub-pixel edge detection based on matrix only uses low-order moments, that is, the distance l is obtained by Equations (16) and (17), the step height k is determined by Equation (18), and the sub-pixel edge is judged according to l > l k and k > k t , where l t and k t are the threshold, and the average value of l and k matrix is obtained. Since the conventional algorithm does not consider the higher order moments, the edge lines detected are coarse, so the following edge determination conditions are used [19]: Since l 1 and l 2 , respectively, represent the low-order and high-order of Franklin moments, this criterion combines the anti-noise characteristics of Franklin low-order moments and the detailed description ability of high-order moments, so the edge location is more accurate [19]. The main steps of calibration image sub-pixel edge detection algorithm are as follows: Firstly, the image is grayed, and each circular calibration pattern in the calibration board is segmented. Finally, the sub-pixel edge extraction of circular calibration pattern is carried out through the above Algorithm 1 as shown in Figure 7.

Circular Feature Center Extraction
After obtaining the contour of the circular feature, the centroid of the feature can be obtained by using the method of image moment, and the moment of order i + j moment is defined as: When i + j = 1, represents the center of mass of the feature, and the horizontal and vertical coordinates of the center of mass are calculated as follows: x = m 10 m 00 , y = m 01 m 00 (24) Substituting Equation (24) into Equation (23) to obtain the centroid coordinates of the feature, that is, the sub-pixel coordinates of the center of the circular feature. As shown in Figure 8, the experiment proves that the accuracy of the center coordinates obtained by this method is higher.

Single Camera Calibration
In the experiment, the circular pattern calibration plate shown in Figure 9 was used, and the self-built multi-camera acquisition platform shown in Figure 4 was used, and the calibration plate with different attitudes and directions was first taken by three cameras at the same time, and a total of 48 photos were obtained from 3 groups. All photos are divided into circular patterns, followed by the process shown in Algorithm 1 for circular subpixel edge extraction and center coordinate calculation, to obtain the coordinate matrix of the calibration pattern in each calibration plate, and finally use the calibration algorithm in the OpenCV library for camera calibration, and obtain the internal reference matrices of the left, middle and right cameras are M l , M m , M r . From the above experimental results, it can be seen that the f u and f v of the three cameras on the left, middle and right are close, and the radial distortion and centrifugal distortion are also small, indicating that the calibration results are accurate.

Multi-Eye Stereo Calibration
After the calibration of the monocular camera, the calibration result is calibrated for multi-eye stereoscopic calibration, that is, to solve the spatial position relationship of each camera in the camera system in the world coordinate system, that is, the rotation vector R and translation matrix T between multiple cameras need to be calculated.
Assuming that there is a point P in the real physical world, its world coordinate is P w , which is represented as P l , P m and P r , respectively, in the image acquisition system designed in this article, that is, in the left-center-right camera coordinate system. After calibrating the three cameras separately, the external reference matrix can be obtained, that is, the rotation vectors R l , R m and R r between the three camera coordinate systems and the world coordinate system, as well as the translation matrix T l , T m and T r . The coordinates of the P-point in the three camera coordinate systems can be expressed as [21,22]:    P l = P l P w + T l P m = P m P w + T m P r = P r P w + T r The left side of the equal sign above represents the coordinate values of the same space point P in different imaging planes. If the intermediate camera coordinate system is set as the main coordinate system, it can be obtained: P m = R ml P l + T ml P m = R mr P r + T mr (26) R ml and T ml represent rotation vector and translational matrix between left and middle camera coordinate systems. R mr and T mr represent the rotation vector and translational matrix between the right and middle camera coordinate systems. It can be deduced from Equation (26): The results obtained in the above formula are the parameters to be solved in stereo calibration.
After the monocular camera calibration, the calibration results are calibrated in multiocular stereo, and the rotation matrix and translation matrix between the three camera coordinate systems can be obtained: From the above stereo calibration results, it can be seen that the left and right cameras are symmetrically distributed, and at the same time have small height error in the Y-axis direction. Similarly, they have good parameters in the Z-axis direction. When imaging symmetrical objects, operations such as subsequent three-dimensional reconstruction can be better performed.

Analysis of Calibration Experiment Results
The mean value of image residual is used to measure the deviation between the original image point and the reprojection point of space point P, to determine the calibration accuracy. Where the total image residual mean is calculated as follows [23]: In Equation (28): x pi ,ŷ pi is the original image point coordinate of space point P; (x PI , y PI ) is the coordinates of the reprojection, the smaller the result in the above equation, the higher the precision of the calibration. Figure 10a shows the results of the method proposed herein by detecting the circular edge of subpixels and then performing camera calibration with the same method using circular calibration plates proposed by Wang et al. [10].
From the comparison results, we can see that the reprojection error of all 16 calibration images is calculated, and the method in this paper has better calibration results. The main reason is that in the recognition process of circular pattern on the calibration image, Franklin moment can be used to extract more fine edge features, so as to obtain more accurate center coordinates. In Figure 10b, taking the intermediate camera calibration results as an example, compared with the most widely used angle point detection and calibration algorithm in the OpenCV library, as well as the latest calibration algorithm optimized by calibration parameters, the camera calibration method based on circular calibration board proposed in this paper has achieved better calibration results in 16 calibration images. The reprojection error of most calibration images is greatly improved compared with the previous two algorithms. It can be seen from the image that the reprojection error of the second, fifth and last calibration images is slightly improved compared with the traditional method, but compared with the algorithm proposed by Tian et al. [4], the calibration effect is not satisfactory. In this paper, all the calibration patterns are re-compared and analyzed and the above three pictures are taken at a large angle. When the algorithm proposed in this paper is used to extract the center of the ellipse, the deviation of the center of the ellipse will be generated, resulting in unsatisfactory calibration results [8]. Therefore, when using the calibration method proposed in this paper, it has good calibration effect in the case of small shooting angles. Table 1 shows the comparison between the camera calibration method proposed in this paper and the traditional calibration method using checkerboard grids, the calibration method optimized by the latest calibration results [4], and the calibration method proposed by Wang et al. [10]. that also uses circular calibration plates. Among them, the left, center and right represent the cameras in the three positions in Figure 4. As can be seen from Table 1, for the three-camera image acquisition platform built in this paper, The method in the table is used to calibrate. From the mean analysis of the calibration results, this paper proposes that the camera calibration method has better results, and the performance on the middle and right cameras is better. Although the calibration result of the left camera is greatly improved compared with the calibration method proposed by Wang et al. [10], it has worse results than the traditional method. The analysis of this reason is consistent with the previous analysis of the calibration results of a single camera. In the shooting process of the calibration image, all the cameras are triggered at the same time. Due to the relationship between the position of the calibration plate, the calibration image obtained by some cameras will have a large angle. A standard circular pattern will become an elliptical image after imaging, thus introducing the eccentricity error, resulting in poor calibration results of some cameras. However, in terms of the calibration results of all cameras, the proposed method has significantly improved the accuracy, and the average reprojection error of three cameras is reduced by more than 0.006 pixels, which verifies the feasibility and superiority of the proposed method.

Conclusions
In this paper, a stereo calibration method for multi-camera based on circular calibration plate is proposed. The method focuses on the high-precision extraction of calibration pattern features in the calibration process. Multiple images of circular calibration plate are collected by self-matching three-camera image acquisition system. The Franklin matrix was used to detect the sub-pixel edge of the circle and extract the center of the characteristic circle. Finally, Zhang's calibration method was used for camera calibration and multiview stereo calibration. The experimental results show that the calibration accuracy of the three cameras is effectively improved compared with the relevant calibration algorithms. Although the effect on the large angle calibration pattern is not superior to the traditional method, but there is better accuracy in the image acquisition platform of the three camera, and the average re-projection error is reduced by more than 0.006 pixels, and a better calibration effect is achieved.

Conflicts of Interest:
The authors declare no conflict of interest.