Precision Measurement Method of Large Shaft Diameter Based on Dual Camera System

At present, there is a problem that the measurement accuracy and measurement range cannot be balanced in the measurement of shaft diameter by the machine vision method. In this paper, we propose a large-scale shaft diameter precision measurement method based on a dual camera measurement system. The unified world coordinate system of the two cameras is established by analyzing the dual camera imaging model and obtaining the measurement formula. In order to verify the validity of the proposed method, two black blocks in the calibration plate with a known center distance of 100 mm were measured. The mean value was 100.001 mm and the standard deviation was 0.00039 in 10 measurements. Finally, the proposed system was applied to the diameter measurement of a complexed crankshaft. The mean μ95 values of CMM and the proposed method were ±1.02 μm and ±1.07 μm, respectively, indicating that the measurement accuracy of the proposed method is roughly equal to the CMM.


Introduction
In industrial applications, shafts, as indispensable parts, are the most widely used parts in various mechanical devices and various engineering fields that have strict requirements for accuracy [1]. The geometric dimensions and tolerances of the shaft have important impacts on the motion performance and service life of the machine. Therefore, it is important to measure the accuracy of axes comprehensively and efficiently online [2].
As one of the most important parts of the engine, the crankshaft is responsible for outputting external torque. The quality of the crankshaft directly affects the performance of the car. Therefore, the measurement and error control of the crankshaft are important. The crankshaft has a complex structure and many process parameters. Among them, the shape error of the crankshaft main journal and connecting rod journal is an important indicator to measure the process quality [3][4][5][6]. Currently, the parameters of crankshaft are generally measured by manually using vernier calipers, spiral micrometers, and three-coordinate measurement [7][8][9][10], or the contact-type special measurement equipment [11,12]. The former methods need to contact the surface of the part, which will inevitably lead to a certain degree of damage to the surface of the part. The latter method has the disadvantage of expensive equipment and an inability to achieve online detection. On the other hand, personnel measurement inevitably has phenomena such as low efficiency, poor reliability, and false detection due to fatigue, and it is difficult to meet the requirements of real-time, fast, online, and non-contact detection implemented in today's manufacturing industry. On account of the high price of three coordinate machines and special measurement equipment, manual measurement, despite its inherent flaws, is still the mainstream method at present in China. An actual manual measurement site is shown in Figure 1. a skilled worker takes method at present in China. An actual manual measurement site is shown in Figure 1. a skilled worker takes 45-50 min to measure 81 parameters of a six-cylinder engine crankshaft. This high-intensity work urgently needs a new measurement technology. Being the core technology of intelligent manufacturing, measurement technology based on machine vision has been widely used in the measurement of geometric accuracy of mechanical parts [13][14][15][16][17], as it has the characteristics of non-contact, non-destructive, high precision, and fast speed.
A variety of approaches have been developed for the precision measurement of shafts. Peng Zhen proposed a measuring method of shaft diameter based on structured light images, with a measuring diameter range of 30-50 mm and measuring accuracy of ±0.2 mm [18]. Ding Yanrong studied the key technologies of precision visual measurement of shaft workpieces, with a measuring diameter range of 11-16 mm and measuring accuracy of ±0.005 mm [19]. Yin Weiqi proposed a visual size measurement technology of shaft parts, with a measuring diameter range of 25-30 mm and measuring accuracy of ±0.06 mm [20]. Wei and Tan et al. proposed a method based on Zhang's calibration to calibrate the internal and external parameters of the camera through the shaft with known shaft diameter; the measuring diameter range is 30-40 mm, and measuring error is less than 0.015 mm [21][22]. In the actual measurement process, the distance to be measured between the camera and the axis must be equal to the distance between the camera and the plane of the calibration board, which is difficult to guarantee. Sun et al. established a visual measurement model of shaft parts based on the principle of pinhole vision and geometric constraints, and used a plane target fixed at a specific position to calibrate the measurement system [23]. The average measurement error of the system is about 0.005 mm. By establishing an error correction model for the distance between the reference plane and the camera, the measuring diameter range is 2-10 mm, and the error is within 0.009 mm [24][25].
Based on the above works, it can be concluded that using the telecentric vision system can achieve higher-precision measurement, but the measurement range is limited. Using the pinhole vision system can achieve a large field of view, but the accuracy is limited. The algorithm needs to be optimized to improve the accuracy. In this paper, a dual telecentric camera system is proposed to measure the large shaft diameter. It has a high measuring accuracy while working in a large diameter range. This paper is organized as follows: Section 2 elaborates the measurement principle of the dual camera system, Section Being the core technology of intelligent manufacturing, measurement technology based on machine vision has been widely used in the measurement of geometric accuracy of mechanical parts [13][14][15][16][17], as it has the characteristics of non-contact, non-destructive, high precision, and fast speed.
A variety of approaches have been developed for the precision measurement of shafts. Peng Zhen proposed a measuring method of shaft diameter based on structured light images, with a measuring diameter range of 30-50 mm and measuring accuracy of ±0.2 mm [18]. Ding Yanrong studied the key technologies of precision visual measurement of shaft workpieces, with a measuring diameter range of 11-16 mm and measuring accuracy of ±0.005 mm [19]. Yin Weiqi proposed a visual size measurement technology of shaft parts, with a measuring diameter range of 25-30 mm and measuring accuracy of ±0.06 mm [20]. Wei and Tan et al. proposed a method based on Zhang's calibration to calibrate the internal and external parameters of the camera through the shaft with known shaft diameter; the measuring diameter range is 30-40 mm, and measuring error is less than 0.015 mm [21,22]. In the actual measurement process, the distance to be measured between the camera and the axis must be equal to the distance between the camera and the plane of the calibration board, which is difficult to guarantee. Sun et al. established a visual measurement model of shaft parts based on the principle of pinhole vision and geometric constraints, and used a plane target fixed at a specific position to calibrate the measurement system [23]. The average measurement error of the system is about 0.005 mm. By establishing an error correction model for the distance between the reference plane and the camera, the measuring diameter range is 2-10 mm, and the error is within 0.009 mm [24,25].
Based on the above works, it can be concluded that using the telecentric vision system can achieve higher-precision measurement, but the measurement range is limited. Using the pinhole vision system can achieve a large field of view, but the accuracy is limited. The algorithm needs to be optimized to improve the accuracy. In this paper, a dual telecentric camera system is proposed to measure the large shaft diameter. It has a high measuring accuracy while working in a large diameter range. This paper is organized as follows: Section 2 elaborates the measurement principle of the dual camera system, Section 3 reports the calibration results and experimental results used to test the measuring accuracy, and Section 4 provides the study's conclusions.

