A method and system for intelligently identifying defects in automobile lamp housings

By constructing grayscale matrices and anomaly matrices under different light intensities and angles, the defective areas of the automobile lamp housing can be identified, solving the problem of insufficient accuracy in existing detection methods and achieving more accurate defect detection.

CN120318238BActive Publication Date: 2025-09-19XIAN WEIER PRECISION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510812067.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-19
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

The existing automotive lamp housing inspection methods have low accuracy, especially under the interference of ambient light and material reflection, making it difficult to fully and accurately reflect the true quality status of the lamp housing, and unable to accurately quantify the thickness differences in different areas.

Method used

By acquiring grayscale images under different illumination intensities and angles, constructing an effective grayscale matrix, calculating the mutation degree and constructing an abnormality matrix, and combining the local outlier factor and the standard grayscale matrix, the defective area is identified and the influence of ambient light is eliminated.

Benefits of technology

It improves the accuracy of automobile lamp housing defect detection, can identify uneven thickness and structural defects, reduces the interference of ambient light, and achieves more accurate detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318238B_ABST
    Figure CN120318238B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of automobile lamp housing inspection, and in particular to a method and system for intelligently identifying defects in automobile lamp housings. The method comprises: obtaining grayscale images of automobile lamp housings under different illumination intensities and constructing an image set; calculating the degree of mutation of each pixel point at each position in the grayscale image, and using the grayscale value of the pixel point with the largest mutation degree as the effective grayscale point at the corresponding position; constructing an effective grayscale matrix using the effective grayscale points; comparing the effective grayscale matrix with a preset standard grayscale matrix to obtain an anomaly matrix for the image set, wherein the anomaly matrix includes non-zero connected domains; changing the illumination angle to obtain image sets under different illumination angles, and further obtaining an anomaly matrix for each image set; and using the intersection of the non-zero connected domains in multiple anomaly matrices as the defective area of ​​the automobile lamp housing. The present invention improves the accuracy of automobile lamp housing defect detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile lamp housing detection, and in particular to an automobile lamp housing defect intelligent recognition method and system. Background Art

[0002] Currently, automotive lamp housings are primarily manufactured using polycarbonate injection molding, a process that is prone to surface and structural defects. Common surface defects include weld lines, sink marks, and air marks, while common structural defects include uneven thickness and invisible cracks. Traditional automotive lamp housing defect detection relies on manual inspection and other auxiliary equipment, making it difficult to accurately identify complex defects. Manual inspection is susceptible to subjective factors, resulting in low efficiency, high costs, and a high risk of missed detections.

[0003] Chinese patent publication CN118644480B discloses a method and system for inspecting the surface of automotive lamps. The method includes the following steps: acquiring lamp images and a standard image under light sources of varying intensities; calculating the degree of similarity between pixels in the lamp images and those in the standard image, and generating a similarity feature map based on the degree of similarity; marking points in the similarity feature map with a degree of similarity greater than a preset threshold as initial damage points, and generating an initial damage area based on the initial damage points; calculating a damage rating, and selecting the initial damage area with the lowest damage rating in each lamp image as the optimal analysis area; for any two lamp images under light sources of varying intensities, marking the optimal analysis area with the largest area among those with overlapping locations as the final damage area; and determining the ratio of the number of pixels in the final damage area to the number of non-zero pixels as the quality rating.

[0004] Existing lamp housing inspection methods often use fixed-angle imaging to capture images of the lamp. These results are significantly affected by ambient light and material reflections, making it difficult to fully and accurately reflect the true quality of the lamp housing. Furthermore, the complex shapes of existing automotive lamp housings make existing inspection methods unable to accurately quantify thickness differences in different areas, resulting in low accuracy in the inspection results. Summary of the Invention

[0005] In order to solve the problem of low accuracy of detection results in existing automobile lamp housing detection methods, the present invention provides an automobile lamp housing defect intelligent recognition method and system.

[0006] In a first aspect, the present invention provides a method for intelligently identifying defects in automobile lamp housings, which employs the following technical solutions:

[0007] Obtain grayscale images of car lamp housings under different light intensities and construct an image set;

