{'fraction_non_alphanumeric': 0.028332433890987586, 'fraction_numerical': 0.013716495772620975, 'mean_word_length': 4.3907878787878785, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A flexible calibration method for laser displacement sensors based on a stereo-target

Laser displacement sensors (LDSs) are widely used in online measurement owing to their characteristics of non-contact, high measurement speed, etc. However, existing calibration methods for LDSs based on the traditional triangulation measurement model are time-consuming and tedious to operate. In this paper, a calibration method for LDSs based on a vision measurement model of the LDS is presented. According to the constraint relationships of the model parameters, the calibration is implemented by freely moving a stereo-target at least twice in the field of view of the LDS. Both simulation analyses and real experiments were conducted. Experimental results demonstrate that the calibration method achieves an accuracy of 0.044 mm within the measurement range of about 150 mm. Compared to traditional calibration methods, the proposed method has no special limitation on the relative position of the LDS and the target. The linearity approximation of the measurement model in the calibration is not needed, and thus the measurement range is not limited in the linearity range. It is easy and quick to implement the calibration for the LDS. The method can be applied in wider fields.


Introduction
A laser displacement sensor (LDS) is a photoelectric displacement-measuring system with a linear array photoelectrical detector and a dot laser as the main measurement components. Owing to its characteristics of non-contact, high measurement speed and high resolution, the LDS finds wider application in real-time measurement fields such as wheel parameters measurement [1,2], high-dynamic angle measurement [3], vibrational stress measurement [4], in situ flaw detection [5] and so on. Before the LDS is put to use, we need to obtain the precise mapping relationship between the input and output variables of the LDS. Accordingly, an effective and convenient calibration method for the LDS is an important precondition for guaranteeing the measurement precision of the LDS, and thus expanding the application range of the LDS.
The LDS, as a kind of dot-structured light-vision measurement system, can only obtain one-dimensional imaging information. As a result, various calibration methods [6][7][8] for line-structured light-vision measurement systems can no longer be used for the LDS. Currently, most calibration methods for the LDS are based on a triangulation measurement model [9], which is established according to the geometric position relationship of the components of the LDS. For example, Zhang [10] had achieved the calibration for the LDS by determining the displacement shift quantity with a laser interferometer and then calculating the mean sensitivity and linearity error of the LDS. Similarly, Xie et al [11] had calibrated the error-compensation curve for the LDS using the data obtained by an automatic interference comparator. However, the corresponding calibration system is complicated, and its cost is high. The calibration device and the calibrated LDS need to be fixed precisely so that the moving direction of the worktable can stay parallel with the optical axis of the laser interferometer. Another calibration method for the LDS is to fit a calibration curve with the original data obtained and couple it with a linearity approximation in a small measurement range [12,13]. The calibrated LDS can realize linear measurement in a small range. However, the application range of this calibration method is limited. As the non-linearity errors introduced by the linearization influence the measurement accuracy of the LDS, the method is only suitable for the LDS with a small non-linearity degree [14,15]. In addition, Mai et al [16] had calibrated the LDS by the BP neural network method because the neural network has a good self-teaching ability, and can effectively deal with complicated nonlinear mapping, whereas longer learning processes of the neural network cannot satisfy our need for quick calibration of the LDS. Recently, Sun et al [17] had developed a vision-measurement model for the LDS and calibrated the LDS by using a planar target and a 2D moving platform. The linearization was avoided and the calibration accuracy proved to be high enough, but the calibration process was still limited by the 2D moving platform. Therefore, it is not convenient to be applied in field conditions.
In this paper, a novel calibration method based on an extended vision-measurement model of the LDS is proposed. The LDS can be calibrated by randomly moving a stereo-target at least twice, capturing an image at each position and then recovering the model parameters according to their constraint relationships. There is no special limitation on the relative position of the calibrated LDS and the target, so that the calibration points can be obtained easily. In addition, the measurement model is not required to be linearized in a small measurement range in the calibration. The calibration for the LDS can be implemented quickly, and thus the method is suitable for wider application fields.
The rest of the paper is organized as follows: section 2 describes the extended vision-measurement model of the LDS and section 3 details the calibration principle. Simulation analyses and real experiments are shown in section 4 to verify the feasibility and stability of the calibration method. Last, conclusions are given in section 5.

The vision-measurement model of LDSs
The vision-measurement model contains the imaging model of a linear-array photoelectric detector, a vision-plane model, a laser-line model and a lens-distortion model. The internal light path of the LDS satisfies the Scieimpflug condition [18] so that the measured point can be focused clearly on the linear-array photoelectric detector in a certain depth of field. The model is illustrated in figure 1. The plane determined by the imaging line of the linear array photoelectric detector and the laser line is defined as the vision plane. All the imaging processes in the LDS are conducted in the vision plane. o w -x w y w z w is the global coordinate system. o c -x c y c z c is the sensor-coordinate system, where o c is the optical center of the linear-array photoelectric detector and o c z c is the optical axis. Plane y c o c z c overlaps with the vision plane of the LDS. o u -u is defined as the imaging-coordinate system of the linear photoelectric detector. It is parallel with the axis o c y c and overlaps with the imaging line of the linear-array photoelectric detector. The intersection point P of the laser line and the surface of the measured object is the measured point that is mapped to the image point p.
It is assumed that the homogeneous coordinates of the measured point P in the sensor-coordinate system and the global coordinate system are P c (x c , y c , z c , 1) T and P w (x w , y w , z w , 1) T , respectively. The homogeneous coordinates of its image point p in the imaging-coordinate system is p(u, 1). According to the perspective projection principle, the measured point P c and its image point p satisfy where ρ (ρ ≠ 0) is an arbitrary scale factor and A= is defined as an intrinsic parameters matrix of the LDS, with α y the focal length and u 0 the coordinate of the principal point. The transformation relationship between the global coordinate system and the camera coordinate system can be expressed as  (1) and (2), the perspective projection relationship of the measured point in the global coordinate system can be expressed as Note that only when the measured point P lies on the vision plane can it image to the linear-array photoel ectric detector. Without loss of generality, the equation of the vision plane in the global coordinate system is defined as where a, b and c are the vision-plane parameters.
With the constraint of the vision plane, the projection relationship of the LDS are further simplified as In order to separate the intrinsic and extrinsic parameters, the mapping relationship can be rewritten as Simultaneously, as the plane y c o c z c overlaps with the vision plane of the LDS, the measured point P in the global coordinate system satisfies Recall from (4) that we have = − − − r r r t a b c : : : 1: : : . 11 Furthermore, the measured point P lies on the laser line. Without loss of generality, the laser line equation in the global coordinate system is assumed as where vector Laser = (x 0 , y 0 , z 0 , m, n, q) is defined as the parameters vector of the laser line. The imaging relationships of the LDS deduced are ideal in the absence of lens distortion. In fact, like other imaging devices, the LDS exhibits radial and tangential distortion in lens as well. Since the tangential distortion is expected to be small, only the first two terms of the radial distortion are considered. The distance between the optical center of the lens and the imaging line of the LDS is fixed, and the impact of the lens distortion on the image coordinate along the imaging line is only concerned, so the lens distortion model of the LDS [17] can be expressed as where u is the ideal image coordinate in pixels, x is the ideal normalized image coordinate, uʹ is the real image coordinate in pixels, u 0 is the coordinate of the principle point in pixels and y a is the distance between the optical center of the lens and the imaging line of the LDS -which is expected to be small generally. k 1 and k 2 are the radial distortion coefficients. Relating (4), (6), (9) and (10), we have the vision-measurement model with the intrinsic parameters (including α y , u 0 , a, b, c, m, n, q, x 0 , y 0 , z 0 , y a , k 1 , and k 2 ) and the extrinsic parameters (including the rotation matrix R and the transition vector T). When the 1D coordinate u is known, the 3D coordinates of the measured point can be determined and the displacement of the measured object in the direction of the laser line can be obtained.

Calibration principle of LDSs
The calibration principle of the LDS, based on the vision-measurement model, is illustrated in figure 2.
is the local coordinate system. The axes o i y i and o i z i overlap with the two bottom edges of the stereo-target. The stereo-target with marked lines and the calibration points that needed to be obtained are shown in figure 3. The lines parallel to the broadsides of the target are defined as L 1 -lines. All the L 1 -lines are parallel to each other and perpendicular to the bottom edges. The lines between adjacent L l -lines are defined as L 2 -lines. All the L 2 -lines are parallel to each other as well. Without loss of generality, we use certain calibration points to describe the calibration principle of the LDS.

Calibration of the vision-plane parameters
The points A i , B i , C i , D i , E i and F i on the L 2 -lines are regarded as the calibration points to calibrate the vision plane. Due to the known positions of the L 1 -lines, it is easy to obtain the coordinates y i and z i of the calibration points 1 i , 2 i , 3 i , 4 i , 5 i , 6 i , 7 i and 8 i on the L 1 -lines in the local coordinate system. Therefore, by employing multiple cross-ratio invariance principles, the coordinate y i of the calibration points A i , B i and C i on the L 2 -lines can be calculated with the known coordinate y i of the collinear points 1 i , 2 i , 3 i and 4 i . Then the coordinates x i and z i of the calibration points A i , B i , and C i in the local coordinate system can be obtained according to the known equations of the L 2 -lines. Similarly, the 3D coordinates of the calibration points D i , E i , and F i in the local coordinate system can be worked out. All the calibration points on the L 2 -lines satisfy The vision-plane parameters a, b and c in the local coordinate system can be optimized using no less than 3 calibration points on the L 2 -lines.

Calibration of the principle coordinate and the focal length
In (6), the mapping between the mark point P(y i , z i , 1) and the image point p(u, 1) can be represented by a 2 × 3 mapping matrix H as: where λ is a scale factor that is related to the parameter ρ. The mapping matrix H can be obtained up to the scale factor with at least 5 calibration point matches.
We simplify the intrinsic parameter matrix as A= ⎜ where k = 1/λ. We define an intermediate matrix B as Relating (13), (14) and (15)  As the mapping matrix H has been computed, we can obtain b 1 , b 2 and b 3 up to the scale factor k. Then the coordinate of the principle point u 0 , the focal length α y and the scale factor k can be calculated as It is notable that the scale factor k is related to the mapping matrix H; thus, it changes when the position of the target changes, as opposed to the parameters u 0 and α y , which are constant.

Calibration of the extrinsic parameters
After the intrinsic parameters matrix A is obtained, the vectors s 1 , s 2 , s 2 can be figured out as well. Therefore, according   It is easy to figure out part extrinsic parameters r 21 , r 22 , r 31 , r 32 , r 23 , r 33 . The rest of the extrinsic parameters can be solved by relating (6) and (8) . Finally, the unique solution for the extrinsic parameters can be represented as

Dealing with lens distortion
Up until now, the parameters of the ideal vision-measurement model have been calibrated. According to the lens-distortion model (10), the lens-distortion coefficients can be worked out with the linear least-squares method. All the calibration points can be used to calibrate the lens distortion. Based on the acquired model parameters, the 3D coordinates of the calibration points are mapped to the 1D image coordinates, which are regarded as the ideal image coordinates of the calibration point. Then, by using the intrinsic parameters calibrated in section 3.2 as the initial guesses, the lens-distortion coefficients k 1 and k 2 can be estimated.

Non-linear optimization
In order to minimize re-projection error, non-linear optimization is needed. Accordingly, the optimization objective function (20) is built by minimizing the sum of squared Euclidean distances between the image coordinates of the calibration points that were obtained based on the vision-measurement model and their real image coordinates (20). This is expressed as is the projective coordinate of the calibration point P j (at the position i), based on the vision-measurement model. u ij ʹ is the real image coordinate of the calibration point. With the parameters calibrated previously as the initial guesses, non-linear optimization can be achieved by the Levenberg-Marquardt algorithm.

Experiments and discussions
In order to validate the feasibility and stability of the proposed calibration method, both simulation analyses and real experiments were designed and conducted. They are detailed as follows.

Simulation analyses
Simulation analyses were conducted in three different aspects to examine the impact of each factor on the calibration accuracy. The two planes of the stereo-target are perpendicular to each other theoretically, with 20 L 1 -lines and 15 L 2 -lines distributed on each plane. Throughout all the experiments, the line granularity of the L 1 -lines on the plane was assumed to be 10 mm, the coordinate of the principle point v 0 was assumed to be 508 and the focal length α y was assumed to be 1278.

The noise-level test.
The speckle noise is an important uncertainty source for the LDS and it is related to the numerical aperture of the lens [19]. In the test, the target was placed randomly at 4 different positions in the field of view of the LDS. The numerical aperture of the lens varied from 0.015 to 0.2; the speckle noise was added to all the image coordinates of the calibration points and laser points. For each numerical aperture, 200 independent calibration tests were conducted and the calibration results were compared with the truths. The calibration errors of some parameters are shown to illustrate the effect tendency. The absolute RMS error of parameter v 0 is shown in figure 4(a), and the relative RMS errors of parameters α y , n and a are shown in figure 4(b).
From what is shown in figure 4, the calibration accuracy of the LDS increases with the increase of the numerical aperture of the lens. This is because that the uncertainty of the image coordinates caused by the speckle noise reduces with the increase of the numerical aperture of lens; then the calibration accuracy of the LDS is improved as well. For a numerical aperture of the lens of sina = 0.2, the absolute calibration error of the principle point v 0 is 0.36 pixels; the relative errors of parameters α y , n and a are 0.0384%, 0.0189% and 0.135%, respectively. Results indicate that the calibration method has high robustness against the speckle noise, in theory.

The non-perpendicularity-of-the-target test.
The test was designed to examine the influence of the non-perpendicularity of the two planes of the stereo-target on the calibration accuracy. In the test, the numerical aperture of the lens was assumed to be 0.2; the two planes of the stereo-target are not orthogonal, with a deviation angle of θ varying from 0° to 1°. The calibration points were acquired when the target was randomly placed at 4 different positions in the field of view of the LDS. We added speckle noise to all the image coordinates of the calibration points and laser points. For each non-perpendicularity of the target, 200 independent calibration tests were repeated, and the calibration errors of some parameters were calculated. The results are illustrated in figure 5(a) and 5(b). From figure 5(a), it is observed that the non-perpendicularity of the target has an inconspicuous influence on the calibration accuracy of the principle point. This is because the error of the principle point caused by the deviations of the calibration points on one plane can offset that of other plane. Figure 5(b) shows that the relative calibration errors of other parameters rise as the non-perpendicularity of the target increases.

Real data
The calibration system of the LDS was built as shown in figure 7. A line-scan camera, made by DALSA corporation, with a 16 mm optical lens and a dot laser were used to simulate the laser-displacement sensor system. The line rate was set to 100 lines s −1 . The resolution of the line-scan camera was 1024 pixels × 1 lines. The pixel size was 10 μm × 10 μm. The size of each plan of the stereo-target was 165 mm × 110 mm. The two planes of the stereo-target were perpendicular to each other, with perpendicularity accuracy of 0.01° and flatness of 0.01 mm. 20 L 1 -lines and 15 L 2 -lines were arranged on the surface of each plane. The interval of adjacent L 1 -lines was 10 mm. The slope of the L 2 -lines relative to that of the L 1 -lines was 0.1.
In the field of view, the stereo-target was placed at 8 different positions randomly. At each position, an image containing a number of calibration points and a laser point was captured. One image is shown in figure 8 as an example. According to the method described above, all the calibration points were detected with sub-pixel accuracy and used for calibrating the LDS system. Part intrinsic parameters of the calibrated LDS are presented in table 1. In addition, the parameters of the vision plane in each local coordinate system are listed in table 2.
The extrinsic parameters are To evaluate the calibration accuracy of the LDS, 22 laser points were chosen randomly and the deviations between the re-projection points and real-image points were calculated. The results are illustrated in figure 9. The maximum re-projection error is 0.1689 pixels, and the minimum re-projection error is only 0.0003 pixels. The RMS error of the re-projection points of the laser points and real-image points is 0.0691 pixels.
In addition, 10 space distances in the measurement range were measured by the calibrated LDS system. The distances were produced by a 2D moving platform with a moving accuracy of 0.005 mm. Then the measurement results obtained by the calibrated LDS were compared with the approximately true values. The results are illustrated in table 3. The minimum deviation is 0.001 mm and the maximum deviation is 0.085 mm. The overall calibration accuracy is 0.044 mm in the measurement range of about 150 mm. It is indicated that the proposed calibration method performed well.

Conclusion
In this paper, a flexible calibration method for the LDS based on an extended vision measurement model of the LDS has been developed. The calibration for the LDS can be implemented by freely moving a stereo-target at least twice, capturing the image at each position and then calculating the model parameters based on their constraint relationships. The advantages of the novel calibration method are summarized as follows: (1) being independent of expensive and high-precision calibration devices, the calibration system is simple and low cost; (2) there is no special limitation on the relative position between the calibrated LDS and the target, and thus the calibration points can be obtained easily; (3) compared with traditional measurement models and calibration methods of LDSs, the extended vision-measurement model of LDSs is more comprehensive, and the linearity-approximation process in the calibration of LDSs is not needed. Thus, the measurement range of LDSs is not limited in the linearity range. Overall, it is convenient and quick to implement the calibration for LDSs by the proposed calibration method. As a result, the calibration method can be applied in wider application fields.
In further studies, a flexible global calibration method for multiple LDSs will be studied based on the proposed calibration method for a single LDS. On one hand, because  of employing the proposed calibration method based on the vision-measurement model, the LDS can measure not only the 1D displacement of the measured object, but also the 3D coordinates of the measured point. On the other hand, LDSs have advantages in dynamic 3D measurement fields. Therefore, we can build a vision-measurement system by combining multiple LDSs, develop a flexible global calibration method and apply multiple LDSs in wider dynamic 3D reconstruction fields.