Vision Measurement Principle
The imaging model of the pinhole camera is shown in Figure 2, which shows the coordinate systems used to model the perspective projection from a 3D surface point to a 2D image point. 3 reports the calibration results and experimental results used to test the measuring accuracy, and Section 4 provides the study's conclusions.

Vision Measurement Principle
The imaging model of the pinhole camera is shown in Figure 2, which shows the coordinate systems used to model the perspective projection from a 3D surface point to a 2D image point.  is the world coordinate system. The coordinate of point under the world coordinate system can be expressed as ( , , ), and its unit is mm.
− is the camera coordinate system, with the measurement unit mm. − is the physical image coordinate system, the measurement unit of which is mm.
− is the pixel image coordinate system, and its measurement unit is pixel.
Based on pinhole projection, the perspective projection from the world coordinates to the pixel image coordinate can be expressed as reported by Zhang [22] and as follows: In the equation, 0 0 0 1 represents the intrinsic camera parameters and represents the extrinsic camera parameters. is the scale factor and , denote the rotation matrix and translation matrix, respectively. Assuming the measurement plane in the world coordinate system is = 0, then the above Formula (1) can be changed to the following Formula (2).
In the equation, = . Without considering the scale factor , it can be obtained that a point on the plane in the world coordinate system can have a one-to-one mapping relationship with the pixel point in the pixel image coordinate system. The measurement of monocular vision is based on the above principles. O w − X w Y w Z w is the world coordinate system. The coordinate of point P w under the world coordinate system can be expressed as (X w , Y w , Z w ), and its unit is mm. O c − X c Y c Z c is the camera coordinate system, with the measurement unit mm. o − xy is the physical image coordinate system, the measurement unit of which is mm. O 1 − uv is the pixel image coordinate system, and its measurement unit is pixel.
Based on pinhole projection, the perspective projection from the world coordinates to the pixel image coordinate can be expressed as reported by Zhang [22] and as follows: In the equation,   α γ u 0 0 β v 0 0 0 1   represents the intrinsic camera parameters and R T represents the extrinsic camera parameters. s is the scale factor and R, T denote the rotation matrix and translation matrix, respectively.
Assuming the measurement plane in the world coordinate system is Z = 0, then the above Formula (1) can be changed to the following Formula (2).
In the equation, R = r 1 r 2 r 3 . Without considering the scale factor s, it can be obtained that a point on the plane in the world coordinate system can have a one-to-one mapping relationship with the pixel point in the pixel image coordinate system. The measurement of monocular vision is based on the above principles. Two-dimensional machine vision measurement systems can commonly be divided into two categories: telecentric vision systems and pinhole vision systems. Due to the special mechanical structure design of the telecentric lens, the image size of the object remains unchanged within the depth of field, so the measurement accuracy of the telecentric vision system usually reaches the micron level [26]. However, only the light, which is parallel to the main optical axis, can be photosensitive in the telecentric vision measurement system. Therefore, the field of view of the telecentric vision system is narrow compared to the pinhole camera.
The large-scale precision measurement system proposed in this paper is shown in Figure 3. This system consists of two double telecentric lenses, two high-resolution CCD cameras, and two telecentric back light sources. Assuming that the diameter of the shaft to be measured is D, the working distance of the object is WD. The two cameras are placed above the left and right edge of the shaft, and the distance between the two cameras is roughly D to make sure that the edge of the workpiece is in the field of view. Two telecentric back light sources are placed under the left and right edge of the shaft. The camera and lens should be selected to ensure the tolerance requirements of the measured workpiece.

