Vision-assisted air cylinder assembly quality inspection method and system
By analyzing the edge contour characteristics of the cylinder assembly surface image, combining wavelet transformation and neural network model, the wavelet threshold is dynamically adjusted, which solves the problem of low detection accuracy caused by noise interference in traditional methods, and achieves more efficient defect recognition.
Patent Information
- Application Number
- CN202510980745.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-16
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-07-16
AI Technical Summary
In the detection of hammer cylinder assembly, traditional wavelet denoising algorithms have low accuracy in defect detection and are difficult to effectively identify subtle defects.
By analyzing the image edge profile characteristics of each component area on the cylinder assembly surface, building feature vectors, combining wavelet transformation and neural network model, dynamically adjusting the wavelet threshold, image denoising and identifying defects.
It improves the accuracy of cylinder components quality inspection, effectively reduces noise interference, retains defect characteristics and details, and improves the detection effect.
Smart Images

Figure CN120471931A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a visually assisted cylinder component quality inspection method and system. Background Art
[0002] The cylinder assembly of an electric hammer is a key component for achieving the impact function. Quality defects in its surface and internal structure directly affect the hammer's impact force, operating efficiency, and service life. With the increasing demand for industrial automation, machine vision-based quality inspection technology, due to its non-contact and high efficiency, has become an important alternative to traditional manual inspection.
[0003] The traditional wavelet denoising algorithm is used to denoise the image. Due to the complex surface texture of the cylinder assembly of the electric hammer and the interference of uneven lighting, mechanical vibration noise, metal reflection, etc., different defect types on the surface of the cylinder assembly are affected differently by noise interference, resulting in different defects showing significantly different multi-scale and multi-directional characteristics in the image. If the threshold is set unreasonably, it is easy to cause minor defects to be over-smoothed or incompletely denoised, affecting the quality of the denoised image, resulting in low accuracy of defect detection of the cylinder assembly and affecting the quality inspection effect of the cylinder assembly. Summary of the Invention
[0004] In order to solve the above technical problems, a visually assisted cylinder assembly quality inspection method and system are provided to solve the existing problems.
[0005] The solution to the technical problem of this application is to provide a visually assisted cylinder assembly quality inspection method and system, including the following steps: In a first aspect, an embodiment of the present application provides a visually assisted cylinder assembly quality inspection method, the method comprising the following steps: Collect all frame images of each component area on the surface of the cylinder assembly and extract the edge contour of each frame image; Based on the shape and size characteristics of different edge contours in each frame of image, a feature vector of each frame of image is constructed; the difference in feature vectors between each frame of image and the remaining frame images in the component area to which it belongs is analyzed, and the structural difference degree of each frame of image is calculated. Based on the distribution of the structural difference degree, the number of decomposition layers corresponding to each frame of image is determined, and a wavelet transform algorithm is used to perform wavelet decomposition on each frame of image to obtain the wavelet coefficients and subband energy in each direction at each scale; For each frame of the image, the difference in subband energy in each direction at each scale and in other directions is analyzed to form an energy difference vector. The first interference degree in each direction at each scale is determined by the difference in wavelet coefficients in the same direction between each scale and other scales and the correlation between the energy difference vectors. The second interference degree in each direction at each scale is determined by combining the proportion of sub-band energy in each direction at each scale with the first interference degree, and the threshold of the wavelet coefficient is corrected to obtain the corrected wavelet threshold corresponding to each direction at each scale; Based on the modified wavelet threshold, the wavelet coefficients are threshold processed and then the denoised image is obtained by inverse wavelet transform. The defects in the denoised image are identified by combining with the neural network model, and the surface of the cylinder component is quality inspected.
[0006] Preferably, the process of obtaining the feature vector is: Hough transform is used to detect circular edges, and all edge contours in each frame image are divided into circular edges and non-circular edges; Perform a linear fit on the centroids of all circular edges in each frame of image, and record the fitted straight line as the baseline; calculate the distance from the centroid of each circular edge in each frame of image to the baseline, record the ratio of the distance to the preset tolerance zone distance as the concentricity, and obtain the diameter of each circular edge; Perform curve fitting on the position coordinates of all edge pixel points on the non-circular edge, calculate the mean value of the curvature of all edge pixel points on the fitting curve as the average curvature, and obtain the maximum width of each non-circular edge; The diameter and concentricity of all circular edges in each frame image, as well as the average curvature and maximum width of all non-circular edges, are combined into a feature vector.
[0007] Preferably, the structural difference is the average value of the distance between the feature vectors of each frame image and all other frame images in the component region to which it belongs.
[0008] Preferably, determining the number of decomposition layers corresponding to each frame of image includes: Normalizing the structural differences of all frame images, dividing the value range of the normalization result into a plurality of preset intervals, each interval corresponding to a preset number of decomposition layers; According to the interval to which the normalized structural difference of each frame image belongs, the preset decomposition layer number corresponding to the interval is used as the decomposition layer number corresponding to each frame image.
[0009] Preferably, the process of obtaining the energy difference vector is: for each frame image, calculating the difference in sub-band energy between each direction at each scale and the remaining directions, recorded as energy difference; and forming the energy difference vector from the energy difference between each direction at each scale and all the remaining directions.
[0010] Preferably, determining the first interference degree in each direction at each scale includes: Calculate the distance between the wavelet coefficients in the same direction between any two scales, which is recorded as the distribution difference; Calculating the correlation degree of the energy difference vectors in the same direction between the arbitrary two scales, and performing positive mapping on the absolute value of the correlation degree; The ratio between the distribution difference and the result of the positive mapping is recorded as the relative ratio; The first interference degree is a result of fusing the relative ratios in the same direction between each scale and all other scales.
[0011] Preferably, the specific process of the fusion is: taking the average of the relative ratios between each direction at each scale and the corresponding same direction at all other scales as the first interference degree of each direction at each scale.
[0012] Preferably, determining the second interference degree in each direction at each scale includes: Calculate the proportion of sub-band energy in each direction to sub-band energy in all directions at each scale; The second interference degree is a ratio of the first interference degree to the proportion.
[0013] Preferably, obtaining the corrected wavelet threshold corresponding to each direction at each scale includes: For each frame of image, the second interference degree in all directions at each scale is normalized, and the normalized result is used as the adjustment coefficient for each direction at each scale; The modified wavelet threshold is the product of the adjustment coefficient and the preset initial threshold.
[0014] In the second aspect, an embodiment of the present application also provides a visually assisted cylinder assembly quality inspection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the visually assisted cylinder assembly quality inspection methods described above are implemented.
[0015] This application has at least the following beneficial effects: This application calculates the structural difference of each frame image by analyzing the differences in shape and size of edge contours between different frame images in each component area. The beneficial effect is that it takes into account the differences in the structure of edge contours in images in the same component area to reflect the influence of defects on the structural characteristics of edge contours in images at different angles; secondly, it determines the number of decomposition layers corresponding to each frame image to obtain the wavelet coefficients and sub-band energy in each direction at each scale. The beneficial effect is that it takes into account the degree of influence of defects on each frame image, and the intensity of wavelet decomposition of different frame images is different, thereby avoiding image blurring caused by excessive decomposition of the image, so as to highlight the detailed feature information of the defects in the image; determines the first interference degree in each direction at each scale, the beneficial effect of which is that it takes into account the differences in wavelet coefficients in the same direction at different scales, as well as the differences in the distribution of self-carrying energy, reflecting the influence of noise interference on each direction of each frame image at each scale; determines The second interference degree in each direction at each scale has the beneficial effect of taking into account the energy proportion in each direction at each scale to reflect the significance of the defect characteristics in that direction, and then combining the influence of noise interference in that direction to evaluate the defect characteristics contained in that direction and the influence of noise interference, so as to subsequently correct the wavelet threshold; obtain the corresponding corrected wavelet threshold for each direction at each scale; after threshold processing of the wavelet coefficients, use the inverse wavelet transform to obtain the denoised image, combine the neural network model to identify the defects in the denoised image, and perform quality inspection on the surface of the cylinder component. The beneficial effect is that by combining the defect characteristics contained in different directions and the influence of noise interference, the wavelet threshold is corrected, while retaining the detailed information of the defect characteristics, the interference of noise is effectively reduced, the denoising effect of the image is improved, the defects in the image are more accurately identified, and the accuracy of the quality inspection of the cylinder component is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The following is a detailed description of a visually assisted cylinder assembly quality inspection method of the present application in conjunction with the accompanying drawings.
[0017] Figure 1 A flowchart of a visually assisted cylinder assembly quality inspection method provided in an embodiment of the present application; Figure 2 A flowchart of the steps of the method for obtaining a denoised image provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] To make the objectives, technical solutions, and advantages of this application more clearly understood, the following, in conjunction with the accompanying drawings and implementation examples, further describes in detail a visually assisted cylinder assembly quality inspection method and system proposed in this application. It should be understood that the specific embodiments described herein are merely for the purpose of explaining this application and are not intended to limit this application.
[0019] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0020] See also Figure 1 , which shows a flowchart of a visually assisted cylinder assembly quality inspection method provided by one embodiment of the present application, the method comprising the following steps: Step 1: Collect all frame images of each component area on the surface of the cylinder assembly.
[0021] When conducting quality inspection on the cylinder assembly of the electric hammer, a multi-angle adjustable annular shadowless light source and a coaxial light source, as well as a high-precision rotary table and linear guides are deployed. The cylinder assembly is placed on the workbench. The linear guide can drive the cylinder assembly to move horizontally or vertically, allowing the cylinder assembly to move and rotate at multiple angles and in all directions in three-dimensional space. The telecentric lens in the high-resolution linear array industrial camera continuously scans the surface of the cylinder assembly globally. A certain component area of the cylinder assembly will appear at different angles, so all frame images of each component area on the surface of the cylinder assembly are collected; In this embodiment, the acquisition frequency of the linear array industrial camera is 200 Hz. As other implementation methods, the implementer can set it according to actual conditions.
[0022] It should be noted that the annular shadowless light source is used to eliminate shadows on the surface of the cylinder assembly, and the coaxial light source is aimed at the highly reflective area on the surface of the cylinder assembly. The vertical incident light reduces the specular reflection and enhances the contrast between defects and normal areas.
[0023] At this point, all frame images of various component areas on the surface of the cylinder assembly are obtained.
[0024] Step 2: Construct a feature vector for each frame of image based on the shape and size features of different edge contours in each frame of image; analyze the difference in feature vectors between each frame of image and the remaining frame images in the component area to which it belongs, calculate the structural difference of each frame of image, determine the number of decomposition layers corresponding to each frame of image based on the distribution of the structural difference, and use the wavelet transform algorithm to perform wavelet decomposition on each frame of image to obtain the wavelet coefficients and subband energy in each direction at each scale.
[0025] The type and location of surface defects in cylinder components are random. Edge defects not only affect the structural dimensions of the cylinder component but also interfere with defect detection. Therefore, by analyzing the differences in the structural dimensions of the corresponding edge contours of the components in different frame images under each component area, the structural difference degree is calculated. Specifically, Extract the edge contour of each frame image, use Hough transform to detect circular edges, and divide all edge contours into circular edges and non-circular edges; In this embodiment, the Canny edge detection algorithm is used to extract edge contours. As other implementation methods, the implementer may adopt other methods of the existing technology, such as the Sobel operator, etc. This embodiment does not impose any special restrictions on this. Among them, the Canny edge detection algorithm and the Hough transform are both well-known technologies and will not be described in detail here.
[0026] Perform linear fitting on the centroids of all circle edges in each frame of image, and record the fitted straight line as the baseline; In this embodiment, the least square method is used for linear fitting, wherein the least square method and the calculation of curvature are well-known technologies and will not be described in detail here.
[0027] Calculate the distance from the center of mass of each circle edge in each frame image to the reference line, record the ratio of the distance to the preset tolerance zone distance as concentricity, and obtain the diameter of each circle edge; In this embodiment, the distance is calculated by calculating the Euclidean distance from the center of mass of each circle edge in each frame image to the baseline, wherein the calculation of the Euclidean distance is a well-known technology. Secondly, since the accuracy of the processing equipment and the stability of the manufacturing process will affect the setting of the tolerance band distance, a high-precision machining center and a stable manufacturing process can achieve a smaller tolerance band distance. Therefore, for the cylinder assembly of the electric hammer, its tolerance band distance is controlled within 0.01mm. Therefore, the preset tolerance band distance is 0.01mm. As other implementation methods, the implementer can set it according to actual conditions.
[0028] Perform curve fitting on the position coordinates of all edge pixel points on the non-circular edge, calculate the mean value of the curvature of all edge pixel points on the fitting curve as the average curvature, and obtain the maximum width of each non-circular edge; In this embodiment, the least squares method is used for curve fitting, wherein the least squares method and the calculation of curvature are well-known technologies and are not described in detail here; secondly, the maximum width is measured by calculating the maximum value of the Euclidean distance between any two edge pixel points in each non-circular edge.
[0029] The diameter and concentricity of all circular edges in each frame of the image, as well as the average curvature and maximum width of all non-circular edges, are combined into a feature vector; Calculating the mean of the distances between the feature vectors of each frame image and all other frame images in the component region to which it belongs as the structural difference of each frame image; In this embodiment, the distance is measured by calculating the DTW distance of the feature vector between each frame image and all other frame images in the component area to which it belongs. The calculation of the DTW distance is a well-known technology and will not be described in detail here. As other implementation methods, the implementer may adopt other methods of the existing technology, such as Manhattan distance, etc., and this embodiment does not impose any special restrictions on this.
[0030] It should be noted that, the greater the structural difference, the greater the difference between the frame image and images at other angles, reflecting that the change in edge size and feature difference within the frame image caused by the defect are more significant.
[0031] Secondly, the wavelet decomposition algorithm is a multi-resolution analysis method that decomposes an image into sub-bands of different scales and directions. Its core idea is to decompose the image signal into local features of different frequencies and directions through wavelet transform, thereby extracting key information from the image. By decomposing the image into sub-bands of different scales, each sub-band corresponds to a different frequency range. Defects usually appear as anomalies in high-frequency information. By analyzing sub-bands of different scales, the details of the defect can be captured more accurately. If the structure of each frame of the image is more significantly affected by the defect, that is, the greater the structural difference, then when decomposing the image using the wavelet decomposition algorithm, a smaller number of decomposition layers should be set to avoid excessive decomposition of the image, which will cause image blurring and increase feature analysis errors. Conversely, a larger number of decomposition layers should be set to highlight the detailed feature information of the defect in the image.
[0032] Based on the above analysis and the structural difference, the number of decomposition layers corresponding to each frame of image is determined, specifically: Normalizing the structural differences of all frame images; dividing the value range of the normalization result into a plurality of preset intervals, each interval corresponding to a preset number of decomposition layers; According to the interval to which the normalized structural difference of each frame image belongs, the preset number of decomposition layers corresponding to the interval is used as the number of decomposition layers corresponding to each frame image; In this embodiment, the maximum and minimum method is used for normalization processing, wherein the maximum and minimum method is a well-known technology and will not be described in detail here. As other implementation methods, the implementer may adopt other methods of the prior art, such as the Z-score normalization method, etc., which is not particularly limited in this embodiment; secondly, after the normalization processing, the value range of the normalized result is ,Will Divided into three preset intervals: , then the interval The corresponding preset decomposition level is 6, the interval The corresponding preset decomposition level is 5, the interval The corresponding preset decomposition level is 4. The structural difference of the normalized frame image is 0.5, then The number of decomposition layers corresponding to the frame image is the interval The corresponding preset decomposition level is The number of decomposition layers corresponding to the frame image is 5. As other implementation methods, the implementer can set it according to actual conditions.
[0033] Furthermore, based on the number of decomposition layers, wavelet decomposition is performed on each frame of the image, specifically: Based on the number of decomposition layers corresponding to each frame of image, wavelet transform algorithm is used to perform wavelet decomposition on each frame of image to obtain wavelet coefficients and subband energy in multiple directions at each scale; It should be noted that the wavelet transform algorithm is a well-known technology and will not be described in detail here. By performing wavelet decomposition on the image, the number of scales corresponding to each frame of the image is the number of decomposition layers, and each scale corresponds to 12 directions. As other implementation methods, the implementer can set them according to actual conditions.
[0034] It should be noted that the wavelet coefficient is a matrix, the sub-band energy is the sum of the squares of the wavelet coefficients, and the calculation of the sub-band energy is a well-known technology and will not be repeated here; the larger the sub-band energy, the more high-frequency energy information contained in the sub-band, and the more significant the defect feature information in this direction at the corresponding scale.
[0035] At this point, the wavelet coefficients and subband energies in each direction at each scale corresponding to each frame of image are obtained.
[0036] Step 3: For each frame of the image, analyze the difference in subband energy in each direction at each scale and the rest of the different directions to form an energy difference vector; determine the first interference degree in each direction at each scale through the difference in wavelet coefficients in the same direction between each scale and the rest of the scales and the correlation between the energy difference vectors.
[0037] Furthermore, the threshold of wavelet decomposition is a key parameter in the wavelet denoising process, which is used to determine which wavelet coefficients should be retained or set to zero, thereby removing noise and retaining signal characteristics. If the wavelet threshold is too small, noise will still exist in the image after denoising. Conversely, if the wavelet threshold is too large, important image information features will be filtered out, affecting the accuracy of cylinder component quality detection.
[0038] During the inspection process of the cylinder assembly, the defects on the surface of the cylinder assembly have similar amplitude distributions in the same direction at different scales. If there is noise interference, the amplitude distributions in the same direction between different scales may be quite different. If the amplitude distributions in the same direction between different scales are similar, it means that the noise interference is small. In this case, a smaller wavelet threshold should be set to retain more detailed features and thus better identify defects. On the contrary, if the amplitude distributions in the same direction between different scales are quite different, it means that the noise interference is large. In this case, a larger wavelet threshold should be set to effectively suppress the noise.
[0039] Based on the above analysis, the first interference degree is calculated by analyzing the difference in the distribution of small amplitudes in the same direction between different scales and the energy difference corresponding to the wavelet coefficients in the same direction. Specifically, For each frame of image, the distance between the wavelet coefficients in the same direction between any two scales is calculated and recorded as the distribution difference; In this embodiment, the distance is measured by calculating the DTW distance of wavelet coefficients in the same direction between any two scales. The DTW distance is a well-known technology and will not be described in detail here.
[0040] It should be noted that the greater the distribution difference, the greater the difference in amplitude distribution caused by noise interference in the same direction at different scales, which reflects that the consistency of the amplitude distribution of the same-direction decomposition between different scales is poor.
[0041] Calculate the difference in sub-band energy between each direction and the rest of the directions at each scale, and record it as energy difference; In this embodiment, the difference in sub-band energy between each direction and the remaining directions at each scale is calculated and recorded as energy difference.
[0042] The energy difference between each direction and all other directions at each scale is formed into an energy difference vector; Calculating the correlation degree of the energy difference vectors in the same direction between the arbitrary two scales, and performing positive mapping on the absolute value of the correlation degree; In this embodiment, the degree of correlation is calculated by calculating the cosine similarity of the energy difference vectors in the same direction between any two scales, wherein the calculation of the cosine similarity is a well-known technology and will not be described in detail here. As other implementation methods, the implementer may adopt other methods of the prior art, such as the Pearson correlation coefficient, etc. This embodiment does not impose any special restrictions on this. Secondly, the specific process of the positive mapping is: positive mapping is performed through an exponential function, assuming that the absolute value of the correlation degree is recorded as ,Will The result is the result of the positive mapping, where is an exponential function with a natural constant as its base.
[0043] The ratio between the distribution difference and the result of the positive mapping is recorded as the relative ratio; the average of the relative ratios between each direction at each scale and the corresponding direction at all other scales is used as the first interference degree of each direction at each scale; It should be noted that the smaller the result of the positive mapping, the more significant the difference in energy in the same direction at different scales due to the influence of noise interference, reflecting that the high-frequency energy corresponding to the defect characteristics has poor consistency between different scales; the larger the first interference degree, the greater the difference in the amplitude distribution and energy of the same-direction decomposition between the corresponding scale and the other scales, reflecting that the degree of influence by noise interference may be greater, and a larger wavelet threshold should be set to effectively suppress noise interference.
[0044] At this point, the first interference degree in each direction at each scale is obtained.
[0045] Step 4: Determine the second interference degree in each direction at each scale by combining the proportion of sub-band energy in each direction at each scale with the first interference degree, correct the threshold of the wavelet coefficient, and obtain the corrected wavelet threshold corresponding to each direction at each scale; based on the corrected wavelet threshold, perform threshold processing on the wavelet coefficient, and use the inverse wavelet transform to obtain the denoised image. Combined with the neural network model, identify defects in the denoised image and perform quality inspection on the surface of the cylinder component.
[0046] Furthermore, in the quality inspection process of cylinder components, the greater the sub-band energy in different directions at each scale, the more significant the defect feature information is, and the smaller the wavelet threshold should be set to retain more detailed information. Therefore, by analyzing the proportion of sub-band energy in each direction at each scale and combining it with the first interference degree, the second interference degree is determined, specifically: Calculate the proportion of sub-band energy in each direction to sub-band energy in all directions at each scale; The ratio of the first interference degree to the proportion is used as the second interference degree in each direction at each scale; It should be noted that the larger the proportion, the more concentrated the energy in this direction and the more significant the defect feature information contained. The larger the second interference degree, the fewer defect features contained in this direction and the greater the impact of noise interference. A relatively large wavelet threshold needs to be set to reduce the impact of noise interference.
[0047] Secondly, based on the second interference degree, the wavelet threshold of the wavelet decomposition is modified, specifically: For each frame of image, the second interference degree in all directions at each scale is normalized, and the normalized result is used as the adjustment coefficient for each direction at each scale; In this embodiment, the sigmoid function is used for normalization processing, wherein the sigmoid function is a well-known technology and will not be described in detail here. As other implementation methods, the implementer can adopt other methods of the existing technology, such as the softmax function, etc. This embodiment does not impose any special restrictions on this.
[0048] The product of the adjustment coefficient and the preset initial threshold is used as the corrected wavelet threshold corresponding to each direction at each scale; In this embodiment, the preset initial threshold is set as a general threshold, wherein the general threshold The calculation process ,in, is the length of the wavelet coefficients, is the standard deviation of the noise, is a logarithmic function with a natural constant as the base; wherein, the calculation process of the universal threshold is a well-known technology and will not be repeated here.
[0049] Based on the modified wavelet threshold, the wavelet coefficients are threshold processed and then the denoised image is obtained by inverse wavelet transform. It should be noted that the inverse wavelet transform is a well-known technology and will not be described in detail here.
[0050] The flowchart of the method for obtaining the denoised image provided in the embodiment of the present application is as follows: Figure 2 shown.
[0051] Collect a large number of cylinder component images containing different types of defects, annotate the images, and form a training set; In this embodiment, the LabelImg annotation tool is used to annotate the image. LabelImg is a well-known technology and will not be described in detail here. The defect types include: piston deformation, sealing groove damage, scratch and wear defects, etc.
[0052] Training the neural network model based on the training set; In this embodiment, the Faster RCNN model is used for training, wherein the Faster RCNN model is a well-known technology and will not be described in detail here. As other implementation methods, implementers can adopt other methods of the existing technology, such as recurrent neural networks, etc. This embodiment does not impose any special restrictions on this.
[0053] The denoised image is input into the trained neural network model, which outputs the corresponding defect type and identifies the defects on the surface of the cylinder component. The results of identifying defects contained in the denoised images are used to evaluate cylinder components with different defects, specifically: Cylinder assemblies with piston deformation or damaged sealing grooves are judged as unqualified products. Cylinder assemblies with scratches and wear defects are subsequently repaired to become qualified products.
[0054] Based on the same inventive concept as the above method, an embodiment of the present application also provides a visually assisted cylinder assembly quality inspection system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of any one of the above-mentioned visually assisted cylinder assembly quality inspection methods are implemented.
[0055] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0056] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0057] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the present application. It should be noted that a person skilled in the art can make various modifications and improvements without departing from the spirit of the present application. Therefore, any simple modifications, equivalent variations, and modifications to the above embodiments made in accordance with the technical essence of the present application without departing from the content of the present application's technical solution fall within the scope of protection of the present application's technical solution.
Claims
1. A visually assisted cylinder assembly quality inspection method, characterized in that: The method comprises the following steps: Collect all frame images of each component area on the surface of the cylinder assembly and extract the edge contour of each frame image; Based on the shape and size characteristics of different edge contours in each frame of image, a feature vector of each frame of image is constructed; the difference in feature vectors between each frame of image and the remaining frame images in the component area to which it belongs is analyzed, and the structural difference degree of each frame of image is calculated. Based on the distribution of the structural difference degree, the number of decomposition layers corresponding to each frame of image is determined, and a wavelet transform algorithm is used to perform wavelet decomposition on each frame of image to obtain the wavelet coefficients and subband energy in each direction at each scale; For each frame of the image, the difference in subband energy in each direction at each scale and in other directions is analyzed to form an energy difference vector. The first interference degree in each direction at each scale is determined by the difference in wavelet coefficients in the same direction between each scale and other scales and the correlation between the energy difference vectors. The second interference degree in each direction at each scale is determined by combining the proportion of sub-band energy in each direction at each scale with the first interference degree, and the threshold of the wavelet coefficient is corrected to obtain the corrected wavelet threshold corresponding to each direction at each scale; Based on the modified wavelet threshold, the wavelet coefficients are threshold processed and then the denoised image is obtained by inverse wavelet transform. The defects in the denoised image are identified by combining with the neural network model, and the surface of the cylinder component is quality inspected.
2. A visually assisted cylinder assembly quality inspection method according to claim 1, characterized in that: The process of obtaining the feature vector is as follows: Hough transform is used to detect circular edges, and all edge contours in each frame image are divided into circular edges and non-circular edges; Perform linear fitting on the centroids of all circle edges in each frame of image, and record the fitted straight line as the baseline; Calculate the distance from the center of mass of each circle edge in each frame image to the reference line, record the ratio of the distance to the preset tolerance zone distance as concentricity, and obtain the diameter of each circle edge; Perform curve fitting on the position coordinates of all edge pixel points on the non-circular edge, calculate the mean value of the curvature of all edge pixel points on the fitting curve as the average curvature, and obtain the maximum width of each non-circular edge; The diameter and concentricity of all circular edges in each frame image, as well as the average curvature and maximum width of all non-circular edges, are combined into a feature vector.
3. The visually assisted cylinder assembly quality inspection method according to claim 1, characterized in that: The structural difference is the average value of the distances between the feature vectors of each frame image and all other frame images in the component area to which it belongs.
4. The visually assisted cylinder assembly quality inspection method according to claim 1, characterized in that: Determining the number of decomposition layers corresponding to each frame of image includes: Normalizing the structural differences of all frame images, dividing the value range of the normalization result into a plurality of preset intervals, each interval corresponding to a preset number of decomposition layers; According to the interval to which the normalized structural difference of each frame image belongs, the preset decomposition layer number corresponding to the interval is used as the decomposition layer number corresponding to each frame image.
5. The visually assisted cylinder assembly quality inspection method according to claim 1, characterized in that: The energy difference vector is obtained by calculating the difference in sub-band energy between each direction and the remaining directions at each scale for each frame of the image, which is recorded as the energy difference. The energy difference between each direction and all other directions at each scale is formed into an energy difference vector.
6. The visually assisted cylinder assembly quality inspection method according to claim 1, characterized in that: Determining the first interference degree in each direction at each scale includes: Calculate the distance between the wavelet coefficients in the same direction between any two scales, which is recorded as the distribution difference; Calculating the correlation degree of the energy difference vectors in the same direction between the arbitrary two scales, and performing positive mapping on the absolute value of the correlation degree; The ratio between the distribution difference and the result of the positive mapping is recorded as the relative ratio; The first interference degree is a result of fusing the relative ratios in the same direction between each scale and all other scales.
7. The visually assisted cylinder assembly quality inspection method according to claim 6, characterized in that: The specific process of the fusion is: taking the average of the relative ratios between each direction at each scale and the corresponding same direction at all other scales as the first interference degree of each direction at each scale.
8. The visually assisted cylinder assembly quality inspection method according to claim 1, characterized in that: Determining the second interference degree in each direction at each scale includes: Calculate the proportion of sub-band energy in each direction to sub-band energy in all directions at each scale; The second interference degree is a ratio of the first interference degree to the proportion.
9. The visually assisted cylinder assembly quality inspection method according to claim 1, characterized in that: Obtaining the corrected wavelet threshold corresponding to each direction at each scale includes: For each frame of image, the second interference degree in all directions at each scale is normalized, and the normalized result is used as the adjustment coefficient for each direction at each scale; The modified wavelet threshold is the product of the adjustment coefficient and the preset initial threshold.
10. A visually assisted cylinder assembly quality inspection system comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the visually assisted cylinder assembly quality inspection method as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Image division method based on watershed-quantum evolution clustering algorithm
CN101625755A
Methods and arrangements for identifying objects
US20170249491A1
Cited By
Tiny precision bearing fatigue damage detection system and detection method
CN121453915A