Method and system for detecting appearance defects of automobile parts

Through the combination of positioning point image correction and semantic segmentation model, the appearance defects of automobile parts are automatically detected, solving the problem of low manual sampling efficiency and achieving efficient and accurate defect detection.

CN120374600APending Publication Date: 2025-07-25NANCHANG HONGDU AUTOMOTIVE FITTING MFG
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202510837784.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, the detection of the appearance defects of automobile parts relies on manual random inspection, which has a large workload and is prone to missed inspection, and has low detection efficiency.

Method used

An automated detection method based on positioning point image correction, semantic segmentation model and multi-scale feature analysis is used to determine whether the component has defects by obtaining the comparison and correlation number of the to-processed image and the reference image.

Benefits of technology

It realizes automatic identification of component appearance defects, improves detection efficiency and accuracy, reduces workload and reduces missed detection rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374600A_ABST
    Figure CN120374600A_ABST
Patent Text Reader

Abstract

The invention provides an automobile part appearance defect detection method and system, and the method comprises the following steps: obtaining an original image of a part, and carrying out the image correction of the original image based on a positioning point, so as to obtain a to-be-processed image; comparing the to-be-processed image with the plurality of reference images to select a target image; preprocessing the to-be-processed image, and obtaining a to-be-used feature image through the semantic segmentation model; and obtaining a standby multi-scale feature and a standby width histogram of the standby feature image, obtaining a target multi-scale feature and a target width histogram of the target image, further determining a correlation coefficient between the standby image and the target image, and judging whether the part has defects or not through the correlation coefficient. Manual sampling inspection is replaced by an automatic identification mode, so that the component appearance defect detection workload is reduced, and the component appearance defect detection efficiency and precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle parts manufacturing, and particularly relates to a method and system for detecting the appearance defects of automotive parts. Background Art

[0002] After more than a decade of rapid development in the automotive market, the national motor vehicle ownership has been increasing continuously. As one of the means of transportation, automobiles have been popularized in human society. Automotive parts are consumable materials that make up the various units of an automobile as a whole.

[0003] In the production process of automotive parts, due to improper setting of process parameters, aging and damage of production equipment, etc., it is easy to cause appearance defects such as dimensional deviation, deformation, and edge deficiency in the finished automotive parts.

[0004] Currently, for the detection of the appearance defects of automotive parts, it is still achieved through manual sampling inspection, that is, randomly selecting some from a batch of automotive parts for inspection. This detection method not only has a large workload, but also has problems such as missed inspection and low detection efficiency. Summary of the Invention

[0005] Aiming at the deficiencies of the prior art, the purpose of the present invention is to provide a method and system for detecting the appearance defects of automotive parts, aiming to solve the technical problems in the prior art that the manual sampling inspection of the appearance defects of automotive parts has a large workload, is prone to missed inspection, and has a low detection efficiency.

[0006] To achieve the above purpose, in the first aspect, an embodiment of the present application provides a method for detecting the appearance defects of automotive parts, including the following steps: Obtain the original image of the parts placed on the conveyor belt. Three positioning points are set on the conveyor belt, and the original image is corrected based on the positioning points to obtain the image to be processed; Compare the image to be processed with a number of reference images to select a target image from the number of reference images; Preprocess the image to be processed to obtain an image for use, construct a semantic segmentation model, and obtain a feature image for use based on the semantic segmentation model and the image for use; Obtain the multi-scale features for use and the width histogram for use of the feature image for use, and obtain the multi-scale features for the target and the width histogram for the target of the target image. Based on the multi-scale features for use, the width histogram for use, the multi-scale features for the target, and the width histogram for the target, obtain the correlation coefficient between the image for use and the target image, and determine whether the parts have defects through the correlation coefficient.

[0007] Further, the step of performing image correction on the original image based on the positioning points to obtain the image to be processed includes: Obtain the target coordinates and shooting coordinates of the three positioning points, and obtain a degree-of-freedom parameter set through the target coordinates and the shooting coordinates; Construct an affine matrix based on the degree-of-freedom parameter set, and perform image correction on the original image through the affine matrix.