System Construction
Two-dimensional machine vision measurement systems can commonly be divided into two categories: telecentric vision systems and pinhole vision systems. Due to the special mechanical structure design of the telecentric lens, the image size of the object remains unchanged within the depth of field, so the measurement accuracy of the telecentric vision system usually reaches the micron level [26]. However, only the light, which is parallel to the main optical axis, can be photosensitive in the telecentric vision measurement system. Therefore, the field of view of the telecentric vision system is narrow compared to the pinhole camera.
The large-scale precision measurement system proposed in this paper is shown in Figure 3. This system consists of two double telecentric lenses, two high-resolution CCD cameras, and two telecentric back light sources. Assuming that the diameter of the shaft to be measured is D, the working distance of the object is WD. The two cameras are placed above the left and right edge of the shaft, and the distance between the two cameras is roughly D to make sure that the edge of the workpiece is in the field of view. Two telecentric back light sources are placed under the left and right edge of the shaft. The camera and lens should be selected to ensure the tolerance requirements of the measured workpiece.  Figure 4 shows the measurement principle of the dual camera system. In this paper, we use dual cameras instead of binocular vision to represent the measurement system, as the latter has two eyes capable of facing the same direction to perceive a single threedimensional image of its surroundings. In Figure 4, the reference pose image 1 is captured by the left camera, and the reference pose image 2 is captured by the right camera. The corresponding world coordinate systems of the left and right cameras are (  ,  ,  ) and ( , , ), respectively. The corresponding coordinate in the world coordinate system of the pixel ( , ) in the reference pose image 1 captured by the left camera is ( , ), while the corresponding coordinate in the world coordinate system of the pixel ( , ) in the reference pose image 2 captured by the right camera is  Figure 4 shows the measurement principle of the dual camera system. In this paper, we use dual cameras instead of binocular vision to represent the measurement system, as the latter has two eyes capable of facing the same direction to perceive a single threedimensional image of its surroundings. In Figure 4, the reference pose image 1 is captured by the left camera, and the reference pose image 2 is captured by the right camera. The corresponding world coordinate systems of the left and right cameras are (x w1 , y w1 , z w1 ) and (x w2 , y w2 , z w2 ), respectively. The corresponding coordinate in the world coordinate system of the pixel P 1 (u 1 , v 1 ) in the reference pose image 1 captured by the left camera is P w1 (x w1 , y w1 ), while the corresponding coordinate in the world coordinate system of the pixel P 2 (u 2 , v 2 ) in the reference pose image 2 captured by the right camera is P w2 (x w2 , y w2 ). We assume that there is another world coordinate system (X W , Y W , Z W ), which is equal to (x w1 , y w1 , z w1 ). As the two coordinate systems (x w1 , y w1 , z w1 ) and (x w2 , y w2 , z w2 ) are on the same calibration plate, the coordinate of ( , ). We assume that there is another world coordinate system( , , ), which is equal to ( , , ) . As the two coordinate systems (  ,  ,  ) and ( , , ) are on the same calibration plate, the coordinate of ( , ) in ( , , ) is still ( , ), while the coordinate of ( , ) in ( , , ) is ( + , ). According to the above analysis, the pixels in the different images captured by the two cameras are unified in the world coordinate system. The corresponding distance in the world coordinate system of ( , ) and ( , ) is calculated by the following formula:

