Research on Measurement System of Spur Cylindrical Gear Parameters Based on Vision

Gears are fundamental transmission components widely employed in fields such as equipment manufacturing, instrumentation, and aerospace. The quality of gear machining directly impacts equipment performance and service life. Precise measurement of gears is therefore crucial for ensuring proper device functionality. Traditional contact measurement methods, while accurate, often suffer from low efficiency, high cost, and incompatibility with automated production lines. Vision-based measurement methods have emerged as a significant trend, offering non-contact, efficient, and automated inspection capabilities. This study focuses on the measurement of basic geometric parameters and single-flank deviations of spur cylindrical gears. A comprehensive measurement system based on machine vision is developed, and key technologies including system calibration, auto-focusing, image processing, and edge detection are investigated. The main research contents are as follows.

Firstly, the overall design of the measurement system was completed based on the requirements for spur cylindrical gear parameter inspection. Hardware components, including an industrial camera, lens, lighting sources, and motion control modules, were selected and integrated. The software development environment was established using MATLAB. Key pre-measurement procedures were implemented, including lens distortion correction and pixel equivalent calibration. The influence of the camera’s installation perpendicularity error was analyzed, and an adjustment method based on the area of calibration circles was proposed. Furthermore, the impact of illumination intensity on edge positioning accuracy was investigated, and a corresponding compensation method was developed to enhance measurement precision.

Secondly, to address the inefficiency of manual focusing, an auto-focusing function based on image processing was developed. The principle of passive auto-focusing was introduced. Among various spatial-domain sharpness evaluation functions, an improved Brenner function was proposed by incorporating convolution templates in multiple directions (horizontal, vertical, and diagonal). Experiments demonstrated that the improved function exhibits better unimodality, stability, and noise resistance. For searching the optimal focus position, a novel coarse-fine search algorithm was proposed. The coarse-tuning stage employs Gaussian curve fitting on a set of images captured with a large step size to estimate the approximate peak region. The fine-tuning stage then utilizes a hill-climbing search with adaptive step size reduction within this region to locate the precise best focus position. This hybrid algorithm effectively mitigates the risk of converging to local extrema, a common pitfall of traditional hill-climbing methods.

Thirdly, image preprocessing and edge detection algorithms were studied. For preprocessing, median filtering was chosen for noise reduction due to its effectiveness against salt-and-pepper noise while preserving edges. Otsu’s method was selected for image segmentation (thresholding). For pixel-level edge detection, various operators (Roberts, Sobel, Prewitt, Laplacian, LOG, Canny) were compared. The Canny operator was selected for its superior performance in achieving thin, continuous edges with good noise immunity. To achieve sub-pixel measurement accuracy, an optimized Zernike moment-based sub-pixel edge detection algorithm was proposed. The optimization included using the Canny operator for coarse pixel-level edge localization first, thereby reducing computational load. The traditional Zernike moment template was expanded from 5×5 to 7×7, and Otsu’s method was applied to automatically determine the optimal step-edge threshold. Experimental comparisons on both synthetic and real images confirmed that the optimized algorithm offers higher localization accuracy and faster computation compared to the traditional Zernike method and pixel-level Canny detection.

Finally, specific measurement algorithms for spur cylindrical gear parameters were designed and implemented. For basic geometric parameters, algorithms were developed for measuring the addendum circle diameter, root circle diameter, number of teeth, module, and pitch circle diameter. The process involves edge detection, circle fitting, and logical operations for tooth counting. For single-flank deviations, algorithms were designed to measure tooth profile total deviation ($$F_\alpha$$), single pitch deviation ($$f_{pt}$$), k-pitch cumulative deviation ($$F_{pk}$$), and total cumulative pitch deviation ($$F_p$$). The theoretical involute equation forms the basis for $$F_\alpha$$ calculation. The intersection points between the pitch circle and the gear profile are accurately located using a DBSCAN clustering algorithm on sub-pixel edge points near the pitch circle, enabling precise calculation of angular pitch values.

Experimental verification was conducted. A physical measurement platform was built. The system’s measurement repeatability was validated. The measurement results for both basic parameters and single-flank deviations were compared against those obtained from a professional gear measurement center. The basic geometric parameters measured by the proposed system showed good agreement, with errors on the order of 0.03 mm. For single-flank deviations, the system’s results were also consistent, successfully determining the gear’s accuracy grade as 9, which matched the result from the gear measurement center and fell within the tolerance specified by the standard for 9-grade cylindrical gears. The main sources of error were analyzed, including hardware limitations (camera resolution, lens distortion, mechanical vibration), algorithmic approximations, and environmental factors.