[0008] Furthermore, the step of comparing the image to be processed with a plurality of reference images to select a target image from the plurality of reference images includes: Perform binarization processing and edge detection on the image to be processed to obtain a contour to be processed; Obtain the aspect ratio of the contour to be processed, and select a plurality of images to be screened from the plurality of reference images based on the aspect ratio; Perform binarization processing and edge detection on the images to be screened to obtain contours to be screened, and compare the similarity between the contour to be processed and the contours to be screened, and select the image to be screened corresponding to the contour to be screened with the highest similarity as the target image.

[0009] Furthermore, the preprocessing includes light enhancement processing, and the formula for the light enhancement processing is: , where represents the image to be processed after light enhancement processing, represents the image to be processed, represents the brightness coefficient, represents the pixel value truncation function.

[0010] Furthermore, the semantic segmentation model includes a downsampling module, a spatial attention module, and a compression module. The step of obtaining a feature image to be used based on the semantic segmentation model and the image to be used includes: Use the image to be used as the input value of the downsampling module to obtain a fused feature image; Use the fused feature image as the input value of the spatial attention module to obtain an anti-interference image; Use the anti-interference image as the input value of the compression module to obtain a feature image to be used.

[0011] Furthermore, the formula for obtaining the fused feature image is: , where represents the fused feature image, represents the image to be used, represents a 3X3 convolution operation, represents a dilated convolution operation with a 3X3 convolution kernel and a dilation rate of 2. represents the normalization operation, represents the ReLU activation function, represents the Sigmoid activation function, represents the channel splicing function, Represents a 1X1 convolution operation; The formula for obtaining the anti-interference feature vector is: , in, represents the anti-interference image, Represents the maximum channel pooling value of the fused feature image, represents the channel average pooling value of the fused feature image, Indicates channel-by-channel multiplication; The acquisition formula of the feature image to be used is: , in, represents the feature image to be used, represents the vertical coordinate of a pixel in the anti-interference feature vector, represents the horizontal coordinate of a pixel in the anti-interference feature vector, represents the height of the anti-interference feature vector, represents the width of the anti-interference feature vector, Indicates dimension recovery processing, Represents dimensionality reduction processing.

[0012] Furthermore, the step of obtaining the standby multi-scale features and the standby width histogram of the standby feature image includes: Obtaining the row center point of each row in the to-be-used feature image, and accumulating the feature values of all the row center points as a center height feature; The row width of the feature image to be used is obtained, the area feature and the width histogram to be used of the feature image to be used are obtained based on the row width, and the multi-scale feature to be used is obtained through the center height feature and the area feature.

[0013] Furthermore, the formula for obtaining the row width is: , in, Indicates the width of the xth row, Represents the characteristic value of the pixel at the xth row and yth column, represents the column index of the rightmost foreground pixel in row x, represents the column index of the leftmost foreground pixel in row x; The formula for obtaining the standby width histogram is: , in, represents the value of the mth bin of the width histogram to be used, Indicates the total number of rows. Indicates the minimum value of the line width. Indicates the maximum value of the line width. Indicates the total number of bins, Indicates rounding down. Represents the indicator function.

[0014] Furthermore, the step of acquiring the correlation coefficient between the standby image and the target image based on the standby multi-scale feature, the standby width histogram, the target multi-scale feature and the target width histogram includes: Acquire a first correlation value based on the stand-by multi-scale feature and the target multi-scale feature; Acquire a second correlation value based on the standby width histogram and the target width histogram; A correlation coefficient is obtained through the first correlation value and the second correlation value.

[0015] In a second aspect, an embodiment of the present application provides an automobile parts appearance defect detection system, which is applied to the automobile parts appearance defect detection method as described in the first aspect above, and the system includes: An acquisition module, used for acquiring an original image of a component placed on a conveyor belt, wherein three positioning points are set on the conveyor belt, and image correction is performed on the original image based on the positioning points to acquire an image to be processed; A first analysis module, used for comparing the image to be processed with a plurality of reference images to select a target image from the plurality of reference images; An extraction module is used to preprocess the image to be processed to obtain a ready-to-use image, construct a semantic segmentation model, and obtain a ready-to-use feature image based on the semantic segmentation model and the ready-to-use image; The second analysis module is used to obtain the standby multi-scale features and the standby width histogram of the standby feature image, and obtain the target multi-scale features and the target width histogram of the target image, obtain the correlation coefficient between the standby image and the target image based on the standby multi-scale features, the standby width histogram, the target multi-scale features and the target width histogram, and determine whether the component has a defect through the correlation coefficient.

