Defect detection method for automobile electronic parts

Through image acquisition, denoising, enhancement and segmentation technology, combined with shape template matching, the problems of complex defect identification and light impact in automotive electronic parts detection are solved, and the detection accuracy and accuracy are improved.

CN119205649AInactive Publication Date: 2024-12-27朋悦电子科技(南通)有限公司

Patent Information

Application Number
CN202411231745.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing automotive electronic parts detection technology cannot accurately identify complex and changeable defects, easily ignore defects with smaller targets, and has a great impact on the detection light, resulting in low detection accuracy.

Method used

Through image acquisition, denoising, enhancement, segmentation and defect detection steps, noise is removed using median filters, multi-scale image processing algorithms enhance image contour information, set image segmentation thresholds to separate targets and backgrounds, create shape templates for matching detection, and locate Defective area.

Benefits of technology

It improves detection accuracy, ensures that small target defects are detected, reduces the impact of light, and realizes accurate identification and rapid positioning of complex defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205649A_ABST
    Figure CN119205649A_ABST
Patent Text Reader

Abstract

The invention discloses an automobile electronic part defect detection method, and relates to the technical field of automobile electronic part detection, and the method comprises the following steps: S1, image acquisition; s2, de-noising the image; s3, image enhancement; s4, carrying out image segmentation; and S5, defect detection. According to the method, firstly, image noise is filtered out, a multi-scale image processing algorithm is used, the image is preliminarily enhanced, image contour information is enhanced, a final enhanced image is obtained, a defect body is enhanced, it is ensured that small target defects in the image can be detected, the detection precision is improved, a target part is segmented from a background part, and the detection precision is improved. The method has the advantages that interference of useless areas of background parts on defect detection of the parts is prevented, the defects of the parts are quickly detected, defect positioning is realized, defects of large targets can be detected, influence of detection light is reduced, defects of small targets can be detected and recognized, precise recognition can be performed, and detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of automobile electronic component detection, and in particular to an automobile electronic component defect detection method. Background Art

[0002] Automotive electronic components refer to electronic devices and components installed in automobiles to realize various functions of the automobile. These components are of various types and have different functions. They can be divided into many categories according to different classification standards. After the production of automotive electronic components, their surfaces need to be inspected for defects.

[0003] For example, the “Automobile Parts Defect Detection Method, System, Computer and Storage Medium” with publication number CN117291914B includes acquiring a camera image of an automobile part, preprocessing the camera image using a preprocessing process, fitting the preprocessed camera image using a fitting formula to eliminate environmental factors other than the automobile parts to obtain a detection image; and calculating the gradient value direction of the detection image using a gradient formula.

[0004] In the prior art, due to the complex surface structure of automobile parts and the different shapes of defects, they are affected by the detection light, resulting in poor image quality, inability to accurately identify complex and changeable defects, and low sensitivity. In the process of detecting larger defects, smaller defects of the target are easily ignored, affecting the detection accuracy, and cannot adapt to poor lighting environments. Summary of the invention

[0005] The purpose of the present invention is to provide a method for defect detection of automotive electronic components to solve the problem raised by the above background technology that the method is affected by complex and changeable defects and detection light, cannot accurately identify changeable defects, and easily ignores defects with smaller targets.

[0006] To achieve the above object, the present invention provides the following technical solution: a method for detecting defects in automotive electronic components, comprising the following steps:

[0007] S1. Image acquisition: The automobile parts to be inspected are transmitted to the inspection platform, and the automobile parts are imaged by the image acquisition device;

[0008] S2, Image denoising: Convert the part surface image into a grayscale image to remove noise from the image;

[0009] S3, image enhancement: enhance the surface image of the parts, enhance the contour information, and obtain the final enhanced image;

[0010] S4, image segmentation: performing image segmentation processing on the acquired enhanced image, segmenting the target component part from the background part in the image, dividing the region of interest in the image, and distinguishing between the valid area and the invalid area;

[0011] S5. Defect detection: Set the contour shape of the entire area of ​​the image as a standard template, use the image detection algorithm to search for a template with similar contour in the image to be detected, and determine whether the image matches the template.

[0012] Furthermore, in step S2, the image denoising includes obtaining a three-color bitmap after imaging, the three-color bitmap having three color channels of red, green and blue, transforming the chroma and grayscale to obtain a grayscale image with brightness information, and using a median filter to filter out image noise to obtain a smooth image.

[0013] Furthermore, in step S2, the grayscale distribution of the grayscale image ranges from 0 to 280.

[0014] Furthermore, in step S3, the image enhancement includes the following steps:

[0015] S31, using a multi-scale image processing algorithm, converting the image of the component surface into a logarithmic domain image, performing a logarithmic domain rotation to the logarithmic domain image domain, performing an integer domain image output, and obtaining a preliminary enhanced image;