[0008] Calculate the mutation degree of each pixel at each position in the grayscale image, and take the grayscale value of the pixel with the largest mutation degree as the valid grayscale point at the corresponding position; construct an effective grayscale matrix using the valid grayscale points; compare the effective grayscale matrix with the preset standard grayscale matrix to obtain an abnormal matrix for the image set, which includes non-zero connected domains;

[0009] By changing the illumination angle, image sets under different illumination angles are obtained, and an anomaly matrix of each image set is further obtained. The intersection of the non-zero connected domains in multiple anomaly matrices is used as the defect area of ​​the automobile lamp housing.

[0010] By calculating the effective grayscale points and constructing the effective grayscale matrix, the defective areas can be identified, which facilitates the detection of defects in the automobile lamp housing. Moreover, by changing the illumination angle to obtain multiple abnormal matrices, the influence of ambient light is eliminated and the accuracy of the detection results is improved.

[0011] Preferably, the method further comprises: obtaining grayscale values ​​of pixels at the same position in the image set, sorting the grayscale values ​​in chronological order to obtain a grayscale sequence, and dividing the grayscale sequence into two subsequences using any grayscale value in the grayscale sequence.

[0012] By classifying the grayscale sequence, a theoretical basis is provided for calculating the mutation degree of each pixel.

[0013] Preferably, the expression of the mutation degree is:

[0014]

[0015] Where, is the mutation degree of the ath gray value in the gray sequence, is the number of grayscale values ​​in the grayscale sequence, a is the serial number corresponding to the a-th grayscale value in the grayscale sequence, is a subsequence consisting of the first to a-1th grayscale values ​​in the grayscale sequence, It is a subsequence consisting of the grayscale values ​​from the a+1th to the last in the grayscale sequence, and STD is the standard deviation.

[0016] By calculating the mutation degree, we can understand the mutation of the gray value and calculate the effective gray point at each position.

[0017] Preferably, the expression of the mutation degree is:

[0018]

[0019] Where, is the mutation degree of the ath gray value in the gray sequence, is a subsequence consisting of the first to a-1th grayscale values ​​in the grayscale sequence, It is a subsequence consisting of the grayscale values ​​from the a+1th to the last in the grayscale sequence, and STD is the standard deviation.

[0020] Preferably, the method for calculating the degree of mutation is: fitting the grayscale sequence to obtain a fitting curve, calculating the slope of each data point in the fitting curve, and taking the slope as the degree of mutation of the corresponding grayscale value.

[0021] The slope of the data point is used as the mutation degree of the gray value, which improves the calculation rate and reduces the amount of calculation data.

[0022] Preferably, the method for comparing the effective grayscale matrix with the preset standard grayscale matrix to obtain the abnormal matrix about the image set is: calculating the ratio of the data at the same position in the effective grayscale matrix and the standard grayscale matrix, and the absolute value of the difference between the ratio and 1, and in response to the absolute value being less than a preset difference threshold, updating the data point at the corresponding position in the effective grayscale matrix to 0, and further obtaining the abnormal matrix.

[0023] Preferably, the method for comparing the effective grayscale matrix with the preset standard grayscale matrix to obtain the abnormal matrix about the image set is: calculating the difference between the data at the same position in the effective grayscale matrix and the standard grayscale matrix, and in response to the difference being less than a preset difference threshold, updating the data point at the corresponding position in the effective grayscale matrix to 0, and further obtaining the abnormal matrix.

[0024] Preferably, before comparing the effective grayscale matrix with the preset standard grayscale matrix, the method further includes the step of using a local outlier factor to perform anomaly detection on the effective grayscale matrix and eliminate outliers.

[0025] Preferably, the illumination angles include 0 degrees, 90 degrees, 180 degrees and 270 degrees.

[0026] By adjusting the lighting angle, the influence of ambient light is eliminated and the accuracy of the detection results is improved.

[0027] In a second aspect, the present invention provides an intelligent identification system for automobile lamp housing defects, which adopts the following technical solutions:

[0028] A system for intelligently identifying defects in automobile lamp housings includes a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, the above-mentioned method for intelligently identifying defects in automobile lamp housings is implemented.

[0029] The above-mentioned intelligent identification method for automobile lamp housing defects is generated into a computer program and stored in a memory so as to be loaded and executed by a processor. Thus, a system is made based on the memory and the processor for easy use.