[0016] In a third aspect, an embodiment of the present application provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting appearance defects of automotive parts as described in the first aspect above is implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for detecting appearance defects of automobile parts as described in the first aspect above.

[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: image correction is performed on the original image based on the three positioning points to avoid the component area offset in the original image caused by transmission vibration or improper placement, so that the subsequent comparison with the target image is faster and more accurate; by comparing the similarity between the contour to be processed and the contour to be screened, the type of component on the conveyor belt can be identified, and the acquisition of the target image corresponding to the component is automatically completed, so as to facilitate the subsequent recognition of the shape, and the introduction of the aspect ratio is used to perform preliminary screening on the reference image to eliminate other target images with large size deviations, thereby reducing the tediousness of locking the target image corresponding to the component on the conveyor belt and improving the efficiency of shape defect detection; by extracting the standby feature image through the semantic segmentation model, the defect features can be more focused, the influence of noise can be avoided, and the accuracy of shape defect detection can be improved; by introducing the multi-scale features and the standby width histogram, whether there is a problem with the shape of the component is considered in many aspects, and the accuracy of defect detection is effectively improved; replacing manual sampling with automatic recognition not only reduces the workload, but also improves the efficiency and accuracy of component shape defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 Flow chart of the method for detecting appearance defects of automobile parts in the first embodiment of the present invention; Figure 2 It is a structural block diagram of the automobile parts appearance defect detection system in the second embodiment of the present invention; The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0020] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0021] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly on the other element or there can also be an intermediate element. When an element is considered to be "connected to" another element, it can be directly connected to the other element or there may be an intermediate element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are only for the purpose of illustration.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0023] Please refer to Figure 1 , the method for detecting the appearance defects of automotive parts provided by the first embodiment of the present invention includes the following steps: S10: Obtain the original image of the parts placed on the conveyor belt. Three positioning points are set on the conveyor belt. Based on the positioning points, perform image correction on the original image to obtain the image to be processed; There is a conveyor belt and an industrial camera arranged on the conveyor belt on the production line. In this embodiment, the parts are fixed by a placement tray. By placing the placement tray on the conveyor belt, the transmission of the parts is completed. Three non-collinear positioning points are set on the placement tray. When the placement tray moves to the industrial camera along with the conveyor belt, the original image is obtained.

[0024] The step S10 includes: S110: Obtain the target coordinates and shooting coordinates of the three positioning points, and obtain the degree-of-freedom parameter group through the target coordinates and the shooting coordinates; S120: Construct an affine matrix based on the degree-of-freedom parameter group, and perform image correction on the original image through the affine matrix; The industrial camera is electrically connected to the data processing unit. The standard placement tray image is stored in the data processing unit. The coordinates of the three positioning points in the standard placement tray image are the target coordinates. With the support of the three points, six degree-of-freedom parameters can be obtained. The six degree-of-freedom parameters constitute the degree-of-freedom parameter group, and then constitute the affine matrix. If the original image is directly compared with the reference image, errors may occur in the comparison due to the position difference of the parts in the image. Performing image correction on the original image based on the three positioning points can avoid the situation of the offset of the part area in the original image caused by conveyor vibration or improper placement, making the subsequent comparison with the target image faster and more accurate.

[0025] S20: comparing the image to be processed with a plurality of reference images to select a target image from the plurality of reference images; The step S20 comprises: S210: performing binarization processing and edge detection on the image to be processed to obtain a contour to be processed; S220: Obtaining the aspect ratio of the contour to be processed, and selecting a plurality of images to be screened from a plurality of reference images based on the aspect ratio; Binarization and edge detection algorithms have been widely used and will not be described here. After obtaining the contour to be processed, the minimum circumscribed rectangular frame corresponding to the contour to be processed is constructed, and then the aspect ratio corresponding to the contour to be processed is obtained. Different parts have different aspect ratios, and the aspect ratio is introduced to perform preliminary screening of the reference image, eliminating other target images with large size deviations, reducing the cumbersomeness of locking the target image corresponding to the parts on the conveyor belt, and improving the efficiency of shape defect detection.