In conclusion, this research successfully designed and implemented a vision-based measurement system for spur cylindrical gear parameters. The work addressed key technical challenges: system calibration and error compensation, development of a robust auto-focusing function, implementation of high-precision sub-pixel edge detection, and design of algorithms for specific gear parameter evaluation. The system provides a non-contact, efficient, and cost-effective solution for quality inspection of spur cylindrical gears, demonstrating satisfactory accuracy for industrial applications. Future work may focus on extending the system’s capability to measure other types of cylindrical gears, such as helical gears, and optimizing algorithms or upgrading hardware to accommodate gears with larger modules.

System Hardware Composition and Calibration

The performance of a vision-based measurement system for cylindrical gears hinges on proper hardware selection and meticulous system calibration. The hardware primarily consists of an industrial camera, lens, lighting system, and mechanical motion stage.

The camera chosen was a MER-630-60U3C monochrome CMOS camera with a resolution of 3088 × 2064 pixels and a pixel size of 2.4 µm. A Computar H0514-MP2 lens with a 5 mm focal length and C-mount was selected. To ensure high-contrast images suitable for both auto-focusing and edge detection, a combined lighting scheme was adopted: a parallel backlight (OPT-FL175175-W) to silhouette the gear edges and a forward ring light (BP45) to illuminate the gear face and reduce shadows. A ball screw stage (PX1204-200) driven by a stepper motor was used to adjust the camera’s position for auto-focusing, controlled via an Arduino UNO R3 board.

Component Model/Specification Key Parameter
Camera MER-630-60U3C Resolution: 3088×2064, Pixel Size: 2.4µm
Lens H0514-MP2 Focal Length: 5mm, Mount: C
Backlight OPT-FL175175-W Parallel Light Source
Ring Light BP45 Forward Illumination
Motion Stage PX1204-200 Travel: 200mm, Lead: 4mm

System calibration involved two critical steps: camera intrinsic parameter estimation with lens distortion correction, and pixel equivalent calibration. The camera pinhole model and distortion model were used. For a point in world coordinates $$(X_w, Y_w, Z_w)^T$$ and its corresponding pixel coordinates $$(u, v)^T$$, the relationship is given by:

$$ s \begin{bmatrix} u \\ v \\ 1 \end{bmatrix} = \begin{bmatrix} f_x & 0 & c_x \\ 0 & f_y & c_y \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} r_{11} & r_{12} & r_{13} & t_x \\ r_{21} & r_{22} & r_{23} & t_y \\ r_{31} & r_{32} & r_{33} & t_z \end{bmatrix} \begin{bmatrix} X_w \\ Y_w \\ Z_w \\ 1 \end{bmatrix} $$

where $$f_x, f_y$$ are focal lengths in pixels, $$(c_x, c_y)$$ is the principal point, and $$[R | t]$$ is the rotation and translation matrix. Lens distortion, including radial ($$k_1, k_2, k_3$$) and tangential ($$p_1, p_2$$) components, was modeled. Using a checkerboard calibration target and the MATLAB Camera Calibrator toolbox, these parameters were estimated. Distortion correction was then applied to all subsequent images.

Pixel equivalent ($$K$$, mm/pixel) defines the physical size represented by one pixel. Instead of measuring circle diameters which are sensitive to edge location errors from lighting, the distance between centers of adjacent circles on a precision dot-pattern target was used as a more stable feature. For a target with known physical center distance $$L$$, the pixel distance $$l_i$$ between fitted circle centers was measured. The pixel equivalent is the average ratio:

$$ K = \frac{1}{n} \sum_{i=1}^{n} \frac{L}{l_i} $$

Calibration results yielded $$K = 0.0864$$ mm/pixel. The influence of lighting intensity on the systematic edge positioning error was also quantified. By measuring the apparent diameter of calibration circles under different illumination levels, a compensation value $$\Delta$$ was derived: $$\Delta = (D – d \cdot K)/2$$, where $$D$$ is the theoretical diameter. Optimal lighting levels were determined (backlight at level 11, ring light at level 4) where the compensation was minimal and stable (≈0.0059 mm), and this value was applied to subsequent gear measurements.

Auto-Focusing Based on Image Processing

Obtaining a sharp in-focus image is paramount for accurate edge detection of cylindrical gears. The auto-focusing process involves evaluating a sequence of images captured at different axial positions and finding the position that maximizes a focus measure (sharpness evaluation function).