[0030] The present invention has the following technical effects:

[0031] By calculating the effective grayscale points and constructing the effective grayscale matrix, and comparing the effective grayscale matrix with the standard grayscale matrix, it is possible to identify areas with thicker or thinner defects, which facilitates the detection of thickness defects in automobile lamp housings. Moreover, by changing the illumination angle to obtain multiple abnormal matrices, the influence of ambient light is eliminated, thereby improving the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 The present invention is a flow chart of an intelligent method for identifying defects in an automobile lamp housing. DETAILED DESCRIPTION

[0033] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.

[0034] The embodiment of the present invention discloses a method for intelligently identifying defects in a car lamp housing. Figure 1 , including the following steps:

[0035] S1: Obtain grayscale images of car lamp housings under different light intensities and construct an image set.

[0036] The power of the internal light source of the car lamp housing is linearly increased from zero to the maximum power, so that the light intensity gradually increases. Grayscale images of the car lamp housing are collected at equal time intervals. Multiple grayscale images constitute an image set, and the grayscale images in the image set are arranged in chronological order.

[0037] Due to the complex shape design of automobile lamp shells, the thickness of different areas of the automobile lamp shells may be inconsistent, resulting in inconsistent light transmittance in areas of different thicknesses under different light intensities. As the intensity of the light source increases, the brightness change ratio of lamp shell areas of different thicknesses is also inconsistent. For example, in thicker areas, obvious changes will only occur when the light intensity is large enough. Therefore, the lamp shell areas can be distinguished by the change in light intensity.

[0038] S2: Calculate the mutation degree of each pixel at each position in the grayscale image, and take the grayscale value of the pixel with the largest mutation degree as the effective grayscale point at the corresponding position.

[0039] Obtain the grayscale values ​​of the pixels at the same position in the image set, sort the grayscale values ​​in chronological order to obtain a grayscale sequence, and use any grayscale value in the grayscale sequence to divide the grayscale sequence into two subsequences. In the image set, the pixels at the same position in each grayscale image correspond to the same position in the lamp housing. For example, the mth pixel in each grayscale image corresponds to the same position in the lamp housing. In multiple grayscale images, the grayscale value of the mth pixel constitutes the grayscale sequence. Since the light intensity gradually increases during the grayscale image acquisition process, the grayscale values ​​in the grayscale sequence are arranged from small to large.

[0040] In one embodiment, the expression for the degree of mutation is:

[0041]

[0042] Where, is the mutation degree of the ath gray value in the gray sequence, is a subsequence consisting of the first to a-1th grayscale values ​​in the grayscale sequence, It is a subsequence consisting of the grayscale values ​​from the a+1th to the last in the grayscale sequence, and STD is the standard deviation.

[0043] The above formula means dividing the grayscale sequence into two subsequences with the ath grayscale value as the dividing point, and calculating the difference in the standard deviations of the two subsequences, which can also be understood as the difference in the volatility of the two subsequences. The larger the value of , the more obvious the grayscale change is at the ath grayscale value in the grayscale sequence.

[0044] For example, for the grayscale sequence of the first pixel in the grayscale image, the number of data points in the grayscale sequence is 10, among which the mutation degree of the sixth grayscale value is the largest, indicating that the grayscale value in the grayscale sequence has changed significantly from the sixth data point, and the sixth grayscale value is taken as the effective grayscale point of the first pixel.

[0045] In one embodiment, the expression for the degree of mutation is:

[0046]

[0047] Where, is the mutation degree of the ath gray value in the gray sequence, is the number of grayscale values ​​in the grayscale sequence, a is the serial number corresponding to the a-th grayscale value in the grayscale sequence, is a subsequence consisting of the first to a-1th grayscale values ​​in the grayscale sequence, It is a subsequence consisting of the grayscale values ​​from the a+1th to the last in the grayscale sequence, and STD is the standard deviation.

[0048] Based on the volatility of the two subsequences, since the former subsequence corresponds to a lower light source power, the subsequence has a smaller volatility, while the latter subsequence corresponds to a larger light source power, the grayscale value changes greatly, and the subsequence has a larger volatility, so we introduce right Corrections were made to improve the accuracy of the mutation degree calculation results.