[0026] S230: performing binarization processing and edge detection on the image to be screened to obtain a contour to be screened, and performing a similarity comparison between the contour to be processed and the contour to be screened to select the image to be screened corresponding to the contour to be screened with the highest similarity as the target image; By comparing the similarity of the contour to be processed with the contour to be screened, the type of parts on the conveyor belt can be identified, and the acquisition of the target image corresponding to the part can be automatically completed, thereby facilitating the subsequent recognition of the shape. In this embodiment, by respectively obtaining the first perimeter and the second perimeter of the contour to be processed and the contour to be screened, the difference between the first perimeter and the second perimeter is used as the basis for similarity judgment.

[0027] S30: preprocessing the image to be processed to obtain a ready-to-use image, constructing a semantic segmentation model, and obtaining a ready-to-use feature image based on the semantic segmentation model and the ready-to-use image; The preprocessing includes light enhancement processing, and the formula of the light enhancement processing is: , in, represents the image to be processed after illumination enhancement processing, represents the image to be processed, represents the brightness coefficient, Represents a pixel value truncation function. Through the illumination enhancement processing, the dark area pixels caused by uneven illumination are linearly stretched to avoid overexposure and detail loss caused by shadows.

[0028] The semantic segmentation model includes a downsampling module, a spatial attention module, and a compression module. The step 30 includes: S310: Use the to-be-processed image as the input value of the downsampling module to obtain a fused feature image; The formula for obtaining the fused feature image is: , where, represents the fused feature image, represents the to-be-processed image, represents a 3X3 convolution operation, represents a dilated convolution operation with a 3X3 convolution kernel and a dilation rate of 2, represents a normalization operation, represents a ReLU activation function, represents a Sigmoid activation function, represents a channel concatenation function, represents a 1X1 convolution operation; S320: Use the fused feature image as the input value of the spatial attention module to obtain an anti-interference image; The formula for obtaining the anti-interference feature vector is: , where, represents the anti-interference image, represents the channel maximum pooling value of the fused feature image, represents the channel average pooling value of the fused feature image, represents element-wise multiplication across channels; S330: Use the anti-interference image as the input value of the compression module to obtain a to-be-processed feature image; The formula for obtaining the to-be-processed feature image is: , where, represents the to-be-processed feature image, represents the vertical coordinate of a certain pixel in the anti-interference feature vector, represents the horizontal coordinate of a certain pixel in the anti-interference feature vector, represents the height of the anti-interference feature vector, represents the width of the anti-interference feature vector, represents dimension restoration processing, represents dimensionality reduction processing; The downsampling module extracts global structures and local details, and after fusion, subtle appearance defects can be identified, reducing the detection error rate. The spatial attention module strengthens high-response areas such as the edges of parts and suppresses background uniform noise, avoiding the noise effects caused by metal reflections, oil stains, etc. After fusion, the defect area is focused, and the compression module reduces the processing volume while retaining the defect features, thereby improving the detection efficiency. That is, by extracting the stand-by feature image through the semantic segmentation model, the defect features can be more focused, the influence of noise can be avoided, and the accuracy and efficiency of appearance defect detection can be improved.

[0029] S40: acquiring a standby multi-scale feature and a standby width histogram of the standby feature image, and acquiring a target multi-scale feature and a target width histogram of the target image, acquiring a correlation coefficient between the standby image and the target image based on the standby multi-scale feature, the standby width histogram, the target multi-scale feature and the target width histogram, and determining whether a component has a defect by using the correlation coefficient; The step S40 comprises: S410: Obtain the row center point of each row in the feature image to be used, and accumulate the feature values of all the row center points as a center height feature; It can be understood that all of the row center points constitute the center axis of the parts on the conveyor belt.