Dual Camera Measurement Principle
In the equation, ( , ) and ( , ), which is calculated by the corresponding pixel coordinates and the camera projection transformation matrix; both are coordinates in their corresponding world coordinate system.

Subpixel Edge Extraction Based on Interpolation
After capturing the edge image of the workpiece, the edge detection algorithm Canny operator [27] is used to obtain the edge of the image pixel. Then, according to the distribution of the grayscale of the edge neighborhood, the interpolation function is used to approximate the grayscale function (one-dimensional grayscale function) of the edge transition area to implement sub-pixel edge localization. The interpolation method is suitable for real-time online detection due to its simple operation and high positioning accuracy [28]. The Lagrange interpolation function expression is as follows: In the equation, is the total number of the interpolation points, is the interpolation point, and is the interpolation grayscale. In this paper, we use quadratic polynomial interpolation and = 3. Along the axis of the gradient magnitude image, − ∆ , , + ∆ are taken as the interpolation points, and ∆ is the distance. ( − ∆ , ), ( , ), ( + ∆ , ) correspond to the interpolation grayscale. Equation (4) can be written as the following function: According to the above analysis, the pixels in the different images captured by the two cameras are unified in the world coordinate system. The corresponding distance in the world coordinate system of P 1 (u 1 , v 1 ) and P 2 (u 2 , v 2 ) is calculated by the following formula: In the equation, (x w1 , y w1 ) and (x w2 , y w2 ), which is calculated by the corresponding pixel coordinates and the camera projection transformation matrix; both are coordinates in their corresponding world coordinate system.

Subpixel Edge Extraction Based on Interpolation
After capturing the edge image of the workpiece, the edge detection algorithm Canny operator [27] is used to obtain the edge of the image pixel. Then, according to the distribution of the grayscale of the edge neighborhood, the interpolation function is used to approximate the grayscale function (one-dimensional grayscale function) of the edge transition area to implement sub-pixel edge localization. The interpolation method is suitable for real-time online detection due to its simple operation and high positioning accuracy [28]. The Lagrange interpolation function expression is as follows: In the equation, n is the total number of the interpolation points, x c is the interpolation point, and f c is the interpolation grayscale. In this paper, we use quadratic polynomial interpolation and n = 3. Along the x axis of the gradient magnitude image, x i − ∆ x , x i , x i + ∆ x are taken as the interpolation points, and ∆ x is the distance. M(i − ∆ x , j), M(i, j), M(i + ∆ x , j) correspond to the interpolation grayscale. Equation (4) can be written as the following function: Let dL(x)/dx = 0; the x coordinate of subpixel edge point is: .
Similarly, along the y axis, y i − ∆ y , y i , y i + ∆ y are taken as the interpolation points, and the corresponding interpolation gray levels are M i, j − ∆ y , M(i, j), M i, j + ∆ y , respectively. The schematic diagram of the interpolation method is shown in Figure 5.
Let ( )/ = 0; the x coordinate of subpixel edge point is: Similarly, along the axis, − ∆ , , + ∆ are taken as the interpolation points, and the corresponding interpolation gray levels are , − ∆ , ( , ), ( , + ∆ ), respectively. The schematic diagram of the interpolation method is shown in Figure 5.
The interpolation point taken along the axis is shown in in Figure 5a, the interpolation point taken along the axis is shown in Figure 5b, and the interpolation gray level is shown in Figure 5b. The y coordinates of the subpixel edge point is: The matrix form of the above equation is as follows: In practical application, ∆ , ∆ take the particular value according to the edge transition area. In this paper, we find that the edge transition area, which is shown in Figure 6, consists of 12 pixels. Therefore, we set ∆ = 3 and ∆ = 1. The details of the detection results are given in Section 3.3.  The interpolation point taken along the x axis is shown in in Figure 5a, the interpolation point taken along the y axis is shown in Figure 5b, and the interpolation gray level is shown in Figure 5b.
The y coordinates of the subpixel edge point is: The matrix form of the above equation is as follows: In practical application, ∆ x , ∆ y take the particular value according to the edge transition area. In this paper, we find that the edge transition area, which is shown in Figure 6, consists of 12 pixels. Therefore, we set ∆ x = 3 and ∆ y = 1. The details of the detection results are given in Section 3.3.
Let ( )/ = 0; the x coordinate of subpixel edge point is: Similarly, along the axis, − ∆ , , + ∆ are taken as the interpolation points, and the corresponding interpolation gray levels are , − ∆ , ( , ), ( , + ∆ ), respectively. The schematic diagram of the interpolation method is shown in Figure 5.
The interpolation point taken along the axis is shown in in Figure 5a, the interpolation point taken along the axis is shown in Figure 5b, and the interpolation gray level is shown in Figure 5b.
The matrix form of the above equation is as follows: In practical application, ∆ , ∆ take the particular value according to the edge transition area. In this paper, we find that the edge transition area, which is shown in Figure 6, consists of 12 pixels. Therefore, we set ∆ = 3 and ∆ = 1. The details of the detection results are given in Section 3.3.