[0016] S32, normalizing the pixel values ​​of the preliminary enhanced image, maintaining the exposure rate of the pixels, and obtaining a processed image;

[0017] S33, continuously downsampling and smoothing the image, decomposing an image into multiple images with different resolutions, obtaining target information, enhancing image contour information, integrating output image information, and obtaining a final enhanced image.

[0018] Furthermore, in step S3, the calculation formula for image enhancement is as follows:

[0019]

[0020] Among them, M(x,y) represents the enhanced image, Q represents the scale set of the surface graphics of the component, q represents the random scale within Q, and G q (x,y) represents the Gaussian convolution function of the qth scale in the image, X q Represents the scale weight of q.

[0021] Furthermore, in step S4, the image segmentation includes the following steps:

[0022] S41, dividing the enhanced image into multiple small blocks, and introducing the neighborhood average grayscale information of the pixel points of each small block image;

[0023] S42, calculating the threshold of each small image block in turn, obtaining the optimal threshold, and comparing the pixel points with the optimal threshold in turn to determine whether the pixel point is a target pixel point or a background pixel point;

[0024] S43, when the pixel point is greater than or equal to the optimal threshold, determine the pixel point as the target pixel point, when the pixel point is less than the optimal threshold, determine the pixel point as the background pixel point, segment the small block image, and segment the target component part from the background part.

[0025] Furthermore, in step S42, the output function formula of the threshold is as follows:

[0026]

[0027] in, Represents the pixel grayscale mean vector, i · is the gray level corresponding to the optimal H(i), δ0(i) represents the average variance of the target, δ1(i) represents the average variance of the background, ω0 represents the target area, ω1 represents the background area, and L O (i) represents the target mean, L a (i) indicates the background mean.

[0028] Furthermore, in step S5, the defect detection includes the following steps:

[0029] S51, setting the processed part of the image area as a template, extracting the template area in the image, performing a secondary affine transformation on the image, extracting the corresponding target area in the image, and obtaining a target template to be detected;

[0030] S52, creating a shape template of the component, performing a closing operation on the edge of the image to retain the boundary, setting reasonable parameters for the shape template, and obtaining a standard template;

[0031] S53, searching for a target template of the image to be detected, and outputting relevant parameters of the matched template, the relevant parameters including position, direction and quantity;

[0032] S54, matching the standard template with the target template to determine the defects of the image to be detected. If the matching is successful, it is determined that the image to be detected has no defects. If the matching fails, it is determined that the image to be detected has defects.

[0033] S55, calculating the difference points between the target template and the standard template, marking the positions of the difference points, and locating the defective area.

[0034] Furthermore, in step S52, the reasonable parameters set for the shape template include the greediness of the match, the gradient change rate, and the derivative peak value.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] The present invention filters out image noise through a median filter, and while filtering out image noise to the maximum extent, it also ensures the integrity of image information. It uses a multi-scale image processing algorithm to perform preliminary enhancement on the image, enhance image contour information, obtain a final enhanced image, strengthen the defect subject, ensure that smaller target defects in the image can be detected, and improve detection accuracy. The enhanced image is divided into multiple small blocks, and the optimal threshold of the image is obtained. It is determined whether the pixel point is a background pixel point or a target pixel point, thereby separating the target component part from the background part, preventing the useless area of ​​the background part from interfering with the defect detection of the component. The target template is matched with the standard template, and defect detection of the image to be detected is performed. At the same time, the defect area is located, so as to quickly detect the defects of the component and realize defect location. It can not only detect the defects of large targets, but also reduce the influence of detection light, detect and identify the defects of small targets, and can accurately identify them, thereby improving detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 The present invention is a flow chart of a method for detecting defects in automotive electronic components. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the implementation regulations described 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.

[0039] Embodiment: A method for detecting defects in automotive electronic components comprises the following steps:

[0040] Step 1: Image acquisition: The automobile parts to be inspected are transferred to the inspection platform, and the automobile parts are imaged by the image acquisition device;

[0041] Step 2: Image denoising: Convert the part surface image into a grayscale image to remove noise from the image;

[0042] Image denoising includes obtaining a three-color bitmap after imaging. The three-color bitmap has three color channels: red, green, and blue. The chromaticity and grayscale are transformed to obtain a grayscale image with brightness information. A median filter is used to filter out image noise to obtain a smooth image. While filtering out image noise to the maximum extent, the integrity of image information is also guaranteed, providing a basis for subsequent image enhancement and segmentation. The grayscale distribution range of the grayscale image is 0-280.

[0043] Step 3: Image enhancement: Enhance the surface image of the component to enhance the contour information and obtain the final enhanced image;

