Axle assembly quality detection method based on machine vision
The axle assembly quality inspection method, which combines machine vision with adaptive filtering, edge sharpening, and an improved YOLOv8 algorithm, solves the problems of low inspection efficiency and poor accuracy in existing methods. It achieves efficient and accurate inspection covering all static and dynamic working conditions, thereby improving the inspection accuracy and reliability of axle assembly quality.
Patent Information
- Application Number
- CN202511393436.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-09-28
AI Technical Summary
Existing axle assembly quality inspection methods are inefficient and inaccurate, failing to meet the demands for efficient and precise inspection. Furthermore, they cannot simulate actual dynamic operating conditions, resulting in high rates of missed and false detections and insufficient inspection coverage.
A machine vision-based detection method is adopted, which combines adaptive filtering and edge sharpening techniques to process static images. An improved YOLOv8 algorithm is used to extract static assembly parameters, and preload detection is added before dynamic detection. Motion blur compensation and Kalman vibration denoising are performed during dynamic detection, and multiple rounds of detection are used to reduce the false negative rate.
It achieves accurate detection covering all static and dynamic working conditions, significantly improving the accuracy and reliability of axle assembly inspection, reducing the rate of missed and false detections, and ensuring the driving safety and stability of vehicles.
Smart Images

Figure CN120876483A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of quality inspection technology, and in particular relates to a machine vision-based method for inspecting the quality of axle assembly. Background Technology
[0002] Axles are core transmission components in vehicles such as rail transit vehicles and commercial vehicles, and their assembly quality directly determines the vehicle's driving safety, stability, and service life. During assembly, the precision control of parameters such as the coaxiality of the bearing inner ring and journal, the fit clearance between the axle shoulder and bearing end face, and the integrity of fasteners is crucial. Any assembly deviation can easily lead to serious malfunctions such as abnormal operating noises, accelerated component wear, or even axle system failure. With the increasing safety standards and production efficiency requirements of vehicles, existing inspection methods can no longer meet the demands for efficient and accurate inspection. They suffer from low efficiency, high labor intensity, and are susceptible to the influence of subjective experience, resulting in poor accuracy in judging fine parameters such as minute fit clearances and coaxiality, leading to high rates of missed and false detections. Furthermore, some machine vision solutions only detect static parameters and do not simulate actual dynamic operating conditions, failing to capture dynamic defects such as bearing radial runout and fastener rotational misalignment at idle speeds up to rated speeds, resulting in insufficient inspection coverage. Therefore, there is an urgent need for a precise axle assembly quality inspection solution that covers all operating conditions. Summary of the Invention
[0003] To address the technical problems mentioned above, this invention proposes a machine vision-based method for inspecting the assembly quality of axles.
[0004] To achieve the above objectives, the technical solution adopted by the present invention includes the following steps:
[0005] S1. First, fix the assembled axle onto the positioning fixture, and use an industrial camera to collect static image data of the assembled axle.
[0006] S2. Perform image processing on the static image data to obtain the processed static image;
[0007] S3. Use the improved YOLOv8 algorithm to extract static assembly parameters, including the coaxiality of the bearing inner ring and journal, the fitting clearance between the shaft shoulder and the bearing end face, the integrity of the fastener edges, and the mating clearance between the keyway and the key; compare the static assembly parameters with the preset static standard parameter library, and if all parameters are within the tolerance range, perform dynamic detection.
[0008] S4. Dynamic testing is used to conduct dynamic tests on axles that have passed static testing. The test time is preset and the test is performed according to the actual use scenario. Dynamic sequence images and vibration data of the axle at preset speed gradients from idle speed to rated speed are collected after the test.
[0009] S5. Perform motion blur compensation on the dynamic sequence image and extract dynamic assembly parameters based on the improved YOLOv8 algorithm. The dynamic assembly parameters include the radial runout of the bearing outer ring and the rotational offset angle of the fastener. Then, perform noise reduction processing on the vibration data.
[0010] S6. Compare the dynamic assembly parameters with the preset dynamic standard parameter library and standard vibration data to determine whether they are qualified.
[0011] S7. Perform multiple rounds of static and dynamic testing. If all rounds of testing are qualified and the vibration data is normal, the axle assembly quality is deemed qualified; if any round of testing is unqualified, it is deemed unqualified.
[0012] Preferably, step S2, which involves image processing of the static image data to obtain the processed static image, includes:
[0013] S21. For the input static original image I, for each pixel... Take its initial 3×3 neighborhood Calculate the gradient magnitude of the pixel. and local noise intensity The gradient magnitude of the pixel is calculated as follows: ,in These are the gradients in the horizontal and vertical directions, respectively; the local noise intensity is calculated as follows: ,in, This represents the grayscale value of the static original image at pixel coordinates (x, y). It is the mean of all pixels in the 3×3 neighborhood;
[0014] S22. Normalize the gradient and noise intensity to obtain the normalized gradient and noise intensity, and then obtain the side length of the filter window for each pixel. The calculation method is as follows: ,in Represented as the base length of the window. These are the weighting coefficients, This is the normalized value of the local noise intensity. This is the normalized value of the gradient magnitude of the pixel;
[0015] S23. Constrain and round the window if... Then force the minimum window size to be 3. Then the mandatory order is 7, if Then round it to the nearest odd number to obtain the side length of the filter window for that pixel. ;
[0016] S24, in pixels Construct a structure with a side length of [missing information] at the center. A square filtering window is used, and the median gray value of all pixels within the window is calculated as the filtered pixel value.
[0017] S25. Filter the image. An edge map is obtained through edge detection, and then the edge confidence score is calculated. The calculation method for the edge confidence is as follows: ,in, For any point gradient value, The average gradient value of the surrounding neighborhood. To avoid the denominator being zero for extremely small constants, This represents the number of edge pixels within the neighborhood. Given the total number of pixels in the neighborhood, targeted sharpening is performed based on a preset edge confidence threshold to obtain the final static image. The calculation method is as follows: ,in, To sharpen the intensity, For directional sharpening operators, based on edge direction angles choose, The set edge confidence threshold.
[0018] Preferably, the improved YOLOv8 algorithm used in step S3 is implemented by serially connecting a gap feature attention module (GAM) after the C2f feature extraction unit in the YOLOv8 algorithm backbone layer; the GAM is constructed as follows:
[0019] S311. Receive the multi-scale feature map F output by the C2f unit in the Backbone layer. This feature map includes features at three different scales.
[0020] S312. Perform global average pooling on the feature map F to obtain the channel-dimensional feature vector. ,Will The input consists of a channel mapping network with two fully connected layers, with a ReLU activation function inserted in between to achieve a non-linear transformation. The output is the channel attention weights. ;
[0021] S313, will Multiplying the original feature map F by the channel dimension completes the enhancement of gap-related features at the channel level;
[0022] S314. Perform a 3×3 convolution on the enhanced feature map to compress the number of channels to 1, resulting in a single-channel feature map. Then, the Sigmoid activation function is applied to... Normalization is performed to generate spatial attention weights. ,Will Multiply the enhanced feature map of the channel element by element to complete the enhancement of the key assembly area at the spatial level;
[0023] S315. Perform a 1×1 convolution on the spatially enhanced feature map, adjust the number of channels to match the input feature map F, and output the final enhanced feature map. .
[0024] Preferably, the implementation of extracting static assembly parameters using the improved YOLOv8 algorithm based on the series gap feature attention module GAM includes:
[0025] S321. Embed one GAM module after each of the three different scale C2f units of the original YOLOv8 Backbone;
[0026] S322, Enhanced feature maps output by the three C2f-GAM units. Input to the Neck layer, and scale transfer from top to bottom is achieved through the feature pyramid network to obtain the fused multi-scale feature map;
[0027] S323. Finally, the fused feature map is input into the regression head and detection head of the Head layer. The detection head identifies key components of the axle assembly and calculates static assembly parameter values.
[0028] Preferably, before the dynamic detection in step S4, the preload of the fastener needs to be detected. The torque and angle values are detected in real time using a torque sensor and an angle encoder. A tightening curve is constructed from the collected torque and angle data. The established tightening curve is compared with the standard tightening curve, and the difference in the integral area of the two curves in the elastic segment is calculated. If it exceeds the set threshold, the preload is deemed unqualified; otherwise, it is qualified.
[0029] Preferably, the implementation of motion blur compensation for dynamic sequence images in step S5 includes:
[0030] S51. First, establish the association marker between dynamic sequence images and rotational speed. Bind the collected speeds from idle to rated speed at each preset gradient to the corresponding dynamic sequence image frame one by one, and add a unique rotational speed label to each image frame.
[0031] S52. For key regions related to dynamic assembly parameters in dynamic sequence images, extract the feature point set of each key region using optical flow method; obtain the motion vector of the key region by calculating the displacement and displacement direction of the same feature point between adjacent frames.
[0032] S53. Calculate the theoretical fuzzy kernel length based on the rotational speed, and determine the theoretical fuzzy kernel direction based on the axle rotation direction; obtain the initial parameters of the theoretical fuzzy kernel;
[0033] S54. The optimal fuzzy kernel parameters are obtained by using a genetic algorithm with the objective function of maximizing the edge gradient entropy of the key region.
[0034] S55. Finally, the obtained optimal blur kernel parameters are deblurred to obtain the motion-compensated image.
[0035] Preferably, the noise reduction of the vibration data in step S5 is achieved using the Kalman filter algorithm.
[0036] Compared with existing technologies, the advantages and positive effects of this invention are that it pioneers a static and dynamic full-condition inspection mode to address the problems of low inspection efficiency, insufficient coverage of static inspection only, and high false negative and false positive rates. In the static stage, adaptive filtering combined with edge sharpening optimizes the image, and improved YOLOv8 is used to extract accurate static parameters. Before the dynamic stage, a preload force detection is added to eliminate potential problems. In the dynamic stage, motion blur compensation and Kalman vibration denoising are used, and improved YOLOv8 is used to extract dynamic parameters. Multiple rounds of inspection further reduce the false negative and false positive rates, significantly improving the accuracy and reliability of axle assembly inspection. Attached Figure Description
[0037] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating a machine vision-based method for inspecting the assembly quality of axles. Detailed Implementation
[0039] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0040] Numerous specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways than those described herein, and therefore the invention is not limited to the specific embodiments disclosed in the following specification.
[0041] In this embodiment, the axle, as a key load-bearing and transmission component of vehicles such as rail transit vehicles and commercial vehicles, directly determines the driving stability and operational safety of the entire vehicle through its assembly quality. However, existing axle quality inspection methods have several problems and cannot meet the needs of large-scale assembly lines for rapid inspection. Therefore, this invention proposes a machine vision-based axle assembly quality inspection method, the specific implementation process of which is as follows: Figure 1 As shown.
[0042] First, the assembled axle is fixed on the positioning fixture, and then an industrial camera is used to collect static image data of the assembled axle.
[0043] To reduce noise interference in the original image and highlight edge features, image processing is performed on the static image, including adaptive filtering and edge sharpening. The process involves first performing pixel-level analysis on the input static original image I. For each pixel, its initial 3×3 neighborhood data is extracted, and the gradient magnitude and local noise intensity of that pixel are calculated. The gradient magnitude is obtained by calculating the gradients in the horizontal and vertical directions, while the local noise intensity is measured by the difference between the pixel's grayscale value and the mean of its neighborhood. Based on this, the gradient and noise intensity are normalized to obtain normalized gradient and noise intensity values. Then, according to the set weighting coefficients and the basic window length, the side length of the filtering window corresponding to each pixel is calculated. This allows regions with higher noise to be automatically assigned larger filtering windows to enhance smoothing capabilities, while regions with higher edge gradients are assigned smaller windows to preserve details, thus achieving adaptive image filtering. Finally, the filtering window is constrained and rounded to ensure that the side length is odd and within a specified range. Within the range, to avoid filtering distortion caused by inappropriate window size, a corresponding filtering window is constructed with each pixel as the center, and the median gray value of the pixels within it is calculated as the filtering value for that pixel, resulting in an image with overall noise suppression. Based on the filtering result, an edge detection algorithm is used to extract edge feature maps, and then the confidence of edge pixels is measured using the edge confidence calculation formula. The confidence is determined by the gradient ratio and the proportion of neighboring edge pixels, which can effectively distinguish between real edges and noisy pseudo-edges. In this process, an edge confidence threshold is set, and directional sharpening is applied only to areas where the confidence exceeds the threshold. The sharpening operator is dynamically adjusted according to the edge direction angle to ensure that the sharpening enhancement is only applied to structured edges and not noise points. The final output static image achieves both global noise suppression and enhances the contrast and clarity of key component edges. Specifically, for the input static original image I, for each pixel... Take its initial 3×3 neighborhood Calculate the gradient magnitude of the pixel. and local noise intensity The gradient magnitude of the pixel is calculated as follows: ,in These are the gradients in the horizontal and vertical directions, respectively; the local noise intensity is calculated as follows: ,in, This represents the grayscale value of the static original image at pixel coordinates (x, y). The mean value of all pixels within a 3×3 neighborhood is used; the gradient and noise intensity are normalized to obtain the normalized gradient and noise intensity, and then the side length of the filter window corresponding to each pixel is obtained, calculated as follows: ,in Represented as the base length of the window. These are the weighting coefficients, This is the normalized value of the local noise intensity. This is the normalized value of the pixel's gradient magnitude; the window is constrained and rounded if... Then force the minimum window size to be 3. Then the mandatory order is 7, if Then round it to the nearest odd number to obtain the side length of the filter window for that pixel. ; in pixels Construct a structure with a side length of [missing information] at the center. A square filtering window is used, and the median gray value of all pixels within the window is calculated as the filtered pixel value; the filtered image is then processed. An edge map is obtained through edge detection, and then the edge confidence score is calculated. The calculation method for the edge confidence is as follows: ,in, For any point gradient value, The average gradient value of the surrounding neighborhood. To avoid the denominator being zero for extremely small constants, This represents the number of edge pixels within the neighborhood. Given the total number of pixels in the neighborhood, targeted sharpening is performed based on a preset edge confidence threshold to obtain the final static image. The calculation method is as follows: ,in, To sharpen the intensity, For directional sharpening operators, based on edge direction angles choose, The set edge confidence threshold is used. This processing scheme significantly reduces random noise and illumination interference in the original acquired images. On the other hand, it preserves and enhances the edge details of axle assembly features while avoiding excessive smoothing. This ensures that the subsequent deep learning-based assembly parameter extraction process has higher input image quality, thereby effectively improving detection accuracy and robustness. This achieves the technical effect of improving the reliability and intelligence level of axle assembly quality detection.
[0044] To accurately identify key parameters during axle assembly, an improved YOLOv8 algorithm is used to extract static assembly parameters. These parameters include the coaxiality of the bearing inner ring and journal, the fit clearance between the axle shoulder and bearing end face, the integrity of fastener edges, and the fit clearance between the keyway and key. These static assembly parameters are compared with a pre-defined static standard parameter library. If all parameters are within tolerance, dynamic detection is performed. Specifically, a gap feature attention module (GAM) is introduced based on the improved YOLOv8 algorithm to enhance its attention to minute gaps and edge features. The GAM module is connected in series after the C2f feature extraction unit in the YOLOv8 algorithm's backbone layer. The construction of the GAM is as follows: receiving a multi-scale feature map F output by the C2f unit in the Backbone layer, which includes features at three different scales; in this step, firstly, receiving the multi-scale feature map F output by the C2f unit in the Backbone layer of the YOLOv8 algorithm, which typically includes three feature layers at different scales, corresponding to the small scale, processing local details of the axle, such as fastener edges, keyway and key mating areas; the medium scale, processing the mating area features of the axle shoulder and bearing end face; and the large scale, processing the overall coaxial area features of the bearing inner ring and journal.
[0045] Global average pooling is performed on the feature map F to obtain the channel-dimensional feature vector. ,Will The input consists of a channel mapping network with two fully connected layers, with a ReLU activation function inserted in between to achieve a non-linear transformation. The output is the channel attention weights. After acquiring multi-scale feature maps, this step compresses the response of each channel within the spatial range using global average pooling, obtaining a channel-dimensional feature vector. This vector reflects the importance of each channel in the overall feature representation. Subsequently, this vector is input into a channel mapping network consisting of two fully connected layers, with a ReLU activation function embedded in between to achieve non-linear mapping, ultimately outputting channel attention weights. These weights adaptively allocate the expression intensity of different channels, thereby highlighting the feature channels most critical for assembly detection. For example, channels reflecting axle coaxiality and fitting gaps will be given higher weights, while channels related to background noise or irrelevant features will be weakened. Compared to the traditional convolutional approach that equally weights all channels, this method effectively captures the dependencies between channels, achieving feature selection and enhancement. Its advantage lies in making the network's feature utilization more efficient, reducing interference from irrelevant information, and improving the detection model's sensitivity and discriminative ability to assembly anomalies.
[0046] Then The feature map F is multiplied along the channel dimension to enhance gap-related features at the channel level. After obtaining the channel attention weights, this step multiplies them with the original feature map F channel by channel to achieve channel-level feature weighting. Through this operation, channels with higher importance are enhanced, while channels with lower weights are suppressed, allowing the network to automatically focus on the expression of key features in the axle assembly process. For example, when detecting rotational offset or local gaps in axle fasteners, the attention mechanism will prioritize amplifying channels that can capture angular features and edge details, thereby enhancing the reliability of the judgment.
[0047] The enhanced feature map is convolved with a 3×3 matrix to compress the number of channels to 1, resulting in a single-channel feature map. Then, the Sigmoid activation function is applied to... Normalization is performed to generate spatial attention weights. ,Will The enhanced feature map is multiplied element-wise with the channel-enhanced feature map to enhance the key assembly areas at the spatial level. After feature enhancement at the channel level, this step further highlights the key assembly areas through a spatial attention mechanism. Specifically, the enhanced feature map is first convolved with a 3×3 layer to compress the number of channels to 1, resulting in a two-dimensional single-channel feature map that comprehensively reflects the response intensity of each pixel location. Subsequently, the feature map is normalized using the sigmoid function to generate a spatial attention weight matrix, which is then multiplied element-wise with the channel-enhanced feature map to achieve spatial enhancement of the key areas. Through this process, the model can automatically focus on the most valuable areas for detection in the spatial dimension, such as the contact area between the bearing outer ring and the journal, fastener locations, and keyway boundaries, while ignoring interference from background or irrelevant areas.
[0048] Finally, a 1×1 convolution is performed on the spatially enhanced feature map, and the number of channels is adjusted to match the input feature map F to output the final enhanced feature map. After performing both channel and spatial enhancement, this step adjusts the number of channels in the spatially enhanced feature map using a 1×1 convolution to match the number of channels in the original input feature map F, ensuring network structure compatibility. This operation not only achieves dimensionality alignment but also further fuses and compresses redundant information during convolution, ensuring that the final enhanced feature map is both efficient and accurate. The enhanced feature map has amplified key information and suppressed invalid information at both the channel and spatial levels, resulting in stronger expressive and discriminative capabilities. This represents an improvement to the complete YOLOv8 algorithm.
[0049] The implementation of the improved YOLOv8 algorithm for extracting static assembly parameters based on the series gap feature attention module (GAM) includes embedding one GAM module after each of the three C2f units at different scales in the original YOLOv8 backbone; and processing the enhanced feature maps output by the three C2f-GAM units. The input to the Neck layer is processed through a top-down scale transfer via a Feature Pyramid Network (FPN) to obtain a fused multi-scale feature map. Finally, the fused feature map is input to the regression and detection heads of the Head layer. The detection head identifies key components of the axle assembly and calculates static assembly parameters. Specifically, a Gap Feature Attention (GAM) module is first embedded after each of the three C2f units at different scales in the Backbone. By introducing an attention mechanism during the multi-scale feature extraction stage, the model's ability to express minute assembly details and local structural features is effectively enhanced. Subsequently, the enhanced feature maps output from the three C2f-GAM units are input to the Neck layer, and a top-down multi-scale feature fusion and transfer are achieved using a Feature Pyramid Network (FPN). This allows for a full combination of shallow detail features and deep semantic features, ensuring the capture of detailed information such as fastener edges and keyway gaps while also considering the semantic understanding of the overall geometric relationships. Finally, the fused multi-scale feature map is input into the Head layer, where the regression head and detection head jointly complete the detection task. The detection head is responsible for identifying and locating key components in the axle assembly, while the regression head calculates static assembly parameters such as the coaxiality of the bearing inner ring and journal, the fit clearance between the axle shoulder and bearing end face, the integrity of fasteners, and the keyway fit clearance. Through this improved design, the model can take into account feature extraction and enhancement at different scales, ensuring the accuracy and robustness of static assembly parameter calculations, and significantly improving the automation level and reliability of axle quality inspection.
[0050] Before dynamic testing, the preload of the fasteners needs to be tested. A torque sensor and an angle encoder are used to detect real-time torque and angle values. A tightening curve is constructed from the collected torque and angle data. The established tightening curve is compared with a standard tightening curve, and the difference in the integral area of the two curves in the elastic segment is calculated. If it exceeds a set threshold, the preload is considered unqualified; otherwise, it is considered qualified. Specifically, after the axle is assembled, the fastener to be tested is connected to the torque sensor and angle encoder. The torque sensor measures the torque change during the tightening process in real time, and the angle encoder synchronously records the change in the fastener's rotation angle. Through synchronous acquisition by the sensor and encoder, a high-precision sequence of torque and angle data can be obtained. Next, the collected data is processed in chronological order, and a tightening curve is plotted based on the torque-angle correspondence. This curve typically includes an initial free-spinning segment, an elastic deformation segment, and a plastic deformation segment. Among these, the elastic segment is the most critical stage reflecting the preload between the fastener and the connector, directly determining whether the fastener can maintain a stable clamping state during operation. Subsequently, the established actual tightening curve is compared with the standard tightening curve pre-stored in the database. To ensure the objectivity and scientific rigor of the comparison, an integral calculation is used to calculate the area difference between the two curves in the elastic segment. This integral area difference quantifies the deviation between the actual tightening process and the standard tightening process. If the calculated area difference exceeds a set threshold, it indicates that the preload of the fastener has failed to meet the standard requirements, potentially indicating insufficient clamping or over-tightening, and the preload is deemed unqualified. Conversely, if the integral area difference is within the threshold range, it indicates that the preload of the fastener meets the standard requirements and is deemed qualified. This testing step not only avoids loosening due to insufficient tightening force or damage due to over-tightening but also eliminates potential assembly hazards before dynamic testing, ensuring the authenticity and reliability of subsequent dynamic test data, thereby further improving the scientific rigor and safety of axle assembly quality inspection.
[0051] Dynamic testing is used to conduct dynamic tests on axles that have passed static testing. The test time is preset and the test is carried out according to the actual use scenario. Dynamic sequence images and vibration data of the axle are collected after the test at preset gradient speeds from idle speed to rated speed.
[0052] To address the image blurring issue caused by high-speed axle rotation, motion blur compensation technology is introduced into dynamic detection. Motion blur compensation is applied to the dynamic sequence images, and dynamic assembly parameters, including the radial runout of the bearing outer ring and the rotational offset angle of the fasteners, are extracted based on an improved YOLOv8 algorithm. Furthermore, the vibration data is denoised using a Kalman filter algorithm.
[0053] The motion blur compensation process includes: first, establishing a correlation marker between dynamic sequence images and rotational speeds; binding each preset gradient rotational speed from idle to rated speed to the corresponding dynamic sequence image frame one by one, adding a unique rotational speed label to each frame; then, extracting feature point sets for key regions related to dynamic assembly parameters in the dynamic sequence images using optical flow; and obtaining the motion vector of the key regions by calculating the displacement and direction of the same feature point between adjacent frames. Specifically, three independent key regions were selected, with a 5-pixel buffer zone reserved at the edge of each key region to eliminate background interference. Within each key region, FAST corner detection was used to extract corner points with gradient changes greater than 30 as initial feature points. Then, Harris response values were used to filter and retain the top 80% of feature points to ensure representativeness and sparsity. Optical flow was used to establish matching relationships between feature points in adjacent frames. A 5×5 search window was constructed at the corresponding positions in adjacent frames, using the current frame's feature points as a reference. Similarity was calculated using normalized cross-correlation coefficients to determine if a match was valid. For valid matches, the pixel displacement difference in the x and y directions between adjacent frames was calculated to obtain the displacement amount. The arctangent function was used to determine the displacement direction, and the real-time motion speed was calculated based on the camera frame rate, ultimately forming the motion vector set for each key region. Next, the theoretical blur kernel length was calculated based on the rotational speed, and the theoretical blur kernel direction was determined based on the axle rotation direction; thus, the initial parameters of the theoretical blur kernel were obtained. Specifically, the rotational speed is first converted into angular velocity. Then, the actual radii of key areas such as the bearing outer ring, fasteners, and journals from the center of rotation are obtained. The actual arc length of the key areas within the exposure time is calculated using the industrial camera's exposure time. The actual arc length is then converted into a pixel-scale blur kernel length using the camera's pixel dimensions. The theoretical blur kernel direction is determined based on the axle rotation direction: the blur kernel direction is set to negative for clockwise rotation and positive for counterclockwise rotation using the rotation direction signal fed back from the encoder. The tangent angle is calculated from the relative position of the area's center coordinates and the center of rotation, ultimately yielding the theoretical blur kernel length and direction. Then, a genetic algorithm is used to optimize the blur kernel parameters by maximizing the edge gradient entropy of the key areas. Finally, the optimal blur kernel parameters are deblurred to obtain the motion-compensated image.
[0054] Dynamic assembly parameters, including the radial runout of the bearing outer ring and the rotational offset angle of the fasteners, are extracted from the motion-compensated image using an improved YOLOv8 algorithm. The calculation methods are as follows: the radial runout of the bearing outer ring is fitted to a circle using the least squares method with respect to the edge coordinates of the image to obtain the center coordinates and radius; and the radial offset of the outer ring center relative to the reference is calculated using the axle rotation center as the reference. The fastener rotation offset angle is the absolute value of the angle difference between the fastener direction vector of the first frame and the direction vector of the current frame, calculated based on the fastener direction vector of the first frame.
[0055] Then, after the dynamic test is completed, the dynamic assembly parameters are compared with the preset dynamic standard parameter library and standard vibration data to determine whether they are qualified.
[0056] Finally, multiple rounds of static and dynamic testing are performed to reach the set number of testing rounds. If all rounds of testing are qualified and the vibration data is normal, the axle assembly quality is deemed qualified; if any round of testing is unqualified, it is deemed unqualified.
[0057] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments for application in other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A machine vision-based method for inspecting the assembly quality of axles, characterized in that, Includes the following steps: S1. First, fix the assembled axle onto the positioning fixture, and use an industrial camera to collect static image data of the assembled axle. S2. Perform image processing on the static image data to obtain the processed static image; S3. Use the improved YOLOv8 algorithm to extract static assembly parameters, including the coaxiality of the bearing inner ring and journal, the fitting clearance between the shaft shoulder and the bearing end face, the integrity of the fastener edges, and the mating clearance between the keyway and the key; compare the static assembly parameters with the preset static standard parameter library, and if all parameters are within the tolerance range, perform dynamic detection. S4. Dynamic testing is used to conduct dynamic tests on axles that have passed static testing. The test time is preset and the test is performed according to the actual use scenario. Dynamic sequence images and vibration data of the axle at preset speed gradients from idle speed to rated speed are collected after the test. S5. Perform motion blur compensation on the dynamic sequence image and extract dynamic assembly parameters based on the improved YOLOv8 algorithm. The dynamic assembly parameters include the radial runout of the bearing outer ring and the rotational offset angle of the fastener. Then, perform noise reduction processing on the vibration data. S6. Compare the dynamic assembly parameters with the preset dynamic standard parameter library and standard vibration data to determine whether they are qualified. S7. Perform multiple rounds of static and dynamic testing. If all rounds of testing are qualified and the vibration data is normal, the axle assembly quality is deemed qualified; if any round of testing is unqualified, it is deemed unqualified.
2. The machine vision-based axle assembly quality inspection method according to claim 1, characterized in that, The implementation of step S2, which involves image processing of the static image data to obtain the processed static image, includes: S21. For the input static original image I, for each pixel... Take its initial 3×3 neighborhood Calculate the gradient magnitude of the pixel. and local noise intensity The gradient magnitude of the pixel is calculated as follows: ,in These are the gradients in the horizontal and vertical directions, respectively; the local noise intensity is calculated as follows: ,in, This represents the grayscale value of the static original image at pixel coordinates (x, y). It is the mean of all pixels in the 3×3 neighborhood; S22. Normalize the gradient and noise intensity to obtain the normalized gradient and noise intensity, and then obtain the side length of the filter window for each pixel. The calculation method is as follows: ,in Represented as the base length of the window. These are the weighting coefficients, This is the normalized value of the local noise intensity. This is the normalized value of the gradient magnitude of the pixel; S23. Constrain and round the window if... Then force the minimum window size to be 3. Then the mandatory order is 7, if Then round it to the nearest odd number to obtain the side length of the filter window for that pixel. ; S24, in pixels Construct a structure with a side length of [missing information] at the center. A square filtering window is used, and the median gray value of all pixels within the window is calculated as the filtered pixel value. S25. Filter the image. An edge map is obtained through edge detection, and then the edge confidence score is calculated. The calculation method for the edge confidence is as follows: ,in, For any point gradient value, The average gradient value of the surrounding neighborhood. To avoid the denominator being zero for extremely small constants, This represents the number of edge pixels within the neighborhood. Given the total number of pixels in the neighborhood, targeted sharpening is performed based on a preset edge confidence threshold to obtain the final static image. The calculation method is as follows: ,in, To sharpen the intensity, For directional sharpening operators, based on edge direction angles choose, The set edge confidence threshold.
3. The machine vision-based axle assembly quality inspection method according to claim 1, characterized in that, The improved YOLOv8 algorithm used in step S3 is implemented by serially connecting a gap feature attention module (GAM) after the C2f feature extraction unit in the YOLOv8 algorithm backbone layer; the GAM is constructed as follows: S311. Receive the multi-scale feature map F output by the C2f unit in the Backbone layer. This feature map includes features at three different scales. S312. Perform global average pooling on the feature map F to obtain the channel-dimensional feature vector. ,Will The input consists of a channel mapping network with two fully connected layers, with a ReLU activation function inserted in between to achieve a non-linear transformation. The output is the channel attention weights. ; S313, will Multiplying the original feature map F by the channel dimension completes the enhancement of gap-related features at the channel level; S314. Perform a 3×3 convolution on the enhanced feature map to compress the number of channels to 1, resulting in a single-channel feature map. Then, the Sigmoid activation function is applied to... Normalization is performed to generate spatial attention weights. ,Will Multiply the enhanced feature map of the channel element by element to complete the enhancement of the key assembly area at the spatial level; S315. Perform a 1×1 convolution on the spatially enhanced feature map, adjust the number of channels to match the input feature map F, and output the final enhanced feature map. .
4. The machine vision-based axle assembly quality inspection method according to claim 3, characterized in that, The implementation of the improved YOLOv8 algorithm for extracting static assembly parameters based on the series gap feature attention module GAM includes: S321. Embed one GAM module after each of the three different scale C2f units of the original YOLOv8 Backbone; S322, Enhanced feature maps output by the three C2f-GAM units. Input to the Neck layer, and scale transfer from top to bottom is achieved through the feature pyramid network to obtain the fused multi-scale feature map; S323. Finally, the fused feature map is input into the regression head and detection head of the Head layer. The detection head identifies key components of the axle assembly and calculates static assembly parameter values.
5. The machine vision-based axle assembly quality inspection method according to claim 1, characterized in that, Before the dynamic detection in step S4, the preload of the fastener also needs to be detected. The torque sensor and the angle encoder are used to detect the real-time torque value and the angle value. A tightening curve is constructed from the collected torque value and angle value data. The established tightening curve is compared with the standard tightening curve, and the difference in the integral area of the two curves in the elastic segment is calculated. If it exceeds the set threshold, the preload is determined to be unqualified; otherwise, it is qualified.
6. The machine vision-based axle assembly quality inspection method according to claim 1, characterized in that, The implementation of motion blur compensation for dynamic sequence images in step S5 includes: S51. First, establish the association marker between dynamic sequence images and rotational speed. Bind the collected speeds from idle to rated speed at each preset gradient to the corresponding dynamic sequence image frame one by one, and add a unique rotational speed label to each image frame. S52. For key regions related to dynamic assembly parameters in dynamic sequence images, extract the feature point set of each key region using optical flow method; obtain the motion vector of the key region by calculating the displacement and displacement direction of the same feature point between adjacent frames. S53. Calculate the theoretical fuzzy kernel length based on the rotational speed, and determine the theoretical fuzzy kernel direction based on the axle rotation direction; obtain the initial parameters of the theoretical fuzzy kernel; S54. The optimal fuzzy kernel parameters are obtained by using a genetic algorithm with the objective function of maximizing the edge gradient entropy of the key region. S55. Finally, the obtained optimal blur kernel parameters are deblurred to obtain the motion-compensated image.
7. The machine vision-based axle assembly quality inspection method according to claim 1, characterized in that, The noise reduction of the vibration data in step S5 is achieved using the Kalman filter algorithm.
Citation Information
Patent Citations
Vehicle door surface defect detection method based on improved YOLOv8 network
CN117173096A
Dynamic scene online calibration method and system for three-dimensional target detection
CN120563628A
Light-weight truck axle type detection method based on infrared imaging
CN120656135A
Deep learning based robot target recognition and motion detection method, storage medium and apparatus
US11763485B1
Cited By
Automatic milling cutter setting method and system based on machine vision
CN121616664A