In modern manufacturing, the production of fine-pitch spur gears often involves multiple machines on a single line simultaneously producing gears with different parameters. However, existing gear measurement instruments cannot perform real-time, full inspection of these diverse spur gears in a mixed production environment without prior knowledge of their specifications. This limitation stems from the need for input parameters such as modulus, number of teeth, and pressure angle in traditional contact-based methods, which are inefficient and impractical for small-module spur gears due to their miniature size and tight tooth spaces. To address this, we have developed a vision-based approach that enables parameter-free, parallel, and rapid measurement of spur gears, leveraging advanced image processing techniques and gear design theory. This method eliminates the need for clamping or predefined parameters, making it ideal for flexible production lines.
Our approach integrates several innovative image processing algorithms tailored for spur gears. First, we employ multi-target segmentation to isolate individual spur gears in a single field of view, allowing parallel measurement of multiple gears. This is achieved through threshold segmentation under backlight illumination, which produces clear contours with minimal noise. Each spur gear is enclosed by a minimum bounding circle, creating distinct regions for analysis. Next, we implement a subpixel edge localization algorithm based on the Facet model, which fits a bicubic polynomial to the grayscale distribution in a neighborhood around pixel-level edges extracted by the Canny operator. The gradient direction and magnitude are computed to refine edge positions, achieving a subpixel accuracy of 0.46 pixels, significantly higher than pixel-level methods. This precision is crucial for accurately capturing the contours of spur gears, which are essential for parameter calculation.
To determine the center of each spur gear, we use an iterative reweighted least squares method for circle fitting applied to the inner hole contour. This approach minimizes the influence of outliers, such as dust or burrs, by assigning weights based on the Huber function. The optimization target is to minimize the sum of squared errors between the fitted circle and the subpixel edge points. The center coordinates and radius are derived as follows: for a circle equation $(x – x_0)^2 + (y – y_0)^2 = r^2$, the coefficients A, B, and C are solved iteratively, where $A = -2x_0$, $B = -2y_0$, and $C = x_0^2 + y_0^2 – r^2$. The weight function $w(\delta)$ is defined as $w(\delta) = 1$ for $|\delta| \leq \gamma$ and $w(\delta) = \gamma / |\delta|$ for $|\delta| > \gamma$, with $\delta$ representing the distance from points to the circle center. This method ensures robust center localization, which serves as the reference for subsequent measurements.
Key to our parameter extraction is the fast localization of intersections between circles and tooth profiles. We overlay two images: one with the gear contour and another with a reference circle (e.g., pitch circle). The intersection points are identified based on grayscale values, with three possible cases: direct overlap (grayscale 160), adjacent points forming a square (grayscale 80), or diagonal connections (grayscale 160). These intersections are used to segment the contour into tooth tips, profiles, and roots, enabling precise measurement of gear parameters. For example, the number of teeth for spur gears can be determined by counting the intersections between the pitch circle and tooth profiles, where each pair of left and right profile intersections corresponds to one tooth. Alternatively, we propose a sine fitting method that transforms the gear contour into polar coordinates and fits a sinusoidal function $a \sin(\omega x + \phi) + b$ to the periodic pattern, with the number of teeth calculated as $z = T / T_0$, where $T$ is the total horizontal coordinate length and $T_0 = 2\pi / \omega$ is the fitted period.

