Slide rail assembly quality detection method and system based on machine vision
Through machine vision-based detection methods and dynamic tensile testing technology, the lack of subjectivity and sliding performance detection in the existing technology is solved, and the automation and comprehensive quality control of slide rail assembly quality inspection are realized.
Patent Information
- Application Number
- CN202510212144.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-06-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The quality inspection of existing slide rail assembly mainly relies on manual labor, with subjective differences, easy fatigue and no sliding performance detection, resulting in the problem of poor sliding performance of finished slide rails.
Using machine vision-based detection methods, we obtain slide rail surface defect images through high-resolution industrial cameras, and combine deep learning algorithms to achieve all-round automated detection. At the same time, precision electromechanical control and high-speed imaging technology are used to conduct dynamic tensile testing on the slide rails, extract motion characteristics and detect potential performance problems through frequency domain analysis.
It realizes automatic detection of surface defects of slide rails and dynamic evaluation of sliding performance, covering static surface defect detection and dynamic sliding performance evaluation in time and frequency analysis, significantly improving detection efficiency and ensuring comprehensive quality control from appearance to function.
Smart Images

Figure CN120102590A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision detection, and in particular to a method and system for detecting the assembly quality of a slide rail based on machine vision. Background Art
[0002] In the current slide rail production industry, the slide rail assembly quality inspection mainly relies on manual surface quality inspection. Inspectors use their naked eyes and simple tools to judge the defects of the slide rail surface, such as scratches, position deviation, corrosion, and coating shedding. This manual inspection method has many limitations. On the one hand, the subjective factors of the inspectors have a great influence on the inspection results. The experience and judgment standards of different personnel are different, which easily leads to inconsistency in the inspection results; on the other hand, long-term inspection work easily makes the inspectors fatigued, further increasing the probability of missed inspections and false inspections. More importantly, the existing inspection process does not perform sliding performance inspections on assembled slide rails. This means that even if the surface quality of the finished slide rail is qualified, there may be problems with poor sliding performance, such as the inner rail sliding jamming, uneven sliding speed, etc., which seriously affects the performance and reliability of the slide rail in actual use. Summary of the invention
[0003] In order to solve at least one of the technical problems mentioned above, the present invention provides a method and system for detecting the quality of slide rail assembly based on machine vision.
[0004] In a first aspect, the present invention provides a method for detecting the quality of slide rail assembly based on machine vision, the method comprising: Acquire slide rail shrinkage images at multiple angles in the slide rail shrinkage state; input the slide rail shrinkage images into a pre-trained slide rail surface defect prediction algorithm, and output the slide rail surface defect type; When the type of surface defect of the slide rail is normal, the outer rail of the slide rail is fixed, the inner rail of the slide rail is pulled out with a preset tensile force, and the stretching image of the slide rail during the stretching process of the inner rail of the slide rail is collected at a preset frequency; According to the multiple slide rail stretching images, the inner rail sliding velocity sequence of the slide rail is obtained by analysis, and the inner rail sliding velocity sequence is subjected to Fourier transform to obtain a frequency spectrum representation; Analyze whether there is a characteristic frequency in the spectrum representation; if there is a characteristic frequency, calculate the signal-to-noise ratio at the characteristic frequency. When the signal-to-noise ratio is greater than a preset threshold, determine that the sliding component of the slide rail has a periodic disturbance anomaly; analyze whether there are multiple harmonics in the spectrum representation; if there are multiple harmonics, determine that the sliding component of the slide rail has a wear anomaly.
[0005] Preferably, the analyzing and obtaining the inner rail sliding speed sequence of the slide rail according to the plurality of slide rail stretching images comprises: Grayscale processing is performed on the slide rail stretching image; a difference image sequence is generated by pixel-by-pixel subtraction of two adjacent frames of slide rail stretching images, and the difference image sequence includes a plurality of difference images; The SIFT algorithm is used to extract the feature points of the difference image, and feature point matching is performed in the difference image based on the feature points. According to the matching results of the feature points, the actual displacement of the inner rail of the slide rail along the direction of the slide rail between each frame is calculated; Based on the preset frequency, according to the actual displacements corresponding to different frames, the inner rail sliding speed at the corresponding moment is calculated, and the inner rail sliding speeds at different moments are integrated to obtain the inner rail sliding speed sequence.
[0006] Preferably, the step of inputting the slide rail shrinkage image into a pre-trained slide rail surface defect prediction algorithm and outputting the slide rail surface defect type comprises: Grayscale processing is performed on the slide rail contraction image to obtain a grayscale image of the slide rail surface; Based on the grayscale difference characteristics between each pixel point in the grayscale image of each slide rail surface and the image as a whole, the key points for slide rail surface defect analysis are calculated; Clustering algorithm is used to cluster the key points of slide rail surface defect analysis to obtain the slide rail surface defect analysis area; Based on the texture features, grayscale difference features and distribution features of each defect analysis key point of the slide rail surface defect analysis area, a defect morphology feature vector of each slide rail defect analysis area is constructed; The processed rail surface defect feature vector is input into the rail surface defect prediction algorithm pre-trained based on the SVM algorithm to output the rail surface defect type.
[0007] Preferably, the types of surface defects of the slide rail include normal, scratch, position shift, corrosion and coating peeling.
[0008] In a second aspect, the present invention further provides a slide rail assembly quality inspection system based on machine vision, the system comprising: The surface defect prediction module is used to obtain the slide rail shrinkage images at multiple angles in the slide rail shrinkage state; input the slide rail shrinkage images into the pre-trained slide rail surface defect prediction algorithm, and output the slide rail surface defect type; The slide rail stretching image acquisition module is used to fix the outer rail of the slide rail, pull out the inner rail of the slide rail with a preset stretching force, and acquire the slide rail stretching image during the stretching process of the inner rail of the slide rail at a preset frequency when the surface defect type of the slide rail is normal; A Fourier transform processing module is used to analyze and obtain the inner rail sliding speed sequence of the slide rail according to the multiple slide rail stretching images, and perform Fourier transform on the inner rail sliding speed sequence to obtain a frequency spectrum representation; The sliding component defect analysis module is used to analyze whether there is a characteristic frequency in the spectrum representation; if there is a characteristic frequency, calculate the signal-to-noise ratio at the characteristic frequency. When the signal-to-noise ratio is greater than a preset threshold, it is determined that the sliding component of the slide rail has a periodic disturbance anomaly; analyze whether there are multiple harmonics in the spectrum representation; if there are multiple harmonics, it is determined that the sliding component of the slide rail has a wear anomaly.
[0009] Preferably, the Fourier transform processing module is further used for: Grayscale processing is performed on the slide rail stretching image; a difference image sequence is generated by pixel-by-pixel subtraction of two adjacent frames of slide rail stretching images, and the difference image sequence includes a plurality of difference images; The SIFT algorithm is used to extract the feature points of the difference image, and feature point matching is performed in the difference image based on the feature points. According to the matching results of the feature points, the actual displacement of the inner rail of the slide rail along the direction of the slide rail between each frame is calculated; Based on the preset frequency, according to the actual displacements corresponding to different frames, the inner rail sliding speed at the corresponding moment is calculated, and the inner rail sliding speeds at different moments are integrated to obtain the inner rail sliding speed sequence.
[0010] Preferably, the surface defect prediction module is also used for: Grayscale processing is performed on the slide rail contraction image to obtain a grayscale image of the slide rail surface; Based on the grayscale difference characteristics between each pixel point in the grayscale image of each slide rail surface and the image as a whole, the key points for slide rail surface defect analysis are calculated; Clustering algorithm is used to cluster the key points of slide rail surface defect analysis to obtain the slide rail surface defect analysis area; Based on the texture features, grayscale difference features and distribution features of each defect analysis key point of the slide rail surface defect analysis area, a defect morphology feature vector of each slide rail defect analysis area is constructed; The processed rail surface defect feature vector is input into the rail surface defect prediction algorithm pre-trained based on the SVM algorithm to output the rail surface defect type.
[0011] In a third aspect, the present invention further provides an electronic device comprising a processor and a memory, wherein the memory is used to store computer program code, and the computer program code comprises computer instructions. When the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof.
[0012] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the method as described in the first aspect above and any possible implementation thereof.
[0013] Compared with the prior art, the present invention has the following beneficial effects: The present invention adopts high-resolution industrial cameras and deep learning algorithms to realize all-round automated detection of slide rail surface defects, breaking through the limitations of manual visual inspection; at the same time, it combines precision electromechanical control and high-speed imaging technology to perform dynamic tensile tests on the slide rail, extract motion features, and explore potential performance problems through frequency domain analysis, effectively making up for the lack of sliding performance detection in traditional methods. The present invention covers static surface defect detection, dynamic sliding performance evaluation and time-frequency joint analysis, realizing comprehensive quality control from appearance to function, and significantly improving detection efficiency.
[0014] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0016] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0017] Figure 1 A flow chart of a method for detecting the quality of slide rail assembly based on machine vision provided by an embodiment of the present invention; Figure 2 A schematic structural diagram of a slide rail assembly quality inspection system based on machine vision provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0020] Currently, the slide rail assembly quality inspection relies on manual surface quality inspection, which is subject to subjective differences and prone to fatigue leading to false inspections. In addition, the sliding performance is not tested, resulting in poor sliding performance of the finished slide rail, which cannot meet the modern production requirements for high precision, high efficiency and high reliability.
[0021] See also Figure 1 , Figure 1 The present invention provides a flow chart of a method for detecting the quality of slide rail assembly based on machine vision. Figure 1 As shown, the method includes: S100, obtaining slide rail shrinkage images at multiple angles in a slide rail shrinkage state; inputting the slide rail shrinkage images into a pre-trained slide rail surface defect prediction algorithm, and outputting the slide rail surface defect type; In this embodiment, a high-precision industrial camera is used, and an automatic turntable that can rotate 360 degrees is used to fix the slide rail on the turntable. The slide rail in the contracted state is photographed at an angle interval of 15 degrees to obtain slide rail contraction images at different angles. A high-precision industrial camera refers to a camera with high resolution, high frame rate and good low-light performance, which can clearly capture the surface details of the slide rail; the automatic turntable is a device that can accurately control the rotation angle to ensure that the camera can stably shoot at different angles. The "pre-trained slide rail surface defect prediction algorithm" adopts a CNN network architecture. In the training stage, data enhancement is used to generate a training set of defect types including scratches (simulating linear textures of different lengths / depths), position offset (synthesized by image translation), corrosion (adding randomly distributed spot noise), and coating shedding (using irregular polygonal masks). The network output layer uses the Softmax function to calculate the probability of each category. When the confidence of the "normal" category exceeds 98%, the subsequent detection process is triggered.
[0022] In a possible embodiment, other machine learning algorithms may be used to pre-train the slide rail surface defect prediction algorithm to accurately identify the type of slide rail surface defects.
[0023] S200, when the type of the surface defect of the slide rail is normal, the outer rail of the slide rail is fixed, the inner rail of the slide rail is pulled out with a preset tensile force, and a slide rail stretching image during the stretching process of the inner rail of the slide rail is collected at a preset frequency; The outer rail of the slide rail is firmly fixed on the mechanical test platform by a clamp. The clamp is used to adapt to the outer rails of slide rails of different specifications to ensure the stability of the fixation. The preset tensile force is applied by a high-precision electric tensile testing machine. The electric tensile testing machine can accurately control the magnitude and change rate of the tensile force and set the corresponding tensile force according to the standard parameters of different types of slide rails. At a preset frequency of 10 frames per second, another industrial camera is used to shoot the stretching process of the inner rail of the slide rail to obtain the stretching image of the slide rail. The mechanical test platform here is used to provide a stable test environment, carry the slide rail and cooperate with the tensile testing machine for mechanical testing; the high-precision electric tensile testing machine is a device that can accurately measure and control the tensile force, and is often used for material mechanical property testing.
[0024] In this embodiment, the "grayscale processing" uses the weighted average method (Y=0.299R+0.587G+0.114B) to convert the image; when the "difference image sequence" is generated, the adjacent frames are subjected to gamma correction (γ=2.2) and then the absolute value difference operation is performed; the SIFT feature point extraction sets the contrast threshold to 0.03 and the edge threshold to 10, and uses a 128-dimensional descriptor for bidirectional matching; the "actual displacement" calculation introduces the RANSAC algorithm to eliminate the mismatched points, and combines the camera calibration parameters (each pixel corresponds to 0.015mm) for spatial conversion, and the displacement of 5 consecutive frames is subjected to sliding average filtering and then derived to obtain the instantaneous velocity, and integrated S300, analyzing and obtaining an inner rail sliding velocity sequence of the slide rail according to the plurality of slide rail stretching images, and performing Fourier transform on the inner rail sliding velocity sequence to obtain a frequency spectrum representation; The color rail stretching image is converted into a grayscale image through a brightness weighted algorithm, and the grayscale value is obtained by weighted summing of the red, green and blue channels. The grayscale stretching images of two adjacent frames are subtracted pixel by pixel to generate a series of difference images. These difference images can highlight the position changes of the inner rail of the rail at adjacent moments. Then, the scale-invariant feature transform (SIFT) algorithm is used. This algorithm is based on the scale space theory of the image. By constructing a Gaussian difference pyramid, the key points in the image are detected at different scales, and the feature descriptors of the key points are calculated to extract the feature points in the difference image. Based on these feature points, the Euclidean distance or other similarity measurement methods such as the Hamming distance between the feature points are used to match the feature points in the difference image. According to the coordinate changes of the successfully matched feature points in different images, combined with the actual size calibration parameters of the rail, the actual displacement of the inner rail of the rail along the rail direction between each frame is calculated by trigonometric function calculation. Based on the preset frequency of 10 frames per second, that is, the time interval of each frame image is 0.1 seconds, according to the actual displacement corresponding to different frames, the speed calculation formula (speed = displacement ÷ time) is used to calculate the inner rail sliding speed at the corresponding moment, and the inner rail sliding speeds at different moments are integrated in time sequence to obtain the inner rail sliding speed sequence. Finally, the inner rail sliding speed sequence is input into a professional signal processing software that integrates multiple signal processing algorithms, such as filtering, transformation, etc., has a friendly user interface, simple and intuitive operation, and efficient computing performance, and can use parallel computing to accelerate processing. The Fast Fourier Transform (FFT) algorithm is used. This algorithm converts the inner rail sliding speed sequence in the time domain into a frequency spectrum representation in the frequency domain through a clever butterfly operation structure, and decomposes the complex time domain signal into a superposition of sine and cosine waves of different frequency components, so as to conduct in-depth analysis of the frequency characteristics of the signal in the future.
[0025] S400, analyzing whether there is a characteristic frequency in the spectrum representation; if there is a characteristic frequency, calculating the signal-to-noise ratio at the characteristic frequency, and when the signal-to-noise ratio is greater than a preset threshold, determining that a periodic disturbance abnormality occurs in the sliding component of the slide rail; analyzing whether there are multiple harmonics in the spectrum representation; if there are multiple harmonics, determining that a wear abnormality occurs in the sliding component of the slide rail.
[0026] When analyzing the spectrum representation, the comparison is performed based on the pre-built normal operating spectrum database of the rail. This database is obtained by long-term testing of a large number of rails of different models and specifications in normal working conditions, collecting spectrum data under various working conditions, and using data mining techniques, such as association rule mining to analyze the relationship between different parameters, and anomaly detection algorithms to identify abnormal data points, to extract the characteristic patterns and ranges of the normal spectrum. When searching according to these established characteristic frequency ranges, the software uses an efficient peak detection algorithm to quickly and accurately locate the characteristic frequency peaks in the spectrum. Once the characteristic frequency is detected, the built-in high-precision signal power calculation module is started. This module uses an accurate algorithm based on integral operation to convert the signal at the characteristic frequency from the time domain to the frequency domain, and calculates the power value of the signal at this frequency by integration. At the same time, the noise estimation method based on wavelet packet transform is used, which can decompose the signal into finer frequency bands, estimate the noise of each frequency band separately, and then comprehensively calculate the noise power at the characteristic frequency. After the signal-to-noise ratio is obtained by dividing the two, it is compared with the preset threshold.
[0027] The process of determining the preset threshold is to deeply analyze the test data of a large number of normal slide rails and slide rails with periodic disturbance abnormalities through ensemble learning algorithms in machine learning, such as random forest fusion of multiple decision tree models and Adaboost iterative training of multiple weak classifiers. During the training process, the model parameters are continuously adjusted to optimize the classification effect, and finally the optimal threshold that can distinguish normal and abnormal states to the greatest extent is determined. When the calculated signal-to-noise ratio is greater than the preset threshold, the duration and number of occurrences of the characteristic frequency are further analyzed. If the characteristic frequency continues to appear and the number of occurrences exceeds a certain proportion (such as more than 60% of the total number of detections) within multiple consecutive detection cycles (such as 5 consecutive detection cycles), it is determined that the sliding component of the slide rail has a periodic disturbance abnormality. At the same time, in the spectrum analysis, the harmonic detection algorithm based on the phase information of the fast Fourier transform can not only quickly search for multiple harmonics based on the integer multiple relationship of the frequency, but also determine whether the harmonic is caused by normal mechanical vibration or abnormal vibration caused by wear of the sliding component by analyzing the phase characteristics of the harmonic. When multiple harmonics are detected, the amplitude and frequency distribution characteristics of the harmonics are combined, and according to the pre-set fault diagnosis rules and knowledge base, the degree of wear and possible wear locations of the sliding components of the slide rails are further determined, providing more accurate guidance for subsequent maintenance and quality improvement.
[0028] In this embodiment, a high-resolution industrial camera and a deep learning algorithm are used to realize all-round automated detection of surface defects of the slide rail, breaking through the limitations of manual visual inspection. At the same time, precise electromechanical control and high-speed imaging technology are combined to perform dynamic tensile testing on the slide rail, extract motion features, and explore potential performance problems through frequency domain analysis, which effectively makes up for the lack of sliding performance detection in traditional methods. The present invention covers static surface defect detection, dynamic sliding performance evaluation, and time-frequency joint analysis, realizing comprehensive quality control from appearance to function, and significantly improving detection efficiency.
[0029] Preferably, the analyzing and obtaining the inner rail sliding speed sequence of the slide rail according to the plurality of slide rail stretching images comprises: Grayscale processing is performed on the slide rail stretching image; a difference image sequence is generated by pixel-by-pixel subtraction of two adjacent frames of slide rail stretching images, and the difference image sequence includes a plurality of difference images; The SIFT algorithm is used to extract the feature points of the difference image, and feature point matching is performed in the difference image based on the feature points. According to the matching results of the feature points, the actual displacement of the inner rail of the slide rail along the direction of the slide rail between each frame is calculated; Based on the preset frequency, according to the actual displacements corresponding to different frames, the inner rail sliding speed at the corresponding moment is calculated, and the inner rail sliding speeds at different moments are integrated to obtain the inner rail sliding speed sequence.
[0030] The cv2.cvtColor function in OpenCV is used to grayscale the slide-stretched image based on the brightness weighted algorithm, and the colored slide-stretched image is accurately converted into a grayscale image. Multi-threading technology is used to perform parallel processing on a large number of collected slide-stretched images, greatly improving the efficiency of grayscale processing.
[0031] The pixel-by-pixel operation function of MATLAB is used to perform pixel-by-pixel subtraction operations on two adjacent grayscale slide rail stretching images. The software supports GPU acceleration and can quickly process large-scale image data and generate a series of difference images in a very short time. At the same time, in order to ensure the accuracy of the difference image, the image is edge detected and filtered to remove artifacts caused by noise or other interference factors, ensuring that the difference image can truly and clearly highlight the position changes of the inner rail of the slide rail at adjacent moments. The SIFT algorithm library is used. Based on the scale space theory, the algorithm library parallelizes the construction process of the Gaussian difference pyramid, which greatly shortens the calculation time. The key points in the difference image are quickly detected at different scales, and the feature descriptors of the key points are calculated by the improved algorithm to extract the feature points in the difference image. In the feature point matching stage, data structures such as KD tree are used, combined with Hamming distance and bidirectional matching strategy, to perform efficient feature point matching in the difference image. KD tree can quickly locate similar feature points, and the bidirectional matching strategy further improves the accuracy of matching and avoids the occurrence of mismatching. According to the coordinate changes of the successfully matched feature points in different images, combined with the actual size calibration parameters of the slide rail obtained in advance by high-precision laser measurement equipment, trigonometric functions and spatial geometry algorithms are used to accurately calculate the actual displacement of the inner rail of the slide rail along the direction of the slide rail between each frame.
[0032] Based on the preset frequency of 10 frames per second, a specially developed speed calculation software module is used. The module has a built-in efficient numerical calculation engine. According to the actual displacement corresponding to different frames, the inner rail sliding speed at the corresponding moment is quickly calculated in strict accordance with the speed calculation formula (speed = displacement ÷ time). When integrating the inner rail sliding speed at different moments, data caching and batch processing technology are used to store the calculated speed data in the cache first. When the cache reaches a certain amount, it is integrated and processed at one time to generate the inner rail sliding speed sequence. The speed sequence is smoothed to remove abnormal values caused by accidental factors to ensure the stability and reliability of the speed sequence.
[0033] In this embodiment, the slide rail stretching image is grayed based on the brightness weighted algorithm by using OpenCV and other professional image algorithm libraries, and multi-threaded parallel processing is used; with the help of high-performance image analysis software such as MATLAB, GPU is combined to accelerate pixel-by-pixel subtraction to generate difference images, and edge detection and filtering are performed; the SIFT algorithm library is used to construct a Gaussian difference pyramid in parallel to extract feature points, and the KD tree and bidirectional matching strategy are used to match, and the displacement is calculated in combination with the calibration parameters of high-precision laser measurement; based on the preset frequency, the speed is calculated according to the speed formula using a special software module, and the inner rail sliding speed sequence is generated and smoothed through data caching and batch processing. The present invention improves detection accuracy, enhances data processing stability, and facilitates algorithm optimization and function expansion, improving system adaptability and maintainability.
[0034] Preferably, the step of inputting the slide rail shrinkage image into a pre-trained slide rail surface defect prediction algorithm and outputting the slide rail surface defect type comprises: Grayscale processing is performed on the slide rail contraction image to obtain a grayscale image of the slide rail surface; Based on the grayscale difference characteristics between each pixel point in the grayscale image of each slide rail surface and the image as a whole, the key points for slide rail surface defect analysis are calculated; Clustering algorithm is used to cluster the key points of slide rail surface defect analysis to obtain the slide rail surface defect analysis area; Based on the texture features, grayscale difference features and distribution features of each defect analysis key point of the slide rail surface defect analysis area, a defect morphology feature vector of each slide rail defect analysis area is constructed; The processed rail surface defect feature vector is input into the rail surface defect prediction algorithm pre-trained based on the SVM algorithm to output the rail surface defect type.
[0035] For each grayscale image of the rail surface, the difference between each pixel and the overall grayscale mean of the image is calculated by traversing pixel by pixel, and this is used as the grayscale difference feature. The gradient-based Harris corner detection algorithm is improved, and combined with the grayscale difference feature, points with obvious grayscale changes in the image are found as key points for rail surface defect analysis. The algorithm calculates the gradient of the image in the x and y directions, constructs an autocorrelation matrix, and uses the eigenvalues of the matrix to judge the strength and stability of the key points to ensure that the detected key points can accurately reflect the potential defect locations. The DBSCAN density clustering algorithm is selected, which can cluster according to the density distribution of data points without presetting the number of clusters. The key points for rail surface defect analysis obtained in the previous step are used as input data, and the key points are clustered by setting a suitable neighborhood radius and minimum point number threshold. During the processing, the DBSCAN algorithm divides the density-connected data points into the same category, and marks the data points in the low-density area as noise points, thereby obtaining an accurate rail surface defect analysis area. For each slide rail surface defect analysis area, the grayscale co-occurrence matrix is used to extract texture features. The matrix reflects the texture information of the image by statistically analyzing the grayscale relationship between pixel pairs separated by a certain distance in the image. The previously calculated grayscale difference features are combined with the clustering algorithm to cluster the key points of defect analysis again to obtain the distribution characteristics of the key points. After normalizing these features, they are combined into a multidimensional vector in a specific order to construct the defect morphology feature vector of each slide rail defect analysis area, which comprehensively and accurately describes the morphology and characteristics of the defects.
[0036] The constructed rail surface defect feature vector is input into the rail surface defect prediction model pre-trained based on the support vector machine algorithm. In the pre-training stage, a large number of rail image samples containing different types of defects (such as scratches, position offset, corrosion and coating peeling, etc.) are used. The parameters of the rail surface defect prediction model, such as kernel function type, penalty parameter, etc., are adjusted through cross-validation and other methods to improve the generalization ability and accuracy of the model. The rail surface defect prediction model finds an optimal classification hyperplane according to the input feature vector, classifies it into the corresponding rail surface defect type, and outputs the final defect detection result.
[0037] In this embodiment, the grayscale difference features are calculated by traversing each pixel, the improved gradient-based Harris corner detection algorithm is used to find the key points for defect analysis, the DBSCAN density clustering algorithm is used to cluster the key points to obtain the defect analysis area, the grayscale co-occurrence matrix is used to extract texture features, the grayscale difference and the key point distribution features obtained by the clustering algorithm are combined, and the defect morphology feature vector is constructed after normalization. Finally, it is input into the model pre-trained based on the support vector machine to predict the defect type. The present invention improves the detection accuracy and enhances the adaptability to different defect forms and working conditions.
[0038] Preferably, the types of surface defects of the slide rail include normal, scratch, position shift, corrosion and coating peeling.
[0039] In summary, the method provided in this embodiment can at least achieve the following effects: The present invention adopts high-resolution industrial cameras and deep learning algorithms to realize all-round automated detection of slide rail surface defects, breaking through the limitations of manual visual inspection; at the same time, it combines precision electromechanical control and high-speed imaging technology to perform dynamic tensile tests on the slide rail, extract motion features, and explore potential performance problems through frequency domain analysis, effectively making up for the lack of sliding performance detection in traditional methods. The present invention covers static surface defect detection, dynamic sliding performance evaluation and time-frequency joint analysis, realizing comprehensive quality control from appearance to function, and significantly improving detection efficiency.
[0040] See also Figure 2 In one embodiment, a slide rail assembly quality detection system based on machine vision is also provided, the system comprising: The surface defect prediction module 100 is used to obtain slide rail shrinkage images at multiple angles when the slide rail is in a shrinkage state; input the slide rail shrinkage images into a pre-trained slide rail surface defect prediction algorithm, and output the slide rail surface defect type; The slide rail stretching image acquisition module 200 is used to fix the outer rail of the slide rail, pull out the inner rail of the slide rail with a preset stretching force, and acquire the slide rail stretching image during the stretching process of the inner rail of the slide rail at a preset frequency when the slide rail surface defect type is normal; The Fourier transform processing module 300 is used to analyze and obtain the inner rail sliding speed sequence of the slide rail according to the plurality of slide rail stretching images, and perform Fourier transform on the inner rail sliding speed sequence to obtain a frequency spectrum representation; The sliding component defect analysis module 400 is used to analyze whether there is a characteristic frequency in the spectrum representation; if there is a characteristic frequency, calculate the signal-to-noise ratio at the characteristic frequency, and when the signal-to-noise ratio is greater than a preset threshold, determine that the sliding component of the slide rail has a periodic disturbance anomaly; analyze whether there are multiple harmonics in the spectrum representation; if there are multiple harmonics, determine that the sliding component of the slide rail has a wear anomaly.
[0041] Preferably, the Fourier transform processing module 300 is further used for: Grayscale processing is performed on the slide rail stretching image; a difference image sequence is generated by pixel-by-pixel subtraction of two adjacent frames of slide rail stretching images, and the difference image sequence includes a plurality of difference images; The SIFT algorithm is used to extract the feature points of the difference image, and feature point matching is performed in the difference image based on the feature points. According to the matching results of the feature points, the actual displacement of the inner rail of the slide rail along the direction of the slide rail between each frame is calculated; Based on the preset frequency, according to the actual displacements corresponding to different frames, the inner rail sliding speed at the corresponding moment is calculated, and the inner rail sliding speeds at different moments are integrated to obtain the inner rail sliding speed sequence.
[0042] Preferably, the surface defect prediction module 100 is also used for: Grayscale processing is performed on the slide rail contraction image to obtain a grayscale image of the slide rail surface; Based on the grayscale difference characteristics between each pixel point in the grayscale image of each slide rail surface and the image as a whole, the key points for slide rail surface defect analysis are calculated; Clustering algorithm is used to cluster the key points of slide rail surface defect analysis to obtain the slide rail surface defect analysis area; Based on the texture features, grayscale difference features and distribution features of each defect analysis key point of the slide rail surface defect analysis area, a defect morphology feature vector of each slide rail defect analysis area is constructed; The processed rail surface defect feature vector is input into the rail surface defect prediction algorithm pre-trained based on the SVM algorithm to output the rail surface defect type.
[0043] It can be understood that the functions or modules included in the system provided in this embodiment can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.
[0044] The present invention also provides an electronic device, including a processor and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes a method as described in any possible implementation manner.
[0045] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any possible implementation manner.
[0046] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0047] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.
Claims
1. A method for detecting the quality of slide rail assembly based on machine vision, characterized in that: The method comprises: Acquire slide rail shrinkage images at multiple angles in the slide rail shrinkage state; input the slide rail shrinkage images into a pre-trained slide rail surface defect prediction algorithm, and output the slide rail surface defect type; When the type of surface defect of the slide rail is normal, the outer rail of the slide rail is fixed, the inner rail of the slide rail is pulled out with a preset tensile force, and the stretching image of the slide rail during the stretching process of the inner rail of the slide rail is collected at a preset frequency; According to the multiple slide rail stretching images, the inner rail sliding velocity sequence of the slide rail is obtained by analysis, and the inner rail sliding velocity sequence is subjected to Fourier transform to obtain a frequency spectrum representation; Analyze whether there is a characteristic frequency in the spectrum representation; if there is a characteristic frequency, calculate the signal-to-noise ratio at the characteristic frequency. When the signal-to-noise ratio is greater than a preset threshold, determine that the sliding component of the slide rail has a periodic disturbance anomaly; analyze whether there are multiple harmonics in the spectrum representation; if there are multiple harmonics, determine that the sliding component of the slide rail has a wear anomaly.
2. The slide rail assembly quality inspection method based on machine vision according to claim 1 is characterized in that: The step of analyzing and obtaining the inner rail sliding speed sequence of the slide rail according to the plurality of slide rail stretching images includes: Grayscale processing is performed on the slide rail stretching image; a difference image sequence is generated by pixel-by-pixel subtraction of two adjacent frames of slide rail stretching images, and the difference image sequence includes a plurality of difference images; The SIFT algorithm is used to extract the feature points of the difference image, and feature point matching is performed in the difference image based on the feature points. According to the matching results of the feature points, the actual displacement of the inner rail of the slide rail along the direction of the slide rail between each frame is calculated; Based on the preset frequency, according to the actual displacements corresponding to different frames, the inner rail sliding speed at the corresponding moment is calculated, and the inner rail sliding speeds at different moments are integrated to obtain the inner rail sliding speed sequence.
3. The method for detecting the slide rail assembly quality based on machine vision according to claim 1, characterized in that: The slide rail shrinkage image is input into the pre-trained slide rail surface defect prediction algorithm, and the slide rail surface defect type is output, including: Grayscale processing is performed on the slide rail contraction image to obtain a grayscale image of the slide rail surface; Based on the grayscale difference characteristics between each pixel point in the grayscale image of each slide rail surface and the image as a whole, the key points for slide rail surface defect analysis are calculated; Clustering algorithm is used to cluster the key points of slide rail surface defect analysis to obtain the slide rail surface defect analysis area; Based on the texture features, grayscale difference features and distribution features of each defect analysis key point of the slide rail surface defect analysis area, a defect morphology feature vector of each slide rail defect analysis area is constructed; The processed rail surface defect feature vector is input into the rail surface defect prediction algorithm pre-trained based on the SVM algorithm to output the rail surface defect type.
4. The slide rail assembly quality inspection method based on machine vision according to claim 1, characterized in that: The types of surface defects of the slide rails include normal, scratches, position displacement, corrosion and coating peeling.
5. A slide rail assembly quality inspection system based on machine vision, characterized in that: The system comprises: The surface defect prediction module is used to obtain the slide rail shrinkage images at multiple angles in the slide rail shrinkage state; input the slide rail shrinkage images into the pre-trained slide rail surface defect prediction algorithm, and output the slide rail surface defect type; The slide rail stretching image acquisition module is used to fix the outer rail of the slide rail, pull out the inner rail of the slide rail with a preset stretching force, and acquire the slide rail stretching image during the stretching process of the inner rail of the slide rail at a preset frequency when the surface defect type of the slide rail is normal; A Fourier transform processing module is used to analyze and obtain the inner rail sliding speed sequence of the slide rail according to the multiple slide rail stretching images, and perform Fourier transform on the inner rail sliding speed sequence to obtain a frequency spectrum representation; The sliding component defect analysis module is used to analyze whether there is a characteristic frequency in the spectrum representation; if there is a characteristic frequency, calculate the signal-to-noise ratio at the characteristic frequency. When the signal-to-noise ratio is greater than a preset threshold, it is determined that the sliding component of the slide rail has a periodic disturbance anomaly; analyze whether there are multiple harmonics in the spectrum representation; if there are multiple harmonics, it is determined that the sliding component of the slide rail has a wear anomaly.
6. The machine vision-based slide rail assembly quality inspection system according to claim 5, characterized in that: The Fourier transform processing module is also used for: Grayscale processing is performed on the slide rail stretching image; a difference image sequence is generated by pixel-by-pixel subtraction of two adjacent frames of slide rail stretching images, and the difference image sequence includes a plurality of difference images; The SIFT algorithm is used to extract the feature points of the difference image, and feature point matching is performed in the difference image based on the feature points. According to the matching results of the feature points, the actual displacement of the inner rail of the slide rail along the direction of the slide rail between each frame is calculated; Based on the preset frequency, according to the actual displacements corresponding to different frames, the inner rail sliding speed at the corresponding moment is calculated, and the inner rail sliding speeds at different moments are integrated to obtain the inner rail sliding speed sequence.
7. The machine vision-based slide rail assembly quality inspection system according to claim 5, characterized in that: The surface defect prediction module is also used for: Grayscale processing is performed on the slide rail contraction image to obtain a grayscale image of the slide rail surface; Based on the grayscale difference characteristics between each pixel point in the grayscale image of each slide rail surface and the image as a whole, the key points for slide rail surface defect analysis are calculated; Clustering algorithm is used to cluster the key points of slide rail surface defect analysis to obtain the slide rail surface defect analysis area; Based on the texture features, grayscale difference features and distribution features of each defect analysis key point of the slide rail surface defect analysis area, a defect morphology feature vector of each slide rail defect analysis area is constructed; The processed rail surface defect feature vector is input into the rail surface defect prediction algorithm pre-trained based on the SVM algorithm to output the rail surface defect type.
8. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions. When the processor executes the computer instructions, the electronic device executes the slide rail assembly quality detection method based on machine vision as described in any one of claims 1 to 4.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the slide rail assembly quality detection method based on machine vision as described in any one of claims 1 to 4.