The improved Brenner function was selected as the focus measure. The traditional Brenner function calculates the squared difference between a pixel and its neighbor two steps away horizontally: $$F = \sum (I(x+2, y) – I(x, y))^2$$. The improved version extends this gradient calculation to four directions using convolution templates $$M_1$$ to $$M_4$$:

$$ M_1 = [-1, 0, 1], \quad M_2 = \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}, \quad M_3 = \begin{bmatrix} -1 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad M_4 = \begin{bmatrix} 0 & 0 & 1 \\ 0 & 0 & 0 \\ 1 & 0 & 0 \end{bmatrix} $$

$$ F = \sum \left[ (M_1 * I)^2 + (M_2 * I)^2 + (M_3 * I)^2 + (M_4 * I)^2 \right] $$

Experiments confirmed its superior unimodality, high sensitivity, and better noise immunity compared to other improved functions (Energy Gradient, Tenengrad, Laplace).

The search for the best focus position uses a two-stage strategy. Coarse Tuning: Starting from an initial position, nine images are captured at a large, fixed step size (e.g., 3 mm). The sharpness values are fitted with a Gaussian curve $$G(x) = a \cdot \exp\left(-\frac{(x-b)^2}{2c^2}\right) + d$$. The peak position $$b$$ of the fitted curve provides an estimate of the optimal focus zone. Fine Tuning: A hill-climbing search is performed within a small interval (e.g., $$b \pm 1.5$$ mm) around the coarse estimate. The search starts with a medium step size, reverses direction when sharpness decreases, and halves the step size after each overshoot. The search stops when the step size reduces below a threshold (e.g., 0.01 mm). This hybrid method efficiently and reliably locates the global sharpness peak for different cylindrical gears.

Focusing Method Key Algorithm Advantage
Proposed Method Gaussian Fit (Coarse) + Hill-Climbing (Fine) Avoids local extrema, efficient, reliable.
Traditional Hill-Climbing Hill-Climbing Search only Simple, but prone to local extrema.
Curve Fitting Polynomial/Gaussian Fit on full/partial data Fast, but accuracy depends on sampled points.

Sub-Pixel Edge Detection for Cylindrical Gears

Accurate measurement of cylindrical gear parameters requires edge detection precision beyond the pixel level. The process involves image preprocessing, pixel-level edge detection, and sub-pixel refinement.

Preprocessing steps include grayscale conversion, median filtering (using a 3×3 window) to remove noise while preserving edges, and image binarization using Otsu’s automatic thresholding method to separate the gear from the background.

For pixel-level edge detection, the Canny operator is employed due to its optimal performance in achieving thin, continuous edges with good localization and noise suppression. It involves Gaussian filtering, gradient magnitude and direction calculation, non-maximum suppression, and hysteresis thresholding.

For sub-pixel localization, an optimized Zernike moment method is used. The ideal step-edge model is characterized by four parameters: background intensity $$h$$, step height $$k$$, perpendicular distance $$l$$ from the pixel center to the edge, and edge angle $$\phi$$. The complex Zernike moments $$Z’_{nm}$$ of the rotated ideal edge model have closed-form expressions. For a 7×7 convolution template, the relationship between the calculated moments $$Z_{nm}$$ of the image and the edge parameters can be derived. The parameters are solved as follows, where $$\text{Re}$$ and $$\text{Im}$$ denote real and imaginary parts:

$$ \phi = \arctan\left(\frac{\text{Im}(Z_{11})}{\text{Re}(Z_{11})}\right) $$

$$ l_1 = \frac{Z_{00}}{|Z_{11}|}, \quad l_2 = \frac{5|Z_{40}| – 3|Z_{20}|}{8|Z_{20}|}, \quad l = \frac{l_1 + l_2}{2} $$

$$ k = \frac{3|Z_{11}|}{2(1-l^2)^{3/2}} $$

$$ h = \frac{Z_{00} – k\left[\frac{\pi}{2} – \arcsin(l) – l\sqrt{1-l^2}\right]}{\pi} $$

A pixel is considered an edge candidate if $$k$$ is greater than an automatically determined threshold (using Otsu’s method on the calculated $$k$$-map). The sub-pixel edge coordinates $$(x_s, y_s)$$ for a candidate pixel at $$(x, y)$$ are then calculated, considering the template scale factor $$N/2$$ (where $$N=7$$):

