Next Article in Journal
UWB Wind Turbine Blade Deflection Sensing for Wind Energy Cost Reduction
Previous Article in Journal
An Auto-Tuning PI Control System for an Open-Circuit Low-Speed Wind Tunnel Designed for Greenhouse Technology
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Shaft Diameter Measurement Using Structured Light Vision

College of Mechanical Science and Engineering, Jilin University, Changchun 130022, China
*
Author to whom correspondence should be addressed.
Sensors 2015, 15(8), 19750-19767; https://doi.org/10.3390/s150819750
Submission received: 9 April 2015 / Revised: 1 August 2015 / Accepted: 6 August 2015 / Published: 12 August 2015
(This article belongs to the Section Physical Sensors)

Abstract

:
A method for measuring shaft diameters is presented using structured light vision measurement. After calibrating a model of the structured light measurement, a virtual plane is established perpendicular to the measured shaft axis and the image of the light stripe on the shaft is projected to the virtual plane. On the virtual plane, the center of the measured shaft is determined by fitting the projected image under the geometrical constraints of the light stripe, and the shaft diameter is measured by the determined center and the projected image. Experiments evaluated the measuring accuracy of the method and the effects of some factors on the measurement are analyzed.

1. Introduction

Shafts are one of most important machine elements and the accuracy of machined shafts has a significant effect on the properties of any mechanical device that employs one. The accuracy of a machined shaft can be ensured using a Computer Numerical Control lathe, but mechanical wear in a CNC lathe system, system deformation, and the radial wear of the machining tools will reduce the accuracy of the machined shaft. If the variation of the shaft diameter could be monitored during its machining, the dimensional accuracy of the product could be ensured by the automatic compensation system of the CNC lathe. Therefore, on-line measurement of shaft size is very important in machining.
A variety of noncontact machine vision methods for measuring the product diameters have been proposed [1,2,3,4,5]. These methods can be classified as active methods and passive methods. Passive measurement methods use a camera or two cameras to obtain shaft diameters [6,7]. In 2008, Song et al. [8] proposed a method where both edges of a shaft were imaged onto two cameras through two parallel light paths as shown in Figure 1 [8]. Using this approach, the shaft diameter was obtained by measuring the length of the photosensitive units on the shadow field of the two CCDs (Charge-Coupled Device) and the distance between the two parallel light paths. This method can amplify the measurement range while ensuring the measuring accuracy; however, it is very difficult to calibrate the position of the two cameras.
Figure 1. The optical principle of the parallel light projection method with double light paths (with permission from [8]).
Figure 1. The optical principle of the parallel light projection method with double light paths (with permission from [8]).
Sensors 15 19750 g001
In 2013, Sun [9] used a camera to obtain shaft diameters, employing a theory of plane geometry in the cross-section, which is perpendicular to the axis of the shaft, as shown in Figure 2 [9]. This method can achieve a high measuring accuracy, but it requires the calibration of the plane of the center line of the shaft before the measurement. In practice, the position of the center line changes each time the shaft is clamped by the jaw chucks of the lathe. This change of position will decrease the accuracy of measurement.
Figure 2. The orientations of the shaft and the measurement plane in 3D space (with permission from [9]).
Figure 2. The orientations of the shaft and the measurement plane in 3D space (with permission from [9]).
Sensors 15 19750 g002
Active measurement methods generally use one or more cameras and lasers to achieve accurate measurements of shaft diameters. In 2001, Sun et al. [10] used a pair of line-structured lasers and cameras to measure shaft diameters, as shown in Figure 3 [10]. The lights was projected onto the pipe, then captured by two cameras, and the diameter of a steel pipe could be determined by fitting the ellipse with the two developed arcs. It is difficult to ensure that the two arcs are on the same plane, so the accuracy of the method is limited. In 2010, Liu et al. [11] reported a method for measuring shaft diameters using a line-structured laser and a camera, as shown in Figure 4 [11]. The coordinates of the light stripe projected on the shaft were obtained using a novel gray scale barycenter extraction algorithm along the radial direction. The shaft diameter was then obtained by circle fitting using the generated coordinates. If the line-structured light is perpendicular to the measured shaft, the shaft diameter can be obtained by fitting a circle. Thus, this method is limited by the measurement environment.
Figure 3. Sketch of the measurement system (with permission from [10]).
Figure 3. Sketch of the measurement system (with permission from [10]).
Sensors 15 19750 g003
Figure 4. Mathematical model of the system (with permission from [11]).
Figure 4. Mathematical model of the system (with permission from [11]).
Sensors 15 19750 g004
In this study, a method for measuring shaft diameter is proposed using a line-structured laser and a camera. Based on the direction vector of the measured shaft axis, which is calibrated before the measurement, a virtual plane is established perpendicular to the axis and the image of a light stripe on the shaft is projected to the virtual plane. The shaft diameter is then determined from the projected image on the virtual plane. To improve the measuring precision, the center of the projected image was determined by fitting the projected image using a set of geometrical constraints.
This report is organized as follows: Section 2 calibrates the structured light system. Section 3 outlines the model of the proposed method. Section 4 reports the experimental results used to test the measuring accuracy and influences of several factors. Section 5 provides the study’s conclusions.