Experiments and Results
In order to fully verify the effectiveness and stability of the proposed method, this section is organized as follows: Section 3.1 introduces the machine parameter requirements of crankshaft diameter, Section 3.2 builds the experimental platform, Section 3.3 calibrates the camera and the dual camera system, Section 3.4 uses the proposed method to measure the known size in the calibration board, and Section 3.5 measures the complexed crankshaft diameter by the proposed method and CMM. Finally, we analyze the measurement results.

Crankshaft
The measurement object in the experiment is the diameter of the main shaft journal of the heavy-duty engine by fine grinding, whose machine precision is φ100 −0.01 −0.022 . The heavy-duty truck engine six-cylinder crankshaft to be measured is shown in Figure 7.

Experiments and Results
In order to fully verify the effectiveness and stability of the proposed method, this section is organized as follows: Section 3.1 introduces the machine parameter requirements of crankshaft diameter, Section 3.2 builds the experimental platform, Section 3.3 calibrates the camera and the dual camera system, Section 3.4 uses the proposed method to measure the known size in the calibration board, and Section 3.5 measures the complexed crankshaft diameter by the proposed method and CMM. Finally, we analyze the measurement results.

Crankshaft
The measurement object in the experiment is the diameter of the main shaft journal of the heavy-duty engine by fine grinding, whose machine precision is 100 .
. . The heavy-duty truck engine six-cylinder crankshaft to be measured is shown in Figure 7.

Experimental Platform Construction
The experimental measurement platform built in this paper is shown in Figure 8. The adjustment devices 1 and 3 can complete the fine adjustment along the y-axis direction and device 2 can complete the adjustment along the x-axis direction. Device 5 is a customized calibration board, device 6 comprises two parallel light sources, device 7 can complete the adjustment along the y-axis direction, and device 8 is the crankshaft.

Experimental Platform Construction
The experimental measurement platform built in this paper is shown in Figure 8. The adjustment devices 1 and 3 can complete the fine adjustment along the y-axis direction and device 2 can complete the adjustment along the x-axis direction. Device 5 is a customized calibration board, device 6 comprises two parallel light sources, device 7 can complete the adjustment along the y-axis direction, and device 8 is the crankshaft.

Results of Calibration
According to the nominal diameter of the shaft to be measured, the specification of the calibration plate is determined by considering the field of view and measurement accuracy requirement. The calibration board used in the paper is shown in Figure 9. Two 7 × 7 circular patterns are printed on the calibration board, and the center distance is the nominal diameter D of the measured shaft. In this paper, the nominal diameter of the crankshaft diameter is 100 mm, and the pattern in the calibration plate adopts laser engraving technology, which ensure that D is 100 + 0.001 mm.
The inherent parameters of the cameras and lenses are listed in Table 1. The tolerance zone of crankshaft diameter is 0.012 mm and the field of view of the camera is 3.288 mm, so the center distance between the two cameras is adjusted to 100 ± 5 mm. We adjusted the height of the calibration plane to obtain a clear image in the calibration plate by the fine adjustment device 1. The depth of field of the lens is 0.72 mm.

Results of Calibration
According to the nominal diameter of the shaft to be measured, the specification of the calibration plate is determined by considering the field of view and measurement accuracy requirement. The calibration board used in the paper is shown in Figure 9. Two 7 × 7 circular patterns are printed on the calibration board, and the center distance is the nominal diameter of the measured shaft. In this paper, the nominal diameter of the crankshaft diameter is 100 mm, and the pattern in the calibration plate adopts laser engraving technology, which ensure that D is 100 + 0.001 mm. The inherent parameters of the cameras and lenses are listed in Table 1. The tolerance zone of crankshaft diameter is 0.012 mm and the field of view of the camera is 3.288 mm, so the center distance between the two cameras is adjusted to 100 ± 5 mm. We adjusted the height of the calibration plane to obtain a clear image in the calibration plate by the fine adjustment device 1. The depth of field of the lens is 0.72 mm.
The intrinsic and extrinsic parameters of the two cameras calculated by Zhang's method [29] using 16 images of the calibration board are shown in Tables 2 and 3.