[0049] It should be noted that The formula is simple and the calculation result is fast, which is suitable for automobile lamp housings with low structural complexity.

[0050] The calculation results of the formula are highly accurate and are suitable for automobile lamp housings with a high degree of structural complexity.

[0051] In one embodiment, the degree of mutation is calculated by fitting the grayscale sequence to obtain a fitting curve, calculating the slope of each data point in the fitting curve, and using the slope as the degree of mutation of the corresponding grayscale value. This calculation method is suitable for automotive lamp housings with relatively low structural complexity.

[0052] S3: constructing an effective grayscale matrix using effective grayscale points, and comparing the effective grayscale matrix with a preset standard grayscale matrix to obtain an abnormal matrix about the image set, wherein the abnormal matrix includes a non-zero connected domain.

[0053] In the grayscale image of the image set, each position corresponds to a valid grayscale point. Based on these valid grayscale points, an effective grayscale matrix is ​​constructed. The size of the effective grayscale matrix is ​​the same as that of the grayscale image, and the positions of the data points in the effective grayscale matrix correspond one-to-one with the positions of the data points in the grayscale image. The effective grayscale matrix is ​​detected for anomalies using a local outlier factor and outliers are removed. The mean of the grayscale sequence at the corresponding position is taken as the supplement.

[0054] In the effective grayscale matrix, the larger the value of the effective grayscale point, the greater the grayscale value of the pixel at the corresponding position has changed under strong lighting conditions, further indicating that the thickness of the car lamp shell in the corresponding position area is greater. Conversely, the smaller the value of the effective grayscale point, the smaller the thickness of the car lamp shell in the corresponding position area.

[0055] In one embodiment, the ratio of the data at the same location in the valid grayscale matrix to the data at the same location in the standard grayscale matrix, as well as the absolute value of the difference between the ratio and 1, is calculated. If the absolute value is less than a preset difference threshold, the data point at the corresponding location in the valid grayscale matrix is ​​updated to zero, thereby obtaining an abnormal matrix. The standard grayscale matrix is ​​the valid grayscale matrix corresponding to an image set of automobile lamp housings with no quality defects and uniform thickness.

[0056] An absolute value less than the preset difference threshold indicates that the corresponding location area is a normal area. In the valid grayscale matrix, the data points in the normal area are updated to zero, and the connected domain composed of zero data points is a zero-value connected domain. Conversely, an absolute value greater than the preset difference threshold indicates that the corresponding location area is an abnormal area. In the valid grayscale matrix, the data points in the abnormal area remain unchanged, and the connected domain composed of non-zero data points is a non-zero connected domain.

[0057] In one embodiment, the difference between the data at the same position in the valid grayscale matrix and the standard grayscale matrix is ​​calculated. In response to the difference being less than a preset difference threshold, the data point at the corresponding position in the valid grayscale matrix is ​​updated to zero, thereby obtaining an abnormal matrix.

[0058] S4: Changing the illumination angle to obtain image sets under different illumination angles, further obtaining an anomaly matrix for each image set, and taking the intersection of non-zero connected domains in multiple anomaly matrices as the defective area of ​​the automobile lamp housing.

[0059] Automotive lamp housings are often made of highly reflective polished polycarbonate. Specular reflection concentrates light at a fixed angle, forming a bright spot. Using a point light source or strong light without diffusion, and with the angle between the light source and the camera meeting specular reflection requirements, the reflections can be exacerbated. The complex curves of the lamp housing alter the direction of light reflection, creating localized highlights in areas of sharp curvature and even causing multiple reflections. Ambient light, such as factory lights or reflected light from surrounding objects, further complicates interference, leading to anomalies in the effective grayscale matrix of the lamp housing.

[0060] Therefore, if only a single-angle illumination is used to obtain the effective grayscale matrix, it will be affected by reflections, resulting in larger values ​​of the effective grayscale points in the effective grayscale matrix and an inability to accurately represent the thickness of the car lamp housing. Therefore, it is necessary to shoot from multiple angles to eliminate the interference of ambient light.

[0061] In summary, when the illumination angles are 0 degrees, 90 degrees, 180 degrees, and 270 degrees, the image sets of the automobile lamp housing are respectively obtained, thereby obtaining the anomaly matrix of each image set. The intersection of the non-zero connected domains in multiple anomaly matrices is the defective area of ​​the automobile lamp housing.