[0044] Image enhancement includes the following steps:

[0045] 31. Use a multi-scale image processing algorithm to convert the image of the component surface into a logarithmic domain image, perform a logarithmic domain rotation to the logarithmic domain image domain, and output the integer domain image to obtain a preliminary enhanced image;

[0046] 32. Normalize the pixel values ​​of the preliminary enhanced image, maintain the exposure rate of the pixels, and obtain the processed image;

[0047] 33. Continuously downsample and smooth the image, decompose an image into multiple images of different resolutions, obtain target information, enhance image contour information, integrate output image information, and obtain the final enhanced image.

[0048] The calculation formula for image enhancement is as follows:

[0049]

[0050] Among them, M(x,y) represents the enhanced image, Q represents the scale set of the surface graphics of the component, q represents the random scale within Q, and G q (x,y) represents the Gaussian convolution function of the qth scale in the image, X q Represents the scale weight of q.

[0051] Step 4: Image segmentation: Perform image segmentation processing on the acquired enhanced image, separate the target component part from the background part in the image, divide the region of interest in the image, and distinguish between the valid area and the invalid area;

[0052] Image segmentation consists of the following steps:

[0053] 41. Divide the enhanced image into multiple small blocks, and introduce the neighborhood average grayscale information of the pixel points of each small block image;

[0054] 42. Calculate the threshold of each small image block in turn, obtain the optimal threshold, compare the pixel points with the optimal threshold in turn, and determine whether the pixel point belongs to the target pixel point or the background pixel point;

[0055] 43. When the pixel point is greater than or equal to the optimal threshold, the pixel point is determined to be a target pixel point. When the pixel point is less than the optimal threshold, the pixel point is determined to be a background pixel point. The small image is segmented to separate the target component part from the background part.

[0056] The output function formula of the threshold is as follows:

[0057]

[0058] in, Represents the pixel grayscale mean vector, i · is the gray level corresponding to the optimal H(i), δ0(i) represents the average variance of the target, δ1(i) represents the average variance of the background, ω0 represents the target area, ω1 represents the background area, and L O (i) represents the target mean, L a (i) indicates the background mean.

[0059] Step 5: Defect detection: Set the contour shape of the entire area of ​​the image as the standard template, use the image detection algorithm to search for a template with similar contour in the image to be detected, and determine whether the image matches the template.

[0060] Defect detection includes the following steps:

[0061] 51. Set the processed part of the image area as a template, extract the template area in the image, perform a secondary affine transformation on the image, extract the corresponding target area in the image, and obtain the target template to be detected;

[0062] 52. Create a shape template for the parts, perform a closing operation on the image edge to retain the boundary, set reasonable parameters for the shape template, and obtain a standard template;

[0063] 53. Search for the target template of the image to be detected, and output the relevant parameters of the matched template, including position, direction and quantity;

[0064] 54. Match the standard template with the target template to determine the defects of the image to be detected. If the match is successful, it is determined that the image to be detected has no defects. If the match fails, it is determined that the image to be detected has defects.

[0065] 55. Calculate the difference points between the target template and the standard template, mark the positions of the difference points, and locate the defective area.

[0066] Setting reasonable parameters for the shape template includes the greediness of the match, the gradient change rate, and the derivative peak.

[0067] The present invention uses an image acquisition device to capture images of the surface of automobile parts, obtains a three-color bitmap with three color channels of red, green and blue, transforms chroma and grayscale to obtain a grayscale image with brightness information, uses a median filter to filter image noise, and while filtering out image noise to the maximum extent, also ensures the integrity of image information, uses a multi-scale image processing algorithm to perform preliminary enhancement on the image, then normalizes the pixel values ​​of the preliminary enhanced image, decomposes the processed image into multiple images of different resolutions, obtains target information of the image, enhances image contour information, obtains a final enhanced image, strengthens the defect subject, ensures that smaller target defects in the image can be detected, and improves detection accuracy, performs image segmentation processing on the enhanced image, and obtains the enhanced image. The image is divided into multiple small blocks, and the optimal threshold of each small block image is calculated in turn. The pixel point is compared with the optimal threshold to determine whether the pixel point is a background pixel point or a target pixel point, thereby separating the target component part from the background part to prevent the useless area of ​​the background part from interfering with the defect detection of the component. A shape template of the component is created, and parameters are set to obtain standard parameters. The processed image is set as a template to obtain the target template to be detected. The target template is matched with the standard template to perform defect detection on the image to be detected, and the defect area is located at the same time, so as to quickly detect the defects of the component and realize defect positioning. It can not only detect the defects of large targets, but also reduce the influence of detection light, detect and identify the defects of small targets, and perform accurate identification, thereby improving the detection accuracy.