The modulus of spur gears is estimated from the whole tooth depth $h$, as it remains constant regardless of modification. For standard spur gears with addendum coefficient $h_a^* = 1$ and clearance coefficient $c^* = 0.25$, the modulus is calculated as $m = h / 2.25$. This value is then standardized to the nearest standard modulus for fine-pitch spur gears. Pressure angle measurement involves two methods: formula-based and profile approximation. The formula method uses the average pitch circle tooth thickness $s_0$ and modification coefficient $x$, with $\alpha = \arctan[(s_0 / m – \pi / 2) / (2x)]$ for positive modification and $\alpha = \arctan[(\pi / 2 – s_0 / m) / (2x)]$ for negative modification. The profile approximation method iterates pressure angles from 14.5° to 25°, computes the base circle radius $r_b = r \cos \alpha$, and finds the intersection with tooth profiles. The theoretical involute is generated, and the residual sum of squares between actual and theoretical profiles is minimized to determine the optimal pressure angle.
Other geometric parameters for spur gears, such as tip diameter $d_a$, root diameter $d_f$, inner hole diameter $d_o$, whole tooth depth $h$, and tooth width $b$, are directly extracted from the subpixel contours. For base tangent length measurement, which reflects gear motion eccentricity, we first determine the span number of teeth $k$ as $k = \frac{\alpha}{180} \cdot z + 0.5$ (rounded). The base tangent length $W_k$ for non-modified spur gears is given by $W_k = m \cos \alpha [\pi (k – 0.5) + z \cdot \text{inv} \alpha]$, where $\text{inv} \alpha$ is the involute function. For modified spur gears, it becomes $W_k’ = W_k + 2 \cdot x \cdot m \cdot \sin \alpha$. The variation in base tangent length $F_w$ is the difference between maximum and minimum values across teeth: $F_w = W_{k,\text{max}} – W_{k,\text{min}}$.
The modification coefficient $x$ for spur gears is calculated using the tip circle radius $r_a$ as $x = (r_a – r + h_a^*) / m$, which provides higher accuracy than methods based on the root circle due to better machining precision at the tip. Profile modification analysis involves computing the deviation between actual and theoretical involute profiles. For a point $A(x_i, y_i)$ on the actual profile, the deviation is the perpendicular distance to the theoretical involute, derived as $|AP| = r_b \cdot \theta – \sqrt{x_i^2 + y_i^2 – r_b^2}$, where $\theta = \alpha + \arccos(r_b / \rho)$ and $\rho = \sqrt{x_i^2 + y_i^2}$. The sign of the deviation depends on whether the point lies outside (positive) or inside (negative) the theoretical tooth region.
Geometric errors, including concentricity, circularity, and radial runout, are evaluated based on the inner hole as the datum. Concentricity $e_c$ between the tip circle center $O'(x_0′, y_0′)$ and datum center $O(x_0, y_0)$ is $e_c = 2 \lambda \sqrt{(x_0 – x_0′)^2 + (y_0 – y_0′)^2}$, where $\lambda$ is the pixel scale. Circularity $e$ of the inner hole is $e = 4\pi S / L^2$, with $S$ as area and $L$ as perimeter. Radial runout $e_r$ is $e_r = \lambda (r_{\text{max}} – r_{\text{min}})$, where $r_{\text{max}}$ and $r_{\text{min}}$ are the maximum and minimum radii from the center to the inner hole contour.
We conducted experiments using a gear visual measurement system (GVMS) with a CMOS camera, telecentric lens, and LED backlight. The pixel scale was calibrated to 7.71 μm/pixel. Three spur gears with different parameters were measured: a plastic gear with 22 teeth, modulus 1.0 mm; a plastic gear with 21 teeth, modulus 0.8 mm; and a powder metallurgy gear with 17 teeth, modulus 0.5 mm and positive modification. The GVMS performed 20 repeated measurements for each spur gear, with standard deviations below 0.8 μm and range errors under 4 μm, demonstrating high repeatability. Comparative results with a Klingelnberg P26 gear measuring center and manual tools showed maximum dimensional errors of 8 μm. Profile deviations, including total profile deviation $F_\alpha$, profile form deviation $f_{f\alpha}$, and profile slope deviation $f_{H\alpha}$, were consistent with P26 measurements, with differences up to 4.5 μm, 1.9 μm, and 3.9 μm, respectively.
| Parameter | Gear A (GVMS) | Gear A (P26) | Error |
|---|---|---|---|
| Number of Teeth | 22 | 22 | 0 |
| Modulus (mm) | 1.0 | 1.0 | 0.0 |
| Pressure Angle (°) | 20 | 20 | 0 |
| Tip Diameter (mm) | 23.995 | 23.991 | 0.004 |
| Root Diameter (mm) | 19.498 | 19.501 | -0.003 |
| Inner Hole Diameter (mm) | 4.800 | 4.800 | 0.000 |
| Whole Tooth Depth (mm) | 2.249 | 2.241 | 0.008 |
| Tooth Width (mm) | 8.002 | 8.006 | -0.004 |
| Modification Coefficient | 0.00 | 0.00 | 0.00 |
| Base Tangent Variation (mm) | 0.035 | 0.042 | -0.007 |
| Concentricity (μm) | 8.5 | 4.3 | 4.2 |
| Circularity | 0.903 | 0.911 | -0.008 |
| Radial Runout (μm) | 3.5 | 3.2 | 0.3 |
Our method for spur gears achieves comprehensive parameter measurement without prior knowledge, including number of teeth, modulus, pressure angle, tip diameter, root diameter, whole tooth depth, tooth width, base tangent length variation, modification coefficient, profile deviation, and geometric errors. The integration of Facet-based subpixel edge localization, iterative reweighted least squares circle fitting, and fast intersection detection ensures high accuracy and efficiency. For spur gears with moduli between 0.5 mm and 1.0 mm, the repeatability precision is 4 μm, making it suitable for inline inspection in flexible production lines. Future work will address perspective errors caused by non-parallel alignment between gear axes and the optical axis, further enhancing measurement robustness for spur gears.
In summary, this vision-based approach revolutionizes the measurement of fine-pitch spur gears by enabling parameter-free, parallel, and rapid inspection. The use of advanced image processing and gear theory allows for the extraction of multiple parameters from a single image, overcoming the limitations of traditional methods. As manufacturing trends toward greater flexibility, this technology will play a pivotal role in quality control for spur gears, ensuring high precision and efficiency in diverse production environments.