$$ \begin{bmatrix} x_s \\ y_s \end{bmatrix} = \begin{bmatrix} x \\ y \end{bmatrix} + \frac{N}{2} l \begin{bmatrix} \cos \phi \\ \sin \phi \end{bmatrix} $$

The optimization includes using Canny’s output to restrict Zernike moment calculation only to potential edge regions, speeding up the process. Experiments on a synthetic square image and a real circular artifact showed the optimized algorithm achieved sub-pixel localization errors below 0.3 pixels and produced more accurate physical dimension measurements compared to the pixel-level Canny and traditional Zernike methods.

Measurement Algorithms and Experimental Results

The core measurement algorithms for spur cylindrical gears are designed based on their geometric definitions and the obtained sub-pixel edge points.

Basic Geometric Parameters:
1. Addendum and Root Circle Diameters: After extracting all sub-pixel edge points, the point pair with the maximum Euclidean distance is found. The points whose mutual distances are near this maximum are selected as addendum edge points and fitted to a circle using the least squares method to obtain the addendum circle diameter $$d_a$$ and center. The root circle diameter $$d_f$$ is found similarly by selecting points with minimum distance to the gear center.
2. Number of Teeth (z): A circular mask with a radius between the addendum and root circles is applied to the inverted binary gear image. The number of connected components (teeth) within this mask is counted.
3. Module (m) and Pitch Diameter (d): The module is estimated from $$d_a$$ and $$d_f$$: $$m’ = \frac{1}{2}\left( \frac{d_a}{z+2} + \frac{d_f}{z-2.5} \right)$$. The standard module $$m$$ closest to $$m’$$ is selected. The pitch diameter is then $$d = m \cdot z$$.

Single Flank Deviations:
1. Tooth Profile Total Deviation ($$F_\alpha$$): For points on a tooth flank, the angle $$\angle AOD$$ between the line from the gear center to the point and a reference line is calculated using the involute function and point coordinates. The difference between the maximum and minimum $$\angle AOD$$ on the evaluated profile, multiplied by the base circle radius $$r_b$$, gives $$F_\alpha$$. $$r_b = \frac{m z \cos \alpha}{2}$$, where $$\alpha$$ is the pressure angle (20°).
2. Pitch Deviations: The intersection points between the pitch circle and all tooth flanks are found by clustering edge points near the pitch circle radius using DBSCAN. The central angle $$\beta_i$$ between adjacent left (or right) flank intersection points is computed. The actual pitch is $$p_i = \frac{d}{2} \cdot \beta_i$$ (in radian measure). The single pitch deviation is $$f_{pt_i} = p_i – \pi m$$. The k-pitch cumulative deviation is $$F_{pk} = \sum_{j=i}^{i+k-1} f_{pt_j}$$. The total cumulative pitch deviation is $$F_p = \max(f_{pt}) – \min(f_{pt})$$.

Experimental results for a gear (z=20, m=3 mm) are summarized below. The system’s measurements were compared against a gear measurement center (GMC).

Table: Measurement Results for Basic Geometric Parameters (in mm)
Parameter Design Value Proposed System GMC Result Absolute Error
Addendum Diameter ($$d_a$$) 66.0000 66.0261 66.0129 0.0132
Root Diameter ($$d_f$$) 52.5000 52.5307 52.5134 0.0173
Pitch Diameter ($$d$$) 60.0000 60.0000* 60.0000* 0.0000

* Calculated from the standard module m=3 and z=20.

Table: Measurement Results for Single Flank Deviations (Maximum absolute values in mm)
Deviation Type Left Flank (Proposed) Left Flank (GMC) Right Flank (Proposed) Right Flank (GMC)
Profile Total Dev. ($$F_\alpha$$) 0.0305 0.0221 0.0314 0.0185
Single Pitch Dev. ($$|f_{pt}|$$) 0.0228 0.0171 0.0225 0.0134
k-Pitch Cum. Dev. ($$|F_{pk}|$$) 0.0418 0.0187 0.0444 0.0205
Total Cum. Pitch Dev. ($$F_p$$) 0.0455 0.0303 0.0450 0.0276

Based on the measured deviations and ISO 1328-1:2013 limits, the gear was rated as accuracy grade 9 by both the proposed system and the GMC, confirming the system’s practical usability for quality assessment of spur cylindrical gears. Repeatability tests showed standard deviations for key deviations were below 0.01 mm. Error sources include residual lens distortion, mechanical vibration, illumination instability, and approximations in the algorithmic models.

Scroll to Top