[0030] S420: Acquire the row width of the feature image to be used, acquire the area feature and the width histogram to be used of the feature image to be used based on the row width, and acquire the multi-scale feature to be used through the center height feature and the area feature; The formula for obtaining the row width is: , in, Indicates the width of the xth row, Represents the characteristic value of the pixel at the xth row and yth column, represents the column index of the rightmost foreground pixel in row x, represents the column index of the leftmost foreground pixel in the xth row. It can be understood that all the row widths are summed up, that is, the area feature is obtained, a first weight is assigned to the center height feature, and a second weight is assigned to the area feature, so as to weight the two into the multi-scale feature.

[0031] The formula for obtaining the standby width histogram is: , in, represents the value of the mth bin of the width histogram to be used, Indicates the total number of rows. Indicates the minimum value of the line width. Indicates the maximum value of the line width. Indicates the total number of bins, Indicates rounding down. Represents the indicator function.

[0032] It should be noted that the method for acquiring the target multi-scale feature and the target width histogram is consistent with the method for acquiring the standby multi-scale feature and the standby width histogram, which will not be described in detail here.

[0033] S430: Acquire a first correlation value based on the standby multi-scale feature and the target multi-scale feature; The formula for obtaining the first associated value is: , in, represents the first associated value, represents the multi-scale features to be used, Represents the multi-scale characteristics of the target, Indicates taking the minimum value, Indicates taking the maximum value.

[0034] S440: Acquire a second correlation value based on the standby width histogram and the target width histogram; The formula for obtaining the second associated value is: , in, represents the second associated value, Represents the value of the mth bin of the target width histogram, represents the mean of the width histogram to be used, Represents the mean of the target width histogram; S450: Obtaining a correlation coefficient through the first correlation value and the second correlation value; A third weight and a fourth weight are assigned to the first correlation value and the second correlation value respectively, and the two are weighted and fused into the correlation coefficient.

[0035] By introducing the multi-scale features and the standby width histogram, the accuracy of defect detection is effectively improved by considering whether there are problems with the appearance of parts from multiple aspects; replacing manual sampling with automated identification not only reduces the workload, but also improves the efficiency and accuracy of part appearance defect detection.

[0036] Understandably, after obtaining the correlation coefficient, the correlation coefficient is compared with a coefficient threshold. If the correlation coefficient is less than the coefficient threshold, it is determined that there is a defect. If the correlation coefficient is greater than the coefficient threshold, it is determined that there is no defect. Preferably, an alarm device is further provided on the conveyor belt. If it is determined that there is a defect, the alarm device is triggered to issue an alarm.

[0037] Please refer to Figure 2 , the second embodiment of the present invention provides an automotive part appearance defect detection system. This system is applied to the automotive part appearance defect detection method in the above embodiment, and those that have been described will not be repeated. As used hereinafter, terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0038] The system includes: An acquisition module 10, configured to acquire an original image of a part placed on a conveyor belt. Three positioning points are provided on the conveyor belt, and based on the positioning points, the original image is corrected to obtain a to-be-processed image; The acquisition module 10 includes: A first unit, configured to acquire the target coordinates and shooting coordinates of the three positioning points, and obtain a degree-of-freedom parameter group through the target coordinates and the shooting coordinates; A second unit, configured to construct an affine matrix based on the degree-of-freedom parameter group, and correct the original image through the affine matrix; A first analysis module 20, configured to compare the to-be-processed image with a plurality of reference images to select a target image from the plurality of reference images; The first analysis module 20 includes: A third unit, configured to perform binarization processing and edge detection on the to-be-processed image to obtain a to-be-processed contour; A fourth unit, configured to obtain the aspect ratio of the to-be-processed contour, and select a plurality of to-be-screened images from the plurality of reference images based on the aspect ratio; A fifth unit, configured to perform binarization processing and edge detection on the to-be-screened images to obtain to-be-screened contours, compare the similarity between the to-be-processed contour and the to-be-screened contours, and select the to-be-screened image corresponding to the to-be-screened contour with the highest similarity as the target image; An extraction module 30, configured to preprocess the to-be-processed image to obtain a to-be-used image, construct a semantic segmentation model, and obtain a to-be-used feature image based on the semantic segmentation model and the to-be-used image; The extraction module 30 includes: The sixth unit is configured to use the to-be-processed image as an input value of the downsampling module to obtain a fused feature image; The seventh unit is configured to use the fused feature image as an input value of the spatial attention module to obtain an anti-interference image; The eighth unit is configured to use the anti-interference image as an input value of the compression module to obtain a to-be-processed feature image; The second analysis module 40 is configured to obtain to-be-processed multi-scale features and a to-be-processed width histogram of the to-be-processed feature image, and obtain target multi-scale features and a target width histogram of the target image, and obtain a correlation coefficient between the to-be-processed image and the target image based on the to-be-processed multi-scale features, the to-be-processed width histogram, the target multi-scale features, and the target width histogram, and determine whether there is a defect in the component through the correlation coefficient; The second analysis module 40 includes: The ninth unit is configured to obtain the row center points of each row in the to-be-processed feature image, and accumulate the feature values of all the row center points as a center height feature; The tenth unit is configured to obtain the row width of the to-be-processed feature image, obtain an area feature and a to-be-processed width histogram of the to-be-processed feature image based on the row width, and obtain to-be-processed multi-scale features through the center height feature and the area feature; The eleventh unit is configured to obtain a first correlation value based on the to-be-processed multi-scale features and the target multi-scale features; The twelfth unit is configured to obtain a second correlation value based on the to-be-processed width histogram and the target width histogram; The thirteenth unit is configured to obtain a correlation coefficient through the first correlation value and the second correlation value.