Results of Calibration
According to the nominal diameter of the shaft to be measured, the specification of the calibration plate is determined by considering the field of view and measurement accuracy requirement. The calibration board used in the paper is shown in Figure 9. Two 7 × 7 circular patterns are printed on the calibration board, and the center distance is the nominal diameter of the measured shaft. In this paper, the nominal diameter of the crankshaft diameter is 100 mm, and the pattern in the calibration plate adopts laser engraving technology, which ensure that D is 100 + 0.001 mm. The inherent parameters of the cameras and lenses are listed in Table 1. The tolerance zone of crankshaft diameter is 0.012 mm and the field of view of the camera is 3.288 mm, so the center distance between the two cameras is adjusted to 100 ± 5 mm. We adjusted the height of the calibration plane to obtain a clear image in the calibration plate by the fine adjustment device 1. The depth of field of the lens is 0.72 mm.
The intrinsic and extrinsic parameters of the two cameras calculated by Zhang's method [29] using 16 images of the calibration board are shown in Tables 2 and 3.  The intrinsic and extrinsic parameters of the two cameras calculated by Zhang's method [29] using 16 images of the calibration board are shown in Tables 2 and 3.  Table 3. Calibrated parameters of the right camera.

Interior Parameters Exterior Parameters
Single  Tables 2 and 3, one camera has pillow distortion and the other has barrel distortion. However, in the follow-up experiments, the effect of camera distortion can be ignored, which fully proves the reliability of the telecentric camera in precision measurement.

Length Measurement of Calibration Board
In order to test the stability and validity of the proposed method, the calibration board of known size, as shown in Figure 10, is measured. The theoretical center distance between the two black squares is 100.000 mm and the actual deviation is ±0.001 mm. As shown in Tables 2 and 3, one camera has pillow distortion and the other has barrel distortion. However, in the follow-up experiments, the effect of camera distortion can be ignored, which fully proves the reliability of the telecentric camera in precision measurement.

Length Measurement of Calibration Board
In order to test the stability and validity of the proposed method, the calibration board of known size, as shown in Figure 10, is measured. The theoretical center distance between the two black squares is 100.000 mm and the actual deviation is ±0.001 mm.  Subpixel detection described in Section 2.3 was applied to the images of the black squares, and the subpixel coordinates of the edges of the black square were calculated, as shown in Figure 12. The subpixel coordinates of the edges are fitted to the line equations by the least square method [30], as shown in Figure 13. Subpixel detection described in Section 2.3 was applied to the images of the black squares, and the subpixel coordinates of the edges of the black square were calculated, as shown in Figure 12. The subpixel coordinates of the edges are fitted to the line equations by the least square method [30], as shown in Figure 13. Subpixel detection described in Section 2.3 was applied to the images of the black squares, and the subpixel coordinates of the edges of the black square were calculated, as shown in Figure 12. The subpixel coordinates of the edges are fitted to the line equations by the least square method [30], as shown in Figure 13. As shown in Figure 14, S1 and S2 are the line segments of left and right fitted image edges, respectively. In real applications, because S1 and S2 cannot be guaranteed to be  Subpixel detection described in Section 2.3 was applied to the images of the black squares, and the subpixel coordinates of the edges of the black square were calculated, as shown in Figure 12. The subpixel coordinates of the edges are fitted to the line equations by the least square method [30], as shown in Figure 13. As shown in Figure 14, S1 and S2 are the line segments of left and right fitted image edges, respectively. In real applications, because S1 and S2 cannot be guaranteed to be As shown in Figure 14, S1 and S2 are the line segments of left and right fitted image edges, respectively. In real applications, because S1 and S2 cannot be guaranteed to be completely parallel, the average of the maximum and minimum distances from the left fitted line segment to the right fitted line segment is used as the final distance.  The calibration board is moved at different positions within the field of view of the camera, and we collected 10 sets of images and measured the distance by the method proposed in this paper. The results are shown in the Table 4. From the above table, it is obtained that these measurement results validate the effectiveness of the proposed method, which meets the measurement accuracy requirements of the calibration board with an accuracy requirement of 1 μm.