[0068] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting defects in automotive electronic components, characterized in that: The following steps are involved: S1. Image acquisition: The automobile parts to be inspected are transmitted to the inspection platform, and the automobile parts are imaged by the image acquisition device; S2, Image denoising: Convert the part surface image into a grayscale image to remove noise from the image; S3, image enhancement: enhance the surface image of the parts, enhance the contour information, and obtain the final enhanced image; S4, image segmentation: performing image segmentation processing on the acquired enhanced image, segmenting the target component part from the background part in the image, dividing the region of interest in the image, and distinguishing between the valid area and the invalid area; S5. Defect detection: Set the contour shape of the entire area of ​​the image as a standard template, use the image detection algorithm to search for a template with similar contour in the image to be detected, and determine whether the image matches the template.

2. The automotive electronic component defect detection method according to claim 1, characterized in that: In step S2, the image denoising includes obtaining a three-color bitmap after imaging, the three-color bitmap having three color channels of red, green and blue, transforming the chroma and grayscale to obtain a grayscale image with brightness information, and using a median filter to filter out image noise to obtain a smooth image.

3. The automotive electronic component defect detection method according to claim 1, characterized in that: In step S2, the grayscale distribution of the grayscale image ranges from 0 to 280.

4. The automotive electronic component defect detection method according to claim 1, characterized in that: In step S3, the image enhancement comprises the following steps: S31, using a multi-scale image processing algorithm, converting the image of the component surface into a logarithmic domain image, performing a logarithmic domain rotation to the logarithmic domain image domain, performing an integer domain image output, and obtaining a preliminary enhanced image; S32, normalizing the pixel values ​​of the preliminary enhanced image, maintaining the exposure rate of the pixels, and obtaining a processed image; S33, continuously downsampling and smoothing the image, decomposing an image into multiple images with different resolutions, obtaining target information, enhancing image contour information, integrating output image information, and obtaining a final enhanced image.

5. The automotive electronic component defect detection method according to claim 1, characterized in that: In step S3, the calculation formula for image enhancement is as follows: Among them, M(x,y) represents the enhanced image, Q represents the scale set of the surface graphics of the component, q represents the random scale within Q, and G q (x,y) represents the Gaussian convolution function of the qth scale in the image, X q Represents the scale weight of q.

6. The automotive electronic component defect detection method according to claim 5, characterized in that: In step S4, the image segmentation comprises the following steps: S41, dividing the enhanced image into multiple small blocks, and introducing the neighborhood average grayscale information of the pixel points of each small block image; S42, calculating the threshold of each small image block in turn, obtaining the optimal threshold, and comparing the pixel points with the optimal threshold in turn to determine whether the pixel point is a target pixel point or a background pixel point; S43, when the pixel point is greater than or equal to the optimal threshold, determine the pixel point as the target pixel point, when the pixel point is less than the optimal threshold, determine the pixel point as the background pixel point, segment the small block image, and segment the target component part from the background part.

7. The automotive electronic component defect detection method according to claim 1, characterized in that: In step S42, the output function formula of the threshold is as follows: in, Represents the pixel grayscale mean vector, i · is the gray level corresponding to the optimal H(i), δ0(i) represents the average variance of the target, δ1(i) represents the average variance of the background, ω0 represents the target area, ω1 represents the background area, and L O (i) represents the target mean, L a (i) indicates the background mean.

8. The automotive electronic component defect detection method according to claim 1, characterized in that: In step S5, the defect detection includes the following steps: S51, setting the processed part of the image area as a template, extracting the template area in the image, performing a secondary affine transformation on the image, extracting the corresponding target area in the image, and obtaining a target template to be detected; S52, creating a shape template of the component, performing a closing operation on the edge of the image to retain the boundary, setting reasonable parameters for the shape template, and obtaining a standard template; S53, searching for a target template of the image to be detected, and outputting relevant parameters of the matched template, the relevant parameters including position, direction and quantity; S54, matching the standard template with the target template to determine the defects of the image to be detected. If the matching is successful, it is determined that the image to be detected has no defects. If the matching fails, it is determined that the image to be detected has defects. S55, calculating the difference points between the target template and the standard template, marking the positions of the difference points, and locating the defective area.

9. The automotive electronic component defect detection method according to claim 8, characterized in that: In step S52, the reasonable parameters set for the shape template include the greediness of the match, the gradient change rate, and the derivative peak value.

Citation Information

Patent Citations

  • Automobile parts defect detection method, system, computer and storage medium

    CN117291914B

Cited By

  • Automobile part defect detection method and system

    CN119722678A

  • Product quality detection method, system and equipment applied to endoscope camera module

    CN119958823A