[0039] The present invention further provides a computer, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting the appearance defect of an automotive component as described in the above technical solution is implemented.

[0040] The present invention further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for detecting the appearance defect of an automotive component as described in the above technical solution is implemented.

[0041] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0042] The above-described embodiments merely represent several implementation manners of the present invention. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the appended claims.

Claims

1. A method for detecting the appearance defects of automotive parts, characterized in that, Including the following steps: Obtain the original image of the component placed on the conveyor belt. Three positioning points are set on the conveyor belt, and based on the positioning points, image correction is performed on the original image to obtain the image to be processed; Compare the image to be processed with a number of reference images to select a target image from the number of reference images; Preprocess the image to be processed to obtain an image for use, construct a semantic segmentation model, and obtain a feature image for use based on the semantic segmentation model and the image for use; Obtain the multi-scale features for use and the width histogram for use of the feature image for use, and obtain the multi-scale features for the target and the width histogram for the target of the target image. Based on the multi-scale features for use, the width histogram for use, the multi-scale features for the target, and the width histogram for the target, obtain the correlation coefficient between the image for use and the target image, and determine whether there are defects in the component through the correlation coefficient.

2. The method for detecting the appearance defects of automotive parts according to claim 1, wherein The step of performing image correction on the original image based on the positioning points to obtain the image to be processed includes: Obtain the target coordinates and the shooting coordinates of the three positioning points, and obtain a set of degrees of freedom parameters through the target coordinates and the shooting coordinates; Construct an affine matrix based on the set of degrees of freedom parameters, and perform image correction on the original image through the affine matrix.

3. The method for detecting the appearance defects of automotive parts according to claim 1, wherein, The step of comparing the image to be processed with a number of reference images to select a target image from the number of reference images includes: Perform binarization processing and edge detection on the image to be processed to obtain a contour to be processed; Obtain the aspect ratio of the contour to be processed, and select a number of images to be screened from a number of reference images based on the aspect ratio; Perform binarization processing and edge detection on the images to be screened to obtain contours to be screened, and compare the similarity between the contour to be processed and the contours to be screened, and select the image to be screened corresponding to the contour to be screened with the highest similarity as the target image.

4. The method for detecting the appearance defects of automotive parts according to claim 1, characterized in that, The preprocessing includes light enhancement processing, and the formula for the light enhancement processing is: , Among them, represents the image to be processed after the light enhancement process, represents the image to be processed, represents the brightness coefficient, represents the pixel value truncation function.

5. The method for detecting the appearance defects of automotive parts according to claim 1, characterized in that, The semantic segmentation model includes a downsampling module, a spatial attention module, and a compression module. The step of obtaining a feature image for use based on the semantic segmentation model and the image for use includes: Use the image for use as the input value of the downsampling module to obtain a fused feature image; Use the fused feature image as the input value of the spatial attention module to obtain an anti-interference image; Use the anti-interference image as the input value of the compression module to obtain a feature image for use.