2. Calibration of the Structure Light Measuring System

2.1. Calibration of Camera Parameters

The calibration of the measurement system employed world coordinate systems (OiWXiWYiWZiW), a camera coordinate system (OCXCYCZC), a image coordinate system (oxy), and a pixel coordinate system (Ouv), which were established as shown in Figure 5.
Figure 5. Calibration model of the line structured light.
Figure 5. Calibration model of the line structured light.
Sensors 15 19750 g005
Based on pinhole projection and lens distortion models, the mapping from the world coordinates to the pixel coordinates can be expressed as reported by Zhang [12] and shown in Table 1, where R is the rotation matrix; T is translation vector; k1, k2, p1, and p2 are the coefficients of radial and tangential distortions; A = [ α γ u 0 0 β v 0 0 0 1 ] is the interior camera parameters; ZW = 0 in the model. A nonlinear function can be established by minimizing the distance between the calculated pixel coordinates of the corner points in the calibration board and the actual pixel coordinates. The function was solved using the Levenberg-Marquardt algorithm [13].
Table 1. Coordinate transformation of camera model.
Table 1. Coordinate transformation of camera model.
TransformationEquations
From world coordinates to camera coordinates [ X C Y C Z C ] = R [ X W Y W 1 ] + T (1)
From camera coordinates to image coordinates [ x u y u ] = 1 Z c [ X c Y c ] (2)
Introduce the distortion model, where, r2=x2d+y2d, [ x u y u ] = ( 1 + k 1 r 2 + k 2 r 4 ) [ x d y d ] + [ 2 p 1 x d y d + p 2 ( r 2 + 2 x d 2 ) p 1 ( r 2 + 2 y d 2 ) + 2 p 2 x d y d ] (3)
From image coordinates to pixel coordinates [ u v 1 ] = [ α γ u 0 0 β v 0 0 0 1 ] [ x d y d 1 ] (4)

2.2. Calibration of Structured Light Parameters

The calibration model of the structured light is shown in Figure 5. Here, AB is the intersection line between the light plane and the calibration board, P is a point on AB. The pixel coordinate of P can be extracted as described by Steger [14], and camera coordinates of P are determined using Equations (1)–(4). Different intersection lines can be obtained by turning the board, so Pij is the jth point on the intersection line when the board is in the ith position.
Setting the equation of the light plane under OCXCYCZC:
b 1 X C + b 2 Y C + b 3 Z C 1000 = 0
The parameters b1, b2, b3 can be determined by the objective function:
min i = 1 n j = 1 k b 1 X C j i + b 2 Y C j i + b 3 Z C j i 1000 = 0
where n is number of board turns, k is the number of sample points on the intersection line when the board is in the ith position, and (XiCj,YiCj, ZiCj) are camera coordinates of Pij. According to the principle of least squares, the coefficients of Equation (5) can be solved as:
[ b 1 b 2 b 3 ] = 1000 × [ i = 1 n j = 1 k X i c j 2 i = 1 n j = 1 k X i c j Y i c j i = 1 n j = 1 k X i c j Z i c j i = 1 n j = 1 k X i c j Y i c j i = 1 n j = 1 k Y i c j 2 i = 1 n j = 1 k Y i c j Z i c j i = 1 n j = 1 k X i c j Z i c j i = 1 n j = 1 k Y i c j Z i c j i = 1 n j = 1 k Z i c j 2 ] 1 [ i = 1 n j = 1 k X i c j i = 1 n j = 1 k Y i c j i = 1 n j = 1 k Z i c j ]
Because the camera parameters and coordinates of the sample points have errors, the coefficients obtained by Equation (7) will be used as initial values for optimizing the light plane. The objective function of the optimized plane is established by the distances between the points and the plane:
min i = 1 n j = 1 k | b 1 X C j i + b 2 Y C j i + b 3 Z C j i 1000 | b 1 2 + b 2 2 + b 3 2
The parameters of the plane can be obtained using the Levenberg-Marquardt algorithm. In the experiment, when the constant term of Equation (5) is 1, the parameters of the plane are small and the denominator of Equation (8) is around 0. To improve the optimization results, the constant term of Equation (5) is set at 1000 in the paper.

3. The Principle and Model of the Measurement