[0062] An embodiment of the present invention further discloses an intelligent identification system for automobile lamp housing defects, comprising a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, an intelligent identification method for automobile lamp housing defects according to the present invention is implemented.

[0063] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are known in the art and will not be described in detail here.

[0064] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. An intelligent method for identifying defects in automobile lamp housings, characterized in that: Including steps: Obtain grayscale images of car lamp housings under different light intensities and construct an image set; Obtain the grayscale value of the pixel at the same position in the image set, sort the grayscale values ​​in chronological order to obtain a grayscale sequence, and use any grayscale value in the grayscale sequence to divide the grayscale sequence into two subsequences; The degree of mutation of each pixel at each position in the grayscale image is calculated, and the grayscale value of the pixel with the largest degree of mutation is used as the effective grayscale point at the corresponding position; an effective grayscale matrix is ​​constructed using the effective grayscale points; and an abnormality matrix for the image set is obtained by comparing the effective grayscale matrix with a preset standard grayscale matrix by calculating the ratio of the data at the same position in the effective grayscale matrix to the data at the same position in the standard grayscale matrix, and the absolute value of the difference between the ratio and 1. In response to the absolute value being less than a preset difference threshold, the data point at the corresponding position in the effective grayscale matrix is ​​updated to 0, and an abnormality matrix is ​​further obtained, wherein the abnormality matrix includes a non-zero connected domain. The expression of mutation degree is: Where, is the mutation degree of the ath gray value in the gray sequence, is the number of grayscale values ​​in the grayscale sequence, a is the sequence number corresponding to the a-th grayscale value in the grayscale sequence, is a subsequence consisting of the first to a-1th grayscale values ​​in the grayscale sequence, is a subsequence consisting of the grayscale values ​​from a+1 to the last in the grayscale sequence, and STD is the standard deviation; By changing the illumination angle, image sets under different illumination angles are obtained, and an anomaly matrix of each image set is further obtained. The intersection of the non-zero connected domains in multiple anomaly matrices is used as the defect area of ​​the automobile lamp housing.

2. The method for intelligently identifying defects in automobile lamp housings according to claim 1, characterized in that: The expression of mutation degree is: Where, is the mutation degree of the ath gray value in the gray sequence, is a subsequence consisting of the first to a-1th grayscale values ​​in the grayscale sequence, It is a subsequence consisting of the grayscale values ​​from the a+1th to the last in the grayscale sequence, and STD is the standard deviation.

3. The method for intelligently identifying defects in automobile lamp housings according to claim 1, characterized in that: The calculation method of the mutation degree is as follows: fitting the grayscale sequence to obtain a fitting curve, calculating the slope of each data point in the fitting curve, and taking the slope as the mutation degree of the corresponding grayscale value.

4. The method for intelligently identifying defects in automobile lamp housings according to claim 1, characterized in that: The method for comparing the effective grayscale matrix with the preset standard grayscale matrix to obtain the abnormal matrix about the image set is: calculating the difference between the data at the same position in the effective grayscale matrix and the standard grayscale matrix, and in response to the difference being less than the preset difference threshold, updating the data point at the corresponding position in the effective grayscale matrix to 0, and further obtaining the abnormal matrix.

5. The method for intelligently identifying defects in automobile lamp housings according to claim 1 or 4, characterized in that: Before comparing the effective grayscale matrix with the preset standard grayscale matrix, the method also includes the steps of using the local outlier factor to perform anomaly detection on the effective grayscale matrix and eliminate outliers.

6. The method for intelligently identifying defects in automobile lamp housings according to claim 1, characterized in that: The lighting angles include 0 degrees, 90 degrees, 180 degrees and 270 degrees.

7. An intelligent identification system for automobile lamp housing defects, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an intelligent identification method for automobile lamp housing defects according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Automobile lamp surface detection method and system

    CN118644480B

  • Intelligent detection method for pitting corrosion defect on surface of mechanical part

    CN116977335A

  • Image processing-based abnormal identification method and device for special-shaped metal part, and medium

    CN118279304A

  • Data line appearance defect rapid detection method based on intelligent image recognition

    CN119963551A