Shaft gear quality detection method and system based on image processing
By adaptively adjusting the window size of the Zernike moment, the problem that traditional methods cannot take into account both high and low curvature regions when inspecting automotive axle teeth is solved, achieving high-precision edge positioning and stable quality inspection.
Patent Information
- Application Number
- CN202610516906.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-20
- Publication Date
- 2026-05-19
AI Technical Summary
Traditional Zernike moment edge detection methods cannot simultaneously ensure positioning accuracy in high-curvature areas and noise immunity in low-curvature areas when inspecting automotive axle teeth, resulting in edge positioning accuracy that fails to meet the requirements of high-precision quality inspection.
By acquiring multi-view images of the shaft teeth and performing registration and fusion, the curvature and rate of curvature change of each sampling point are calculated, and the window size of the Zernike moment is dynamically adjusted to adapt to different regional features of the shaft tooth profile. An adaptive adjustment mechanism is constructed by combining curvature and rate of curvature change to achieve adaptive adjustment of the window size.
It achieves unified optimization of edge positioning accuracy and algorithm robustness across the entire contour of the shaft teeth, improving the stability and accuracy of detection, and ensuring high reliability in key areas and efficient utilization of computing resources.
Smart Images

Figure CN122066700A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing. More specifically, this invention relates to a method and system for detecting shaft tooth quality based on image processing. Background Technology
[0002] The geometric accuracy of the shafts and gears in an automotive transmission system directly affects the transmission performance and reliability of the entire vehicle.
[0003] To ensure quality, vision-based non-contact precision measurement has become a key method. Among them, Zernike moments, due to their rotational invariance and good noise resistance, are used for sub-pixel-level edge detection of parts.
[0004] However, traditional Zernike moment edge detection methods typically employ a fixed-size computational window. When detecting complex profiles with significant geometrical differences (such as automotive axle teeth containing both high-curvature tooth roots and low-curvature tooth surfaces), the limitations of this method become apparent: a single window size cannot simultaneously accommodate the precise positioning capabilities required for high-curvature regions and the noise suppression capabilities required for low-curvature regions, resulting in edge positioning accuracy in critical fatigue areas such as tooth roots failing to meet the stringent requirements of high-precision quality inspection. Summary of the Invention
[0005] To address the several technical problems in the prior art where fixed windows are used for Zernike moment edge detection, which cannot simultaneously ensure positioning accuracy in high-curvature regions such as shafts and teeth and noise resistance in low-curvature regions, the present invention provides solutions in the following aspects.
[0006] In the first aspect, the image processing-based shaft tooth quality detection method includes: Multi-view images of the shaft teeth are acquired, and after registration and fusion, the complete outline of the shaft teeth and the corresponding fused grayscale image are obtained. The complete contour is sampled to obtain multiple sampling points; The curvature and rate of change of curvature at each sampling point are calculated. Based on the curvature and rate of change of curvature, a window size for calculating Zernike moments is calculated for each sampling point. When determining the window size, the curvature is compared with the mean of the curvature to obtain a first adjustment coefficient, and the rate of change of curvature is compared with the mean of the rate of change of curvature to obtain a second adjustment coefficient. The reference window size of Zernike moments is attenuated and adjusted using the first adjustment coefficient and the second adjustment coefficient. Centered on each sampling point, a local image region is extracted from the fused grayscale image according to the corresponding window size, and Zernike moments are calculated on the local image region to determine the edge position of each sampling point; The tooth profile of the shaft tooth is reconstructed based on the edge positions of all sampling points, and the reconstructed tooth profile is compared with the theoretical model to output the quality inspection results.
[0007] Preferably, the attenuation adjustment includes: Calculate the mean curvature of all sampling points on the complete contour as the global average curvature; Calculate the mean of the rate of curvature change of all sampling points on the complete contour as the global average curvature change; The negative exponential function value of the ratio of the curvature to the global average curvature is used as the first adjustment coefficient; The difference between 1 and the ratio of the curvature change rate to the global average curvature change is used as the second adjustment coefficient; The preliminary window size is obtained by multiplying the reference window size, the first adjustment coefficient, and the second adjustment coefficient.
[0008] Preferably, after the attenuation adjustment, the method further includes constraining the initial window size to be no less than a preset minimum effective window size to obtain the final window size used for Zernike moment calculation.
[0009] Preferably, when calculating the Zernike moment on the local image region, the pixel coordinates of the local image region are mapped to the unit circle coordinate system for calculation.
[0010] Preferably, determining the edge position of each sampling point includes: Based on the calculated Zernike moments, obtain the phase angle at the sampling point; The phase angle is continuously corrected along the sampling points to obtain the corrected phase angle; Based on the corrected phase angle, first-order Zernike moment, and second-order Zernike moment, calculate the sub-pixel-level offset of the sampling point from its original position to the real edge; The calculated subpixel-level offset is combined with the original position of the sampling point to obtain the final subpixel-level edge position.
[0011] Preferably, the process of acquiring multi-view images of the shaft teeth, and obtaining the complete contour of the shaft teeth after registration and fusion includes: Images at multiple equally spaced angles are acquired during at least one rotation of the shaft tooth. The edge contours of each image are extracted, and the contours of all perspectives are unified into a coordinate system with the geometric center of the shaft tooth as the origin through feature point registration, thus fusing them into a complete circumferential contour of the shaft tooth.
[0012] Preferably, the output quality detection results include: After comparing the reconstructed tooth profile with the theoretical model, the excess points where the geometric deviation exceeds the preset threshold are calibrated, and the shaft teeth are judged to be qualified based on the number of excess points.
[0013] Preferably, the complete contour is sampled at equal intervals of arc length.
[0014] Secondly, an image processing-based shaft tooth quality inspection system includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the image processing-based shaft tooth quality inspection method described in any one of the claims is implemented.
[0015] The beneficial effects of this invention are: 1. This invention extracts the curvature and rate of change of curvature of the tooth profile as geometric features and constructs an adaptive window size adjustment mechanism accordingly, overcoming the limitations of traditional Zernike moments that use a fixed calculation window. Specifically, this method enables the window size to dynamically match the local geometry: the window automatically shrinks in high-curvature regions such as the tooth root, thereby improving spatial resolution to accurately capture fine edges; the window is appropriately enlarged in low-curvature regions such as the tooth surface, thereby enhancing the ability to suppress image noise and improving detection stability. This core improvement fundamentally solves the key contradiction of traditional methods, which cannot simultaneously meet the detection needs of different regions of the tooth profile (high-curvature transition area and low-curvature main area) due to a single window size. It achieves unified optimization of edge positioning accuracy and algorithm robustness across the entire contour range, laying a highly reliable data foundation for subsequent geometric accuracy evaluation based on contour comparison.
[0016] 2. This invention achieves "on-demand allocation" of computing resources through the constructed window size adaptive adjustment mechanism. While ensuring accuracy, it avoids the full-image computation redundancy caused by the traditional fixed large window, which helps to improve the overall processing efficiency under limited hardware resources. Attached Figure Description
[0017] Figure 1 This is a flowchart of steps S1-S4 in the image processing-based shaft tooth quality detection method of this invention.
[0018] Figure 2 This is a flowchart of a method for calculating a window size for Zernike moment calculation for each sampling point based on curvature and the rate of change of curvature, according to an embodiment of the present invention.
[0019] Figure 3 This is a structural block diagram of the image processing-based shaft tooth quality detection system according to an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0021] Reference Figure 1 The image processing-based shaft tooth quality detection method includes steps S1-S4, as detailed below: S1: Obtain multi-view images of the shaft teeth, and obtain the complete outline of the shaft teeth and the corresponding fused grayscale image after registration and fusion.
[0022] A single-view image cannot fully capture all the contour information around the cylindrical surface of the shaft tooth, especially the occluded tooth sections. Therefore, multi-view imaging and data fusion are necessary to reconstruct the complete 360° contour, providing a data foundation for subsequent global analysis.
[0023] Specifically, the shaft gear workpiece is placed on the work platform using a clamping device. A high-resolution industrial camera combined with a ring-shaped LED diffuse reflection light source is used to vertically align with the detection area. The control mechanism drives the shaft gear to rotate 30° and pauses, at which point the camera captures one frame of image. A total of 12 original image sequences are obtained after one rotation.
[0024] Next, median filtering (e.g., 3×3 window) is applied to each original image to eliminate random noise, and then histogram equalization is used to enhance contrast, resulting in a set of enhanced images.
[0025] SIFT feature points are extracted from each enhanced image, and the spatial transformation matrix between adjacent viewpoint images is calculated using the RANSAC algorithm to achieve geometric alignment of all images. The Canny operator is applied to each aligned image to detect edges and obtain local contours. A unified global coordinate system is established with the geometric center of the shaft teeth obtained from system calibration as the origin, and the aforementioned transformation matrix is used to transform all local contours to this coordinate system.
[0026] All the transformed local contour point clouds are merged and smoothed and hole repaired using Delaunay triangulation to obtain a complete 360° contour point cloud. Simultaneously, the enhanced image is subjected to grayscale weighted fusion based on the same transformation matrix to generate a fused grayscale image aligned with the complete contour space.
[0027] Finally, the complete outline of the shaft teeth and the corresponding fused grayscale image are obtained.
[0028] S2: Sample and analyze the complete contour to determine the optimal detection window size for each sampling point generated by the sampling.
[0029] Subsequent Zernike moment calculations need to be performed within the neighborhood of each profile point. However, a fixed-size neighborhood (window) cannot accommodate the drastically different feature requirements of the tooth root (high curvature, rich detail) and tooth surface (low curvature, noise resistance) on the tooth profile. Therefore, it is necessary to first obtain the geometric features of the profile and then "tailor-make" a calculation window for each point accordingly.
[0030] The complete contour point cloud obtained by S1 above is sampled to obtain discrete, ordered representative points.
[0031] To ensure the consistency of the full contour sampling sequence, the starting point and direction of sampling are first defined. Typically, an easily identifiable and stable feature point is selected as the starting point, such as the midpoint of the tooth tip. Then, a fixed traversal direction, such as counterclockwise, is set along the contour. As a preferred embodiment of the present invention, a sampling strategy based on equal arc length spacing (e.g., the spacing can be set to 2 pixels) can be used to obtain the initial sampling points.
[0032] To ensure the accuracy of subsequent curvature calculations, especially for areas with high curvature or abrupt changes in curvature rate, such as the transition zone at the tooth root of the shaft tooth, adaptive densification sampling can be performed in segments where the absolute value of curvature or the rate of change of curvature exceeds a specific threshold, based on the curvature information estimated from the initial sampling points. For example, when it is determined that the region is located in a region of abrupt change in features, the sampling spacing in its neighborhood can be densified to half or more of the original spacing to ensure the sampling point density in areas with dense geometric features, thereby providing a more reliable geometric feature data foundation for subsequent high-precision edge detection.
[0033] For the multiple sampling points obtained from the final sampling above, the curvature of each sampling point can be calculated using methods such as the parametric curve derivative method, local circular arc fitting, or the three-point method. The present invention preferably uses the parametric curve derivative method to calculate the curvature.
[0034] It should be noted that after calculating the curvature, the influence of the bending direction (concave / convex) is further eliminated, focusing only on the "severity" of the bending, that is, taking the absolute value of the calculated curvature. Furthermore, all subsequent curvature-related operations use the absolute value of the curvature.
[0035] In addition, the curvature change rate is calculated using the central difference method, thereby obtaining a feature set representing the local geometric shape of the contour (i.e., the curvature and curvature change rate of each sampling point).
[0036] After obtaining the feature set representing the local geometry of the contour, refer to Figure 2 The specific process of calculating a window size for Zernike moment calculation for each sampling point based on curvature and the rate of change of curvature includes the following: S20: Calculate the global feature baseline.
[0037] Calculate the mean curvature of all sampling points on the complete contour as the global average curvature, and calculate the mean rate of change of curvature of all sampling points on the complete contour as the global average curvature change.
[0038] Through the above calculations, the local feature values of each subsequent sampling point are converted into "relative salience" relative to the overall contour, thereby ensuring that the adaptive mechanism starts from a global perspective and can produce a consistent and comparable standard response for shafts of different models or sizes, avoiding parameter sensitivity issues caused by differences in absolute curvature.
[0039] S21: Construct the first adjustment coefficient and the second adjustment coefficient.
[0040] The negative exponential function value of the ratio of the absolute value of curvature to the global average curvature obtained from the above calculation is used as the first adjustment coefficient, which satisfies the following relationship: In the formula, The first adjustment coefficient, For the first The curvature of each sampling point It is the mean of the curvature of all sampling points on the complete contour.
[0041] when Significantly higher than At times (such as at the root arc of the tooth). It will decrease rapidly, thus affecting the first The window used for Zernike moment calculations is subjected to strong "shrinkage" pressure to match its high spatial frequency detail features.
[0042] The difference between 1 and the ratio of the calculated rate of curvature change to the global average rate of curvature change is taken as the second adjustment coefficient, which satisfies the following relationship: In the formula, This is the second adjustment coefficient. For the first Rate of curvature change at each sampling point The mean of the rate of change of curvature at all sampling points on the complete contour. This is a minimal constant to prevent the denominator from being 0.
[0043] By calculating the second adjustment coefficient, in regions with drastic curvature changes, such as the transition boundary from the tooth root to the tooth surface, Significantly reduced, guiding the first The window for calculating Zernike moments is further narrowed to accurately capture abrupt changes in geometry.
[0044] By further combining the first and second adjustment coefficients, it is possible not only to sense the degree of curvature of the contour, but also to sense the rate of change of curvature, thus achieving dual fine-tuning of complex geometric shapes.
[0045] S22: Adjust the attenuation of the preset reference window size of the Zernike moment by combining the first adjustment coefficient and the second adjustment coefficient.
[0046] Multiplying the first and second adjustment coefficients calculated in S21 above, we obtain the comprehensive attenuation factor of the sampling point. The value of the comprehensive attenuation factor ranges from 0 to 1, which quantitatively characterizes the degree of window reduction required based on local geometric features.
[0047] Subsequently, the above-mentioned comprehensive attenuation factor is multiplied by a preset reference window size (e.g., 7 pixels) used for Zernike moment calculation to obtain the preliminary window size of the sampling point.
[0048] Since the window size in image processing must be an integer number of pixels, the initial window size is rounded down. To ensure that the initial window size is not smaller than the theoretical value required for calculation, an up-rounding function is used.
[0049] In addition, to ensure the numerical stability and effectiveness of Zernike moment calculation, there is a theoretical lower limit to the window size. Therefore, the preliminary window size after rounding is compared with the preset minimum effective window size of Zernike moment (usually an odd number not less than 3, such as 5 pixels), and the larger of the two is taken to obtain the final window size allocated to the sampling points for Zernike moment calculation.
[0050] Therefore, the window size for Zernike moment calculation for each sampling point is calculated similarly to the operations in S20-S22 above.
[0051] In summary, the above-mentioned S2 constructs a complete, closed-loop adaptive adjustment mechanism from contour geometric feature perception to dynamic generation of detection parameters, thereby fundamentally revolutionizing the traditional fixed window detection paradigm.
[0052] The mechanism first precisely quantifies the contour shape through ordered sampling and feature extraction (curvature and its rate of change). Then, by introducing global average features as a normalization benchmark, it transforms local geometric information into "relative saliency" that is independent of absolute size, laying the foundation for the algorithm's universality. Most importantly, by constructing exponential and linear negative correlation adjustment coefficients that respectively respond to curvature intensity and curvature change rate, and based on these, it scientifically adjusts and constrains the benchmark window, ultimately generating an "optimal window size" for each sampling point that precisely matches its local geometric complexity.
[0053] The essence of this mechanism is to give the spatial resolution of the detection system "visual intelligence": it automatically "focuses" in areas with abrupt changes in curvature, such as the tooth root, to capture micron-level details, ensuring the ultimate accuracy of critical areas; and it intelligently "broadens" in areas with gentle curvature, such as the tooth surface, to smooth out noise, ensuring the robust stability of the overall detection.
[0054] Therefore, S2 not only successfully solved the core contradiction that the fixed window method could not take into account the differentiated needs of different regions of the contour, but also achieved a higher level of unity in accuracy, speed and reliability for the entire shaft and tooth quality inspection system by deeply integrating geometric prior knowledge into the image processing algorithm.
[0055] S3: Centered on each sampling point, extract a local image region from the fused grayscale image according to the corresponding window size, and calculate the Zernike moment on the local image region to determine the edge position of each sampling point.
[0056] In S2 above, the detection window size for each sampling point has been dynamically determined, and these determined window sizes are further used to perform high-precision edge localization calculations.
[0057] While Zernike moments possess sub-pixel positioning potential, their calculation must be performed on a unit circle to ensure mathematical orthogonality. Furthermore, directly calculated edge orientation angles exhibit numerical jumps, requiring correction to maintain contour continuity. Therefore, a standardized calculation process is needed to convert the window size advantage into precise edge coordinates.
[0058] First, for each sampling point, a square local image region with a side length equal to the window size corresponding to the sampling point is extracted from the fused grayscale image generated in S1 above, centered on its pixel coordinates.
[0059] To strictly meet the requirement of calculating Zernike moments on a unit circle, the original coordinates of each pixel within this local image region are mapped to the unit circle coordinate system. This is a standard coordinate transformation process in this field. For example, the pixel coordinates within the region are normalized to the unit circle coordinate system through a linear transformation. Intervals, and only retain those that satisfy The pixels are used in the calculation. , These are the x and y coordinates after mapping to the unit circle coordinate system.
[0060] On the normalized unit circle domain corresponding to the sampling points established above, calculate the low-order Zernike moments within the region, especially to obtain the first-order and second-order Zernike moments for edge localization.
[0061] For discrete pixels, their moments are approximated by weighted summation and integration, where the area element corresponding to each pixel is: ,in For the first Window size for each sampling point.
[0062] Calculate the low-order Zernike moments, specifically the first-order and second-order Zernike moments used for edge localization: In the formula, Indicates the first At each sampling point Step Rectangle, The order and repetition of the moments contain local regions of the image in terms of order. and repeatability In this invention, the characteristic information of specific frequencies and directions is mainly used for edge localization by its low-order moments (n=1, m=1) and (n=2, m=0); For the complex conjugate of the Zernike polynomial, This represents the grayscale value of a local image region at its original pixel coordinates.
[0063] Through the above operations, the gray values of all pixels within the unit circle of the local image region are... Multiply by the corresponding Weights of basis functions and the normalized area of the pixel Then sum all the products, and finally multiply by the theoretical normalization coefficient. This allows us to obtain a Zernike moment feature of the local region image. .
[0064] After calculating Zernike moments based on an adaptive window size and obtaining key feature quantities such as the first-order moments of each sampling point, these moment values can be used for high-precision edge localization. Specifically, the phase angle representing the edge normal direction is first calculated based on the first-order moments, and then a continuity correction is performed to eliminate abrupt changes in numerical representation, ensuring the continuity and accuracy of subsequent localization. The process is as follows: The phase angle at each sampling point is calculated based on the first moment, and its range is: This represents the direction of the normal to the edge at that point. Since the arctangent function... There is an inherent place Periodic jumps, directly using the sampling point order in S2 above, will cause abrupt numerical changes when adjacent points are near the negative x-axis direction of the normal direction, leading to discontinuities in subsequent edge positions. Therefore, the phase angle sequence must be continuously corrected along the sampling point order. The correction algorithm uses the phase angle of the first sampling point as a reference, and for each subsequent sampling point, calculates the difference between its phase angle and the previous corrected phase angle. If this difference is less than... Then let the correction value of the phase angle at the current sampling point be the original phase angle plus twice the value of the phase angle. The sum, if the difference is greater than Then let the correction value of the phase angle at the current sampling point be the original phase angle plus twice the value of the phase angle. The difference is calculated; otherwise, the corrected phase angle of the current sampling point is the original phase angle. Through this dynamic compensation, a smooth, continuously varying normalized phase angle sequence is obtained.
[0065] Then, based on the step edge model and Zernike moment theory, the sub-pixel offset of the sampling point to its true edge can be calculated using the corrected phase angle, the first-order Zernike moment, and the second-order Zernike moment. The preferred calculation formula is as follows: In the formula, For the first The sub-pixel offset of each sampling point from its original position to the real edge. For the first The second moment of each sampling point, For the first The first moment of each sampling point To be a very small constant to ensure that the denominator is not zero, For the first The phase angle after correction for each sampling point.
[0066] Finally, the above-mentioned number The sampling point is transformed back to the original pixel coordinate system from its original position by a sub-pixel offset pointing to the real edge, and then superimposed with its original position to obtain the nth sampling point. The precise sub-pixel level edge position of each sampling point satisfies the following relationship: In the formula, For the first Sub-pixel level edge position of each sampling point For the first The original location of each sampling point (derived from the fused grayscale image). For the first The sub-pixel offset of each sampling point from its original position to the real edge. For the first Window size for each sampling point For the first The phase angle after correction for each sampling point.
[0067] Ultimately, the sub-pixel level edge positions of all sampled points can be obtained.
[0068] In summary, the core advantage of the "Zernike moment calculation based on self-adaptive window size" implemented in S3 lies in resolving the fundamental contradiction of traditional fixed-window methods in achieving both accuracy and robustness across the entire contour through dynamically obtained window sizes. Specifically, in high-curvature regions such as the tooth root, the automatically shrinking window focuses the calculation on local details, resulting in extremely high sub-pixel positioning accuracy; in low-curvature regions such as the tooth surface, the automatically expanding window effectively fuses information and suppresses noise, ensuring detection stability. This mechanism allows the mathematical advantages of Zernike moments to be optimally utilized in each local region, thereby directly transforming the adaptive strategy into a high-precision positioning result consistent across the entire contour.
[0069] S4: Reconstruct the tooth profile of the shaft tooth based on the edge positions of all sampling points, compare the reconstructed tooth profile with the theoretical model, and output the quality inspection results.
[0070] After obtaining the high-precision sub-pixel edge positions of all sampling points, the complete tooth profile is further reconstructed. By accurately comparing it with the theoretical model, the final quantitative quality inspection result is output.
[0071] First, the sub-pixel-level edge positions of all sampling points are linked according to a fixed sampling order on the complete contour to form a discrete optimized contour. To obtain a smooth, continuous curve for subsequent accurate comparison, methods such as cubic spline interpolation can be used to fit this discrete point sequence, thereby reconstructing the complete and actual tooth profile of the shaft tooth.
[0072] Then, the reconstructed tooth profile is spatially aligned with the CAD theoretical model profile of the shaft tooth. Iterative nearest-point registration algorithms are typically used to eliminate minute rigid body displacements (translation and rotation) between the workpiece clamping, the image coordinate system, and the design coordinate system. After registration, the distance from the nearest point on the actual profile to the theoretical profile is calculated; this distance is the geometric deviation value for that point.
[0073] Next, based on the product precision requirements, a tolerance threshold is preset (e.g., 2). The system automatically compares the geometric deviation of all sampling points with the above tolerance threshold, identifying all "out-of-tolerance points" where the absolute value of the geometric deviation is greater than the tolerance threshold. Based on statistical information such as the number, location distribution, and maximum deviation value of out-of-tolerance points, automated quality grading is performed. For example, a four-level evaluation system can be established: Grade A (Excellent): No out-of-tolerance points; Grade B (Acceptable): Out-of-tolerance ratio is below the lower limit (e.g., <5%); Grade C (Pending Rework): Out-of-tolerance ratio is within a certain range (e.g., 5%-20%); Grade D (Scrap): Out-of-tolerance ratio exceeds the upper limit (e.g., ≥20%).
[0074] Finally, the above test results can be displayed graphically, showing the overlay comparison between the actual and theoretical contours, marking out-of-tolerance points, and deviation cloud maps. Simultaneously, structured data is output, including the pass rate, out-of-tolerance statistics table, quality grade, and detailed deviation values for key sections. This report can be displayed via a human-machine interface and automatically archived or transmitted to the production management system, achieving closed-loop management of quality data and process traceability.
[0075] This completes the inspection of the shaft tooth quality.
[0076] This invention also provides a shaft tooth quality inspection system based on image processing. For example... Figure 3 As shown, the system includes a processor and a memory, the memory storing computer program instructions, which, when executed by the processor, implement the image processing-based shaft tooth quality detection method according to the first aspect of the present invention.
[0077] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0078] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A shaft tooth quality detection method based on image processing, characterized in that, include: Multi-view images of the shaft teeth are acquired, and after registration and fusion, the complete outline of the shaft teeth and the corresponding fused grayscale image are obtained. The complete contour is sampled to obtain multiple sampling points; The curvature and rate of change of curvature at each sampling point are calculated. Based on the curvature and rate of change of curvature, a window size for calculating Zernike moments is calculated for each sampling point. When determining the window size, the curvature is compared with the mean of the curvature to obtain a first adjustment coefficient, and the rate of change of curvature is compared with the mean of the rate of change of curvature to obtain a second adjustment coefficient. The reference window size of Zernike moments is attenuated and adjusted using the first adjustment coefficient and the second adjustment coefficient. Centered on each sampling point, a local image region is extracted from the fused grayscale image according to the corresponding window size, and Zernike moments are calculated on the local image region to determine the edge position of each sampling point; The tooth profile of the shaft tooth is reconstructed based on the edge positions of all sampling points, and the reconstructed tooth profile is compared with the theoretical model to output the quality inspection results.
2. The image processing-based shaft tooth quality detection method according to claim 1, characterized in that, The attenuation adjustment includes: Calculate the mean curvature of all sampling points on the complete contour as the global average curvature; Calculate the mean of the rate of curvature change of all sampling points on the complete contour as the global average curvature change; The negative exponential function value of the ratio of the curvature to the global average curvature is used as the first adjustment coefficient; The difference between 1 and the ratio of the curvature change rate to the global average curvature change is used as the second adjustment coefficient; The preliminary window size is obtained by multiplying the reference window size, the first adjustment coefficient, and the second adjustment coefficient.
3. The image processing-based shaft tooth quality detection method according to claim 2, characterized in that, After the attenuation adjustment, the initial window size is constrained to be no less than a preset minimum effective window size to obtain the final window size used for Zernike moment calculation.
4. The image processing-based shaft tooth quality detection method according to claim 1, characterized in that, When calculating the Zernike moment on the local image region, the pixel coordinates of the local image region are mapped to the unit circle coordinate system for calculation.
5. The image processing-based shaft tooth quality detection method according to claim 1, characterized in that, Determining the edge position of each sampling point includes: Based on the calculated Zernike moments, obtain the phase angle at the sampling point; The phase angle is continuously corrected along the sampling points to obtain the corrected phase angle; Based on the corrected phase angle, first-order Zernike moment, and second-order Zernike moment, calculate the sub-pixel-level offset of the sampling point from its original position to the real edge; The calculated subpixel-level offset is combined with the original position of the sampling point to obtain the final subpixel-level edge position.
6. The image processing-based shaft tooth quality detection method according to claim 1, characterized in that, The process of acquiring multi-view images of the shaft teeth, and obtaining the complete contour of the shaft teeth after registration and fusion includes: Images at multiple equally spaced angles are acquired during at least one rotation of the shaft tooth. The edge contours of each image are extracted, and the contours of all perspectives are unified into a coordinate system with the geometric center of the shaft tooth as the origin through feature point registration, thus fusing them into a complete circumferential contour of the shaft tooth.
7. The image processing-based shaft tooth quality detection method according to claim 1, characterized in that, The output quality detection results include: After comparing the reconstructed tooth profile with the theoretical model, the excess points where the geometric deviation exceeds the preset threshold are calibrated, and the shaft teeth are judged to be qualified based on the number of excess points.
8. The image processing-based shaft tooth quality detection method according to claim 1, characterized in that, The complete contour is sampled at equal intervals of arc length.
9. A shaft tooth quality inspection system based on image processing, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement the image processing-based shaft tooth quality detection method according to any one of claims 1-8.