The model for measuring the shaft diameters is shown in Figure 6. A shaft is clamped at two centers, images of the shaft are captured by a CCD camera, п1 is the light plane, and MN is the axis of the shaft. The stripe ab is formed by projecting the light plane п1 onto the measured shaft. The pixel coordinates P i ( u p i , v p i ) i = 1 , 2 , ... , N of ab stripe centers are extracted by Steger’s algorithm. The virtual plane п2 perpendicular to the measured shaft is created and the normal vector of п2 is the directional vector of the axis MN. Although the position of the axis changes slightly every time a shaft is clamped, the direction of the axis does not change. Thus, the equation of the virtual plane п2 can be obtained in OCXCYCZC (see Appendix A for the details):
b 1 X C + b 2 Y C + b 3 Z C 1000 = 0
The arc cd is formed by the virtual plane п2 intersecting the measured shaft.
Figure 6. The measurement model of the shaft. (a) global view, (b) local view.
Figure 6. The measurement model of the shaft. (a) global view, (b) local view.
Sensors 15 19750 g006
Since the light plane п1 is not perpendicular to the shaft, the cross-section is an ellipse and the shaft diameter can be obtained by fitting the ellipse with stripe centers Pi. The elliptic equation is:
x 2 + A x y + B y 2 + C x + D y + E = 0
The parameters of Equation (10) can be obtained by the least squares method, and the length of the minor axis d is the measured shaft diameter:
d = 2 × 2 ( A C D B C 2 D 2 + 4 B E A 2 E ) ( A 2 4 B ) ( B + A 2 + ( 1 B ) 2 + 1 )
Since the virtual plane п2 is perpendicular to the shaft, the cross-section is a circle and the diameter can be obtained by fitting the circle with points Qi, which are Pi projecting on the virtual plane п2. The circle equation is
x 2 + y 2 + a x + b y + c = 0
The parameters of Equation (12) can be obtained by the least squares method, and the circle diameter d1 is the measured shaft diameter:
d 1 = 2 × a 2 + b 2 4 c 2
Since the pixel coordinates of the extracted stripe centers have errors, from the numerical analysis, the measuring accuracy of the shaft diameter by circle fitting is better than by ellipse fitting (see Appendix B for the detail).
The image coordinates P u i = ( x u i , y u i ) i = 1 , 2 , 3... N T of Pi can be achieved using Equations (3) and (4), so the equations of OCPi are:
{ X P = x u i Z P Y P = y u i Z P
The camera coordinates P i = ( X P i , Y P i , Z P i ) i = 1 , 2 , 3... N can be obtained using Equations (5) and (14):
{ X P i = 1000 × x u i / ( b 1 x u i + b 2 y u i + b 3 ) Y P i = 1000 × y u i / ( b 1 x u i + b 2 y u i + b 3 ) Z P i = 1000 × 1 / ( b 1 x u i + b 2 y u i + b 3 )
A set of lines PiQi are made by passing through the extracted centers P i and parallel to the measured shaft axis, as shown in Figure 6b. Since the axis MN is perpendicular to the plane п2, the direction vectors of the lines are the normal vector of п2, ( b 1 , b 2 , b 3 ) . Thus, the equations of lines PiQi are:
{ x X p 1 b 1 = y Y p 1 b 2 = z Z p 1 b 3 = t 1 x X p 2 b 1 = y Y p 2 b 2 = z Z p 2 b 3 = t 2 x X p N b 1 = y Y p N b 2 = z Z p N b 3 = t N
Each line PiQi has an intersection point Qi on the plane п2. The camera coordinates Q i ( x i , y i , z i ) i = 1 , 2 , 3... , N of the intersection points are obtained using Equations (9) and (16), respectively.
Figure 7. Oe—XeYeZe and OC—XCYCZC.
Figure 7. Oe—XeYeZe and OC—XCYCZC.
Sensors 15 19750 g007
To facilitate the circle fitting, a coordinate system (Oe—XeYeZe) is established on the plane п2, as shown in Figure 7. In Oe—XeYeZe, XeYe plane is the plane п2, OeZe axis is perpendicular to the plane п2, and the origin of coordinate Oe is the intersection point of the plane п2 with OCZC axis. Additionally, camera coordinates of the origin of Oe ( 0 , 0 , 1000 / b 3 ) can be obtained by Equation (9). Thus, translations of the camera coordinate system are ( 0 , 0 , 1000 / b 3 ) relative to Oe—XeYeZe and the camera coordinate Qi can be changed into Oe—XeYeZe by Equation (17):
[ x e i y e i z e i ] = [ 1 0 0 0 cos θ sin θ 0 sin θ cos θ ] [ cos ψ 0 sin ψ 0 1 0 sin ψ 0 cos ψ ] [ x i y i z i ] + [ 0 0 1000 / b 3 ]
where, ψ is the rotation angle round OCYC, θ is the rotation angle round OCXC, and Q e i = ( x e i , y e i , z e i ) are the coordinates of Q i in Oe—XeYeZe.
Normal vector n ¯ = ( b 1 , b 2 , b 3 ) T of the plane п2 is converted by the coordinate rotation into ( 0 , 0 , b 3 / a ) T in Oe-XeYeZe, where, a = ( b 1 ) 2 + ( b 2 ) 2 + ( b 3 ) 2 . Thus, n ¯ values before and after the conversion are substituted into Equation (18):
[ 0 0 b 3 / a ] = [ 1 0 0 0 cos θ sin θ 0 sin θ cos θ ] [ cos ψ 0 sin ψ 0 1 0 sin ψ 0 cos ψ ] [ b 1 b 2 b 3 ]
θ and ψ are obtained by Equation (18). In Oe-XeYeZe, because points Qi are on п2, the coordinates Qi are Q e i = ( x e i , y e i , 0 ) .
Since arc cd is at a side of the shaft and the coordinates of points Qi on cd have errors, the accuracy of the shaft diameter which is directly measured by fitting points on cd is poor, as shown in Figure 8. In Figure 8, the red circle is a cross-section formed by the virtual plane п2 intersecting with the shaft and Ow is the center of the red circle. The circle obtained by fitting the black points on cd is blue with its center at O. To improve the measuring accuracy, the center is determined by fitting black points under the geometrical constraints of arc cd, and the geometrical constraints for a circle center are shown in Figure 9.
In Figure 9a, A, B, C, D are the fitting points in the circle and O is the center. Point E is the intersection point of AC and BD. From the geometrical feature of a circle, the following relation holds:
A E * C E = B E * D E = r 2 O E 2
where r is radius of the shaft. Setting the center coordinate as (x0,y0), the coordinates of the points A, B, C, D are (xa,ya), (xb,yb), (xc,yc), (xd,yd). The coordinate (xe,ye) of point E can be obtained from points A, B, C, D. Thus, the first objective function can be presented as:
min i = 1 n D i + D D i
D i = ( x a i x e i ) 2 + ( y a i y e i ) 2 × ( x c i x e i ) 2 + ( y c i y e i ) 2 r 2 + ( x 0 x e i ) 2 + ( y 0 y e i ) 2
D D i = ( x b i x e i ) 2 + ( y b i y e i ) 2 × ( x d i x e i ) 2 + ( y d i y e i ) 2 r 2 + ( x 0 x e i ) 2 + ( y 0 y e i ) 2
where the value of r is estimated when optimizing Equation (20); n is number of the points.
Figure 8. Fitting circle by limited data.
Figure 8. Fitting circle by limited data.
Sensors 15 19750 g008
Figure 9. Geometrical features of a circle. (a) constraint condition1; (b) constraint condition2.
Figure 9. Geometrical features of a circle. (a) constraint condition1; (b) constraint condition2.
Sensors 15 19750 g009
As shown in Figure 9b, F is the midpoint of the chord L. Thus, line OF is perpendicular to the chord L and can be presented as:
min i = 1 n d i + d d i
d i = ( x 0 x a i + x c i 2 ) ( x a i x c i ) + ( y 0 y a i + y c i 2 ) ( y a i y c i )
d d i = ( x 0 x b i + x d i 2 ) ( x b i x d i ) + ( y 0 y b i + y d i 2 ) ( y b i y d i )
Therefore, the center coordinate can be determined by Equations (20) and (21):
min i = 1 n D i + D D i + d i + d d i
Minimizing Equation (22) is a nonlinear minimization problem, which can be solved by the Levenberg-Marquardt algorithm. The initial value of the center is obtained by fitting the circle with the points in cd.
Finally, the shaft diameter is obtained by the distance between the points in cd and the optimized center:
d = 2 × i = 1 n ( x i X 0 ) 2 + ( y i Y 0 ) 2 n
where d is the diameter of shaft, (xi,yi) are coordinates of the points in cd, (X0,Y0) is the coordinate of the optimized center, and n is the number of fitting points.

4. Experiments and Analysis

Experiments were conducted to assess the utility of the proposed method. The experimental equipment employed is shown in Figure 10 and the main parameters of the equipment are shown in Table 2. The interior parameters of the camera were calibrated by the method presented in Section 2. Two shafts were used in the experiments; shaft 1 was a four-segment shaft and the shaft surface’s reflection was reduced using a special process, as shown in Figure 10a. Shaft 2 was a seven-segment shaft, as shown in Figure 10b. The shafts’ diameters were measured using a micrometer with a resolution of 1 μm.
Figure 10. Experimental equipment for measuring shafts: (a) shaft 1; (b) shaft 2.
Figure 10. Experimental equipment for measuring shafts: (a) shaft 1; (b) shaft 2.
Sensors 15 19750 g010
Table 2. Experimental equipment parameters.
Table 2. Experimental equipment parameters.
EquipmentMold NO.Main Parameters
CCD cameraJAI CCD cameraResolution: 1376 × 1024
LensM0814-MPFocal length: 25 mm
Line projector LH650-80-3Wavelength: 650 nm
Mold plane CBC75mm-2.0Precision of the grid: 1 μm
First, the images of the shafts were captured using the camera, as shown in Figure 11. The diameters of the shafts were measured using the method described in Section 3. The measurement data are listed in Table 3 and Table 4, and the measurement error was less than 25 μm.
Figure 11. Images of stripes by camera: (a) shaft 1; (b) shaft 2.
Figure 11. Images of stripes by camera: (a) shaft 1; (b) shaft 2.
Sensors 15 19750 g011
Table 3. Measurement results for shaft 1 (mm).
Table 3. Measurement results for shaft 1 (mm).
NO.1234
Measurement results47.0539.74934.91529.796
Known values47.06239.7634.92429.8
Errors0.0120.0110.0090.004
Table 4. Measurement results for shaft 2 (mm).
Table 4. Measurement results for shaft 2 (mm).
NO.1234567
Measurement results24.76127.66131.45627.47424.59621.69620.091
Known values24.75327.66431.47327.49224.62121.68720.113
Errors0.0080.0030.0170.0180.0250.0090.022
To compare the proposed method with the other methods, the diameters of the shafts were obtained by directly fitting the ellipse and circle. The data for these methods are shown in Table 5 and Table 6. The measuring accuracy of the present method was found to be better than that of the other two methods.
Table 5. Comparison of the measured diameters in shaft1 (mm).
Table 5. Comparison of the measured diameters in shaft1 (mm).
NO.DFitting EllipseFitting CirclePresent Method
D1ErrorsD2ErrorsD3Errors
147.06246.9920.0747.0340.02847.050.012
239.7639.6590.10139.6980.06239.7490.011
334.92434.7730.15134.8270.09734.9150.009
429.829.7410.05929.730.0729.7960.004
Mean error 0.095 0.064 0.009
To test the influence of the angle between the light plane and cross-section of the shaft on the proposed method, the shaft diameters were measured by light planes with three different light angles, as shown in Figure 12. Measurement results are listed in Table 7 and Table 8.
Table 6. Comparison of the measured diameters in shaft 2 (mm).
Table 6. Comparison of the measured diameters in shaft 2 (mm).
NO.DFitting EllipseFitting CirclePresent Method
D1ErrorsD2ErrorsD3Errors
124.75324.2030.5524.620.13324.7610.008
227.66427.1930.47127.6320.03227.6610.003
331.47330.8770.59631.3950.07831.4560.017
427.49227.0980.39427.4150.07727.4740.018
524.62124.0970.52424.5120.10924.5960.025
621.68721.2240.46321.6240.06321.6960.009
720.11319.7050.40819.9350.17820.0910.022
Mean error 0.487 0.096 0.015
Figure 12. Images of stripes at three different angles.
Figure 12. Images of stripes at three different angles.
Sensors 15 19750 g012
From Table 7 and Table 8, the light angle appears to have very little effect on the measuring accuracy of the proposed method.
Table 7. Errors for different angles in shaft 1 (mm).
Table 7. Errors for different angles in shaft 1 (mm).
NO.1234Mean Error
a/Errors0.0120.0110.0090.0040.009
b/Errors0.0140.0120.0120.0120.013
c/Errors0.010.0160.0130.0080.012
Table 8. Errors for different angles in shaft 2 (mm).
Table 8. Errors for different angles in shaft 2 (mm).
NO.1234567Mean Error
a/Errors0.0080.0030.0170.0180.0250.0090.0220.015
b/Errors 0.0050.0070.0040.0160.0260.0130.0180.013
c/Errors0.0080.0130.0250.0170.0280.0090.0220.017
In order to test the influence of noise on the proposed method, noise with a variance of 0.01 and a mean of zero was added to the stripe images of shaft 1 and shaft 2, as shown in Figure 13 and Figure 14. The center coordinates of the stripe images with the added noise were extracted by Steger’s algorithm [14]. The shaft diameters can be determined respectively by the ellipse, circle, and the proposed method fitting the center coordinates. The results are listed in Table 9 and Figure 10.
Figure 13. Images of stripe on shaft 1. (a) normal; (b) added noise.
Figure 13. Images of stripe on shaft 1. (a) normal; (b) added noise.
Sensors 15 19750 g013
Figure 14. Images of stripe on shaft 2. (a) normal; (b) added noise.
Figure 14. Images of stripe on shaft 2. (a) normal; (b) added noise.
Sensors 15 19750 g014
Table 9. Measurement results for shaft 1 (mm).
Table 9. Measurement results for shaft 1 (mm).
DFitting EllipseFitting CirclePresent Method
D1ErrorsD2ErrorsD3Errors
Normal34.92434.9240.15134.8270.09734.9150.012
Added noise34.92434.8960.02834.8370.08734.9180.006
Δ D 0.123 0.01 0.003
Table 10. Measurement results for shaft 2 (mm).
Table 10. Measurement results for shaft 2 (mm).
DFitting EllipseFitting CirclePresent Method
D1ErrorsD2ErrorsD3Errors
Normal31.47330.8770.59631.3950.07831.4560.017
Added noise31.47330.7620.71131.4210.05231.470.003
Δ D 0.115 0.026 0.014
Here, the shaft diameters D were obtained by a micrometer, and Δ D is change of the shaft diameter measurements before and after the added noise. As seen in Table 9 and Table 10, the noise has little effect on the measuring accuracy of the proposed method.

5. Conclusions

A method for the measurement of shaft diameters is proposed which is based on a structured light vision measurement. A virtual plane is established perpendicular to the measured shaft axis and an equation for the virtual plane is determined using a calibrated model of structured light measurement. To improve the measurement accuracy, the center of the measured shaft can be obtained by fitting the projected light stripe image on the virtual plane under the geometrical constraints. Using specific experimental conditions, measurement errors of the method were less than 25 μm and the angle between the structured light plane and the measured shaft barely affected the measurement accuracy.

Acknowledgments

The work described in this paper is partially supported by the Foundation of Jilin Provincial Education Department under Grant 201591.

Author Contributions

Siyuan Liu proposed the algorithm, designed and performed experiments, and wrote the initial manuscript. Qingchang Tan conducted the analysis of the algorithm. Yachao Zhang performed experiments.

Conflicts of Interest

The authors declare no conflicts of interest.

Appendix A

Since the virtual plane п2 is perpendicular to the measured shaft, the direction vector of the axis is the normal vector of п2. As shown in Figure A1, the calibration board is fixed by fixtures, and they are clamped by the two centers and the connecting line of the two centers is the axis of the shaft MN. Turning the calibration board, the images of the board can be captured by a camera and MN is the intersecting line of the calibration board planes.
Figure A1. The model of the calibrating axis. (a) sketch map; (b) image of equipment.
Figure A1. The model of the calibrating axis. (a) sketch map; (b) image of equipment.
Sensors 15 19750 g015
Based on Equation (1), Equation (A1) can be obtained:
R j 1 [ X C t 1 j Y C t 2 j Z C t 3 j ] = [ X W j Y W j Z W j ]
Set to R j 1 = D j = [ d 11 j d 12 j d 13 j d 21 j d 22 j d 23 j d 31 j d 32 j d 33 j ] , where, Rj and tj are the rotation matrix and translation vector of the calibration target at the jth position and can be obtained by the method provided in Section 2, j = 1,2. Since world coordinate systems OjWXjWYjWZjW are built on the calibration target plane, Zjw = 0. The equation of the calibration target plane at the jth position is:
d 31 j X C + d 32 j Y C + d 33 j Z C = d 31 j t 1 j + d 32 j t 2 j + d 33 j t 3 j
The normal vector of the plane is S j = ( d 31 j , d 32 j , d 33 j ) . MN is the intersecting line of the two planes, so the direction vector of MN can be represented as:
S M N = ( d x , d y , d z ) = S 1 × S 2 = ( d 32 1 d 33 2 d 33 1 d 32 2 , d 33 1 d 31 2 d 31 1 d 33 2 , d 31 1 d 32 2 d 32 1 d 31 2 )
As shown in Figure 6, Or is a point in п2 and set Or is the intersection point of MN and п1, and the camera coordinate of Or is Or = (Xr,Yr,Zr).
The equation of п2 in OCXCYCZC is
d x ( X C X r ) + d y ( Y C Y r ) + d z ( Z C Z r ) = 0
Thus, equation parameters of the virtual plane can be obtained using Equations (9) and (A4):
{ b 1 = 1000 × d x / ( d x X r + d y Y r + d z Z r ) b 2 = 1000 × d y / ( d x X r + d y Y r + d z Z r ) b 3 = 1000 × d z / ( d x X r + d y Y r + d z Z r )

Appendix B

Q e i are the points for circle fitting, and the coordinates Q e i = ( x e i , y e i ) i = 1 , 2 , 3... , N can be obtained by Equation (17). The coordinates Q e i are substituted into Equation (12). Then Equation (12) is handled by the principle of least squares as:
A 1 x ¯ 1 = b 1
where, A 1 = [ i = 1 N ( x e i ) 2 i = 1 N x e i y e i i = 1 N x e i i = 1 N x e i y e i i = 1 N ( y e i ) 2 i = 1 N y e i i = 1 N x e i                       i = 1 N y e i                               i = 1 N 1           ] , b 1 = [ i = 1 N ( x e i ) 3 + x e i ( y e i ) 2 i = 1 N ( x e i ) 2 y e i + ( y e i ) 3 i = 1 N ( x e i ) 2 + ( y e i ) 2                 ] , x ¯ 1 = [ a b c ] .
Using x ¯ 1 obtained by Equation (B1), the measured shaft diameter can be obtained by Equation (13).
The coordinates of points for ellipse fitting are P t i = ( x t i , y t i ) i = 1 , 2 , 3... , N . To facilitate the ellipse fitting, a new coordinate system is established on the structured light plane п1, and the camera coordinates P i can be converted into P t i = ( x t i , y t i ) i = 1 , 2 , 3... , N in the coordinate system. The coordinates P t i are substituted into Equation (10). Then Equation (10) is handled by the principle of least squares as:
A 2 x ¯ 2 = b 2
where, A 2 = [ i = 1 N ( x t i ) 2 ( y t i ) 2 i = 1 N x t i ( y t i ) 3 i = 1 N ( x t i ) 2 y t i i = 1 N x t i ( y t i ) 2 i = 1 N x t i y t i i = 1 N x t i ( y t i ) 3                             i = 1 N ( y t i ) 4                       i = 1 N x t i ( y t i ) 2 i = 1 N ( y t i ) 3               i = 1 N ( y t i ) 2 i = 1 N ( x t i ) 2 y t i                               i = 1 N x t i ( y t i ) 2 i = 1 N ( x t i ) 2                     i = 1 N x t i y t i                     i = 1 N x t i i = 1 N x t i ( y t i ) 2                             i = 1 N ( y t i ) 3                   i = 1 N x t i y t i                           i = 1 N ( y t i ) 2               i = 1 N y t i i = 1 N x t i y t i                                                       i = 1 N ( y t i ) 2                     i = 1 N x t i                                         i = 1 N y t i                                       i = 1 N 1 ] , b 2 = [ i = 1 N ( x t i ) 3 y t i i = 1 N ( x t i ) 2 ( y t i ) 2 i = 1 N ( x t i ) 3                       i = 1 N ( x t i ) 2 y t i   i = 1 N ( x t i ) 2                     ] , x ¯ 2 = [ A B C D E ] .
Using x ¯ 2 obtained by Equation (B2), the measured shaft diameter can be obtained by Equation (11).
Since the matrixes (A1, A2) and the vectors (b1,b2) in Equations (B1) and (B2) consist of the coordinates of the light stripe centers, the matrixes and vectors are influenced by errors of the light stripe centers’ coordinates, which show that x ¯ 1 and x ¯ 2 are inaccurate. From Numerical Analysis (Seventh Edition) by Burden and Faires [15], the influence is analyzed as shown below.
Considering the errors of the light stripe centers’ coordinates, matrix A1 and vector b1 in Equation (B1) are expressed as:
A 1 = A 1 + δ A 1   ;     b 1 = b 1 + δ b 1
where δ A 1 and δ b 1 are caused by errors of the light stripe centers’ coordinates. Thus, x ¯ 1 in Equation (B1) becomes x ¯ 1 = x ¯ 1 + δ x ¯ 1 , and Equation (B1) can be expressed as:
( A 1 + δ A 1 ) ( x ¯ 1 + δ x ¯ 1 ) = ( b 1 + δ b 1 )
( A 1 + δ A 1 ) x ¯ 1 + ( A 1 + δ A 1 ) δ x ¯ 1 = b + δ b 1
( A 1 + δ A 1 ) δ x ¯ 1 = δ b 1 δ A 1 x ¯ 1
Set ( A 1 + δ A 1 ) is an invertible matrix, and from Equation (B4) we get:
δ x ¯ 1 = ( A 1 + δ A 1 ) 1 ( δ b 1 δ A 1 x ¯ 1 )
In order to analyze the error of the fitting circle equation’s parameters, the norm of Equation (B5) is:
δ x 1 ( A 1 + δ A 1 ) 1 δ b 1 δ A 1 x ¯ 1
where δ x 1 is error of the circle equation’s parameters x ¯ 1 obtained by the circle fitting.
In the same way, the error of the equation’s parameters x ¯ 2 for the ellipse fitting can be obtained by Equation (B2)
δ x 2 ( A 2 + δ A 2 ) 1 δ b 2 δ A 2 x ¯ 2
From Equations (B1) and (B2), ( A 1 + δ A 1 ) 1 and ( A 2 + δ A 2 ) 1 can be calculated by the light stripe centers’ coordinates.
When the measured shaft diameter is 24.753 mm, ( A 1 + δ A 1 ) 1 2 and ( A 2 + δ A 2 ) 1 2 can be calculated by the coordinates of the light stripe centers.
( A 1 + δ A 1 ) 1 2 = 27.04
( A 2 + δ A 2 ) 1 2 = 2454.06
So
δ x 1 2 27.04 δ b 1 δ A 1 x ¯ 1 2
δ x 2 2 2454.06 δ b 2 δ A 2 x ¯ 2 2
From Equations (B8) and (B9), δ b 2 δ A 2 x ¯ 2 2 must be very small if δ x 2 2 δ x 1 2 . From Equation (B4), δ b 2 δ A 2 x ¯ 2 cannot be a zero vector. So, a very small δ b 2 δ A 2 x ¯ 2 2 requires that the absolute values of elements in the matrices δ A 2 and the vector δ b 2 must be very small. This shows that the errors of the light stripe centers’ coordinates for the ellipse fitting must be smaller than the ones for the circle fitting. On the other hand, if the coordinate errors of the light stripe centers for the circle fitting are the same as those for the ellipse fitting, the error of the circle equation parameters obtained by the circle fitting is smaller than the one of the ellipse equation parameters obtained by the ellipse fitting. From Equations (11) and (13), the measuring accuracy of the shaft diameter by circle fitting is better than by ellipse fitting. When the measured shaft diameter is 27.664 mm, ( A 1 + δ A 1 ) 1 2 = 19.03 and ( A 2 + δ A 2 ) 1 2 = 1670.7 , the same results can be obtained.

References

  1. Takesa, K.; Sato, H.; Tani, Y.; Sata, T. Measurement of diameter using charge coupled device (CCD). CIRP Ann. Manuf. Technol. 1984, 33, 377–381. [Google Scholar] [CrossRef]
  2. Butler, D.J.; Forbes, G.W. Fiber-diameter measurement by occlusion of a Gaussian beam. Appl. Opt. 1998, 37, 2598–2607. [Google Scholar] [CrossRef] [PubMed]
  3. Lemeshko, Y.A.; Chugui, Y.V.; Yarovaya, A.K. Precision dimensional inspection of diameters of circular reflecting cylinders. Optoelectron. Instrum. Data Process 2007, 43, 284–291. [Google Scholar] [CrossRef]
  4. Xu, Y.; Sasaki, O.; Suzuki, T. Double-grating interferometer for measurement of cylinder diameters. Appl. Opt. 2004, 43, 537–541. [Google Scholar] [CrossRef] [PubMed]
  5. Song, Q.; Zhu, S.; Yan, H.; Wu, W. Signal processing method of the diameter measurement system based on CCD parallel light projection method. Proc. SPIE 2007, 6829. [Google Scholar] [CrossRef]
  6. Wei, G.; Tan, Q. Measurement of shaft diameters by machine vision. Appl. Opt. 2011, 50, 3246–3253. [Google Scholar] [CrossRef] [PubMed]
  7. Sun, Q.; Hou, Y.; Tan, Q. A Planar-Dimensions Machine Vision Measurement Method Based on Lens Distortion Correction. Sci. World J. Opt. 2013, 2013, 1–6. [Google Scholar] [CrossRef] [PubMed]
  8. Song, Q.; Wu, D.; Liu, J.; Zhang, C.; Huang, J. Instrumentation design and precision analysis of the external diameter measurement system based on CCD parallel light projection method. Proc. SPIE 2008, 7156. [Google Scholar] [CrossRef]
  9. Sun, Q.; Hou, Y.; Tan, Q.; Li, C. Shaft diameter measurement using a digital image. Opt. Lasers Eng. 2014, 55, 183–188. [Google Scholar] [CrossRef]
  10. Sun, Q.; You, Q.; Qiu, Y.; Ye, S. Online machine vision method for measuring the diameter and straightness of seamless steel pipes. Opt. Eng. 2001, 40, 2565–2571. [Google Scholar] [CrossRef]
  11. Liu, B.; Wang, P.; Zeng, Y.; Sun, C. Measuring method for micro-diameter based on structured-light vision technology. Chin. Opt. Lett. 2009, 8, 666–669. [Google Scholar]
  12. Zhang, Z. A flexible new technique for camera calibration. IEEE Trans. Pattern Anal. Mach. Intell. 2000, 22, 1330–1334. [Google Scholar] [CrossRef]
  13. More, J. The Levenberg-Marquardt Algorithm, Implementation and Theory. In Numerical Analysis; Springer: Berlin, Germany, 1977. [Google Scholar]
  14. Steger, C. An unbiased detector of curvilinear structures. IEEE Trans. Pattern Anal. Mach. Intell. 1998, 20, 113–125. [Google Scholar] [CrossRef]
  15. Burden, R.L.; Faires, J.D. Numerical Analysis, 7th ed.; Thomson Learning: Belmont, CA, USA, 2001; p. 461. [Google Scholar]

Share and Cite

MDPI and ACS Style

Liu, S.; Tan, Q.; Zhang, Y. Shaft Diameter Measurement Using Structured Light Vision. Sensors 2015, 15, 19750-19767. https://doi.org/10.3390/s150819750

AMA Style

Liu S, Tan Q, Zhang Y. Shaft Diameter Measurement Using Structured Light Vision. Sensors. 2015; 15(8):19750-19767. https://doi.org/10.3390/s150819750

Chicago/Turabian Style

Liu, Siyuan, Qingchang Tan, and Yachao Zhang. 2015. "Shaft Diameter Measurement Using Structured Light Vision" Sensors 15, no. 8: 19750-19767. https://doi.org/10.3390/s150819750

Article Metrics

Back to TopTop