6. The method for detecting the appearance defects of automotive parts according to claim 5, characterized in that, The formula for obtaining the fused feature image is: , Among them, represents the fused feature image, represents the image to be used, represents a 3X3 convolution operation, represents a dilated convolution operation with a 3X3 convolution kernel and a dilation rate of 2, represents a normalization operation, represents the ReLU activation function, represents the Sigmoid activation function, represents the channel concatenation function, represents a 1X1 convolution operation; The formula for obtaining the anti-interference feature vector is: , Among them, represents the anti-interference image, represents the channel maximum pooling value of the fused feature image, represents the channel average pooling value of the fused feature image, represents channel-by-channel multiplication; The formula for obtaining the feature image for use is: , Among them, represents the to-be-used feature image, represents the vertical coordinate of a certain pixel in the anti-interference feature vector, represents the horizontal coordinate of a certain pixel in the anti-interference feature vector, represents the height of the anti-interference feature vector, represents the width of the anti-interference feature vector, represents the dimension restoration process, represents the dimensionality reduction process.

7. The method for detecting the appearance defects of automotive parts according to claim 1, wherein The step of obtaining the multi-scale features for use and the width histogram for use of the feature image for use includes: Obtain the row center points of each row in the feature image for use, and accumulate the feature values of all the row center points as the center height feature; Obtain the row width of the to-be-used feature image, obtain the area feature and the to-be-used width histogram of the to-be-used feature image based on the row width, and obtain the to-be-used multi-scale feature through the center height feature and the area feature.

8. The method for detecting the appearance defects of automotive parts according to claim 7, characterized in that, The formula for obtaining the row width is: , Among them, represents the line width of the x-th row, represents the eigenvalue of the pixel at the y-th column of the x-th row, represents the column index of the rightmost foreground pixel in the x-th row, represents the column index of the leftmost foreground pixel in the x-th row; The formula for obtaining the to-be-used width histogram is: , wherein, represents the value of the m-th bin of the width histogram to be used, represents the total number of rows, represents the minimum value of the row width, represents the maximum value of the row width, represents the total number of bins, represents rounding down, represents the indicator function.

9. The method for detecting the appearance defects of automotive parts according to claim 1, characterized in that, The step of obtaining the correlation coefficient between the to-be-used image and the target image based on the to-be-used multi-scale feature, the to-be-used width histogram, the target multi-scale feature, and the target width histogram includes: Obtain a first correlation value based on the to-be-used multi-scale feature and the target multi-scale feature; Obtain a second correlation value based on the to-be-used width histogram and the target width histogram; Obtain the correlation coefficient through the first correlation value and the second correlation value.

10. An automotive component external defect detection system, applied to the automotive component external defect detection method according to any one of claims 1 to 9, characterized in that, The system includes: An acquisition module, configured to acquire an original image of a component placed on a conveyor belt, where three positioning points are provided on the conveyor belt, and perform image correction on the original image based on the positioning points to obtain an image to be processed; A first analysis module, configured to compare the image to be processed with a plurality of reference images to select a target image from the plurality of reference images; An extraction module, configured to preprocess the image to be processed to obtain a to-be-used image, construct a semantic segmentation model, and obtain a to-be-used feature image based on the semantic segmentation model and the to-be-used image; A second analysis module, configured to obtain the to-be-used multi-scale feature and the to-be-used width histogram of the to-be-used feature image, and obtain the target multi-scale feature and the target width histogram of the target image, obtain the correlation coefficient between the to-be-used image and the target image based on the to-be-used multi-scale feature, the to-be-used width histogram, the target multi-scale feature, and the target width histogram, and determine whether the component has a defect through the correlation coefficient.

Citation Information

Patent Citations

  • System for detecting quality of small parts based on micro-vision

    CN106018415A

  • Auto part quality detection method based on shape match

    CN107886496A

  • Key section data analysis method, device and equipment and storage medium

    CN112381773A

  • Fabric gram weight measuring method and device based on machine vision and electronic equipment

    CN113790784A

  • Three-dimensional defect detection method and detection equipment

    CN115165920A