Diameter Measurement of Crankshaft by the Proposed Method
As shown in Figure 15, the dual camera system is fixed above the crankshaft and the parallel light source is fixed under the crankshaft. We collected 10 sets of images at 36° intervals by rotating the crankshaft, and a total of 100 images were captured. The calibration board is moved at different positions within the field of view of the camera, and we collected 10 sets of images and measured the distance by the method proposed in this paper. The results are shown in the Table 4. From the above table, it is obtained that these measurement results validate the effectiveness of the proposed method, which meets the measurement accuracy requirements of the calibration board with an accuracy requirement of 1 µm.

Diameter Measurement of Crankshaft by the Proposed Method
As shown in Figure 15, the dual camera system is fixed above the crankshaft and the parallel light source is fixed under the crankshaft. We collected 10 sets of images at 36 • intervals by rotating the crankshaft, and a total of 100 images were captured.

Diameter Measurement of Crankshaft with CMM
The CMM was produced by Hexagon Metrology AB and the ambient temperature was 20 °C. MPE : (2.6 + 3.5 L/1000) um, MPE : 2.2 um. The crankshaft was fixed when the crankshaft diameter was measured by CMM. The centerline of the crankshaft was fitted by evenly selecting 20 points on the surface of the crankshaft diameter, and then the vertical plan S of the crankshaft centerline was calculated. The CMM measurement platform is shown in Figure 16.

Experiment Results
Extensive experiments were carried out to verify the performance of the proposed method in comparison to CMM. The measurement results obtained by CMM and the proposed method are shown in Table 5.

Diameter Measurement of Crankshaft with CMM
The CMM was produced by Hexagon Metrology AB and the ambient temperature was 20 • C. MPE E : (2.6 + 3.5 L/1000) um, MPE P : 2.2 um. The crankshaft was fixed when the crankshaft diameter was measured by CMM. The centerline of the crankshaft was fitted by evenly selecting 20 points on the surface of the crankshaft diameter, and then the vertical plan S of the crankshaft centerline was calculated. The CMM measurement platform is shown in Figure 16.

Diameter Measurement of Crankshaft with CMM
The CMM was produced by Hexagon Metrology AB and the ambient temperature was 20 °C. MPE : (2.6 + 3.5 L/1000) um, MPE : 2.2 um. The crankshaft was fixed when the crankshaft diameter was measured by CMM. The centerline of the crankshaft was fitted by evenly selecting 20 points on the surface of the crankshaft diameter, and then the vertical plan S of the crankshaft centerline was calculated. The CMM measurement platform is shown in Figure 16.

Experiment Results
Extensive experiments were carried out to verify the performance of the proposed method in comparison to CMM. The measurement results obtained by CMM and the proposed method are shown in Table 5.

Experiment Results
Extensive experiments were carried out to verify the performance of the proposed method in comparison to CMM. The measurement results obtained by CMM and the proposed method are shown in Table 5. Based on the above table, the proposed method is more stable compared with the CMM method, and both methods can be controlled with accuracy to the thousandth. The mean results of diameter measurements by different methods 10 times are shown in Table 6.
x is the mean of the 10 measurements, and σ is the standard deviation. µ A is the type A uncertainty, and µ 95 is the expanded uncertainty when the confidence level is 95%.  Based on the above table, the proposed method is more stable compared with the CMM method, and both methods can be controlled with accuracy to the thousandth. The mean results of diameter measurements by different methods 10 times are shown in Table 6. x is the mean of the 10 measurements, and σ is the standard deviation.
is the type A uncertainty, and is the expanded uncertainty when the confidence level is 95%. From the above table, we observe that (1) the maximum values of CMM and the proposed method are ±2.11 μm and ±1.82 μm, and the half-interval length of the proposed method is shorter than CMM, and (2) the results indicate that the accuracy of the proposed method is equal to that of the CMM method.

Measurement Error Analysis
(1) As shown in Figure 17, the fitting accuracy of the edge will be affected by the electrostatic adsorption dust on the measured surface. To some extent, the measurement environment should be clean.  Based on the above table, the proposed method is more stable c CMM method, and both methods can be controlled with accuracy to The mean results of diameter measurements by different methods 1 Table 6. x is the mean of the 10 measurements, and σ is the standa the type A uncertainty, and is the expanded uncertainty when is 95%.  (2) the results indicate t the proposed method is equal to that of the CMM method.

Measurement Error Analysis
(1) As shown in Figure 17, the fitting accuracy of the edge will b electrostatic adsorption dust on the measured surface. To some exte environment should be clean. From the above table, we observe that (1) the maximum µ 95 values of CMM and the proposed method are ±2.11 µm and ±1.82 µm, and the half-interval length of the proposed method is shorter than CMM, and (2) the results indicate that the accuracy of the proposed method is equal to that of the CMM method.

Measurement Error Analysis
(1) As shown in Figure 17, the fitting accuracy of the edge will be affected by the electrostatic adsorption dust on the measured surface. To some extent, the measurement environment should be clean.
(2) Since the depth of field of the lens is 0.72 mm, if the position of the measurement system is not suitable, the boundary of the image will be blurred, which will reduce the fitting accuracy. The clear and blurred images are shown in Figure 18. (2) Since the depth of field of the lens is 0.72 mm, if the position of the measurement system is not suitable, the boundary of the image will be blurred, which will reduce the fitting accuracy. The clear and blurred images are shown in Figure 18.

Conclusions
(1) We proposed here a method of high-precision measurement of a large-sized shaft based on a dual telecentric camera system to solve the problem that the measurement accuracy and the measurement range cannot be balanced in the shaft diameter measurement with machine vision. The calibration method of the two telecentric cameras was proposed based on Zhang's calibration method, and we obtained the distance calculation formula by analyzing the imaging model of the proposed dual camera system. (2) A customized high-precision calibration board was used to further improve the calibration accuracy of the dual camera system, and a subpixel detection algorithm based on quadratic interpolation and a line fitting algorithm were used to improve the measurement accuracy of the measured object. (3) The measurement experiments of the calibration plate with a known center distance of 100.000 mm initially verified the effectiveness of the proposed method. The actual measurement results meet the measurement accuracy requirements of the calibration board.
In the same external environment, CMM and the proposed methods were used to measure a crankshaft diameter with a nominal diameter of 100. The maximum values (2) Since the depth of field of the lens is 0.72 mm, if the position of the measurement system is not suitable, the boundary of the image will be blurred, which will reduce the fitting accuracy. The clear and blurred images are shown in Figure 18.

Conclusions
(1) We proposed here a method of high-precision measurement of a large-sized shaft based on a dual telecentric camera system to solve the problem that the measurement accuracy and the measurement range cannot be balanced in the shaft diameter measurement with machine vision. The calibration method of the two telecentric cameras was proposed based on Zhang's calibration method, and we obtained the distance calculation formula by analyzing the imaging model of the proposed dual camera system. (2) A customized high-precision calibration board was used to further improve the calibration accuracy of the dual camera system, and a subpixel detection algorithm based on quadratic interpolation and a line fitting algorithm were used to improve the measurement accuracy of the measured object. (3) The measurement experiments of the calibration plate with a known center distance of 100.000 mm initially verified the effectiveness of the proposed method. The actual measurement results meet the measurement accuracy requirements of the calibration board.
In the same external environment, CMM and the proposed methods were used to measure a crankshaft diameter with a nominal diameter of 100. The maximum values

Conclusions
(1) We proposed here a method of high-precision measurement of a large-sized shaft based on a dual telecentric camera system to solve the problem that the measurement accuracy and the measurement range cannot be balanced in the shaft diameter measurement with machine vision. The calibration method of the two telecentric cameras was proposed based on Zhang's calibration method, and we obtained the distance calculation formula by analyzing the imaging model of the proposed dual camera system. (2) A customized high-precision calibration board was used to further improve the calibration accuracy of the dual camera system, and a subpixel detection algorithm based on quadratic interpolation and a line fitting algorithm were used to improve the measurement accuracy of the measured object. (3) The measurement experiments of the calibration plate with a known center distance of 100.000 mm initially verified the effectiveness of the proposed method. The actual measurement results meet the measurement accuracy requirements of the calibration board.
In the same external environment, CMM and the proposed methods were used to measure a crankshaft diameter with a nominal diameter of 100. The maximum µ 95 values of CMM and the proposed method were ±2.11 µm and ±1.82 µm, respectively, and the mean µ 95 values of CMM and the proposed method were ±1.02 µm and ±1.07 µm, respectively, indicating that the measurement accuracy of the proposed method is roughly equal to that of the CMM.
(4) The factors affecting the measurement accuracy in the proposed method were analyzed, providing a basis for further research and the application of this method.
Funding: This research was funded by the National Key R&D Program of China, grant numbers 2021YFB3202403 and 2018YFB0704304.