Method for detecting color difference defect of finish paint of automobile paint
The CCD camera and T-S fuzzy neural network model convert the car paint topcoat image into CIELAB color space, solving the problems of low efficiency and complex calculation of automotive paint topcoat color difference detection in the prior art, and achieving more efficient color difference detection and color Quality control.
Patent Information
- Application Number
- CN202411163744.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-03
AI Technical Summary
The color difference detection of existing automotive paint topcoats relies on manual detection efficiency, and there are shortcomings in RGB images in detection, complex calculations and large differences in color representations between different devices, making it difficult to effectively detect color difference and defects of topcoats.
The paint topcoat image is obtained by using a CCD camera, converted to CIELAB color space, and the RGB image is converted to CIELAB color space through the T-S fuzzy neural network model, and the color difference value is calculated, and the two-dimensional zero mean discrete Gaussian function is combined for preprocessing and chunking. Processing, locate color exceptions.
It improves the reliability and efficiency of color difference detection of automotive paint finishes, reduces manual subjective evaluation, and can promptly detect inconsistent color difference during spraying, ensuring the color quality of the paint.
Smart Images

Figure CN119067942A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of defect detection, and in particular to a method for detecting color difference defects in automobile paint topcoat. Background Art
[0002] The topcoat of automobile paint is the outermost coating in the automobile painting process, which usually includes two parts: color paint and clear varnish. The color paint determines the color of the car, and the topcoat not only plays a role in aesthetics, but also has the function of protecting the car body from environmental factors, such as weather resistance and fading resistance. If there are color differences and defects in the topcoat, it will affect the overall appearance and brand image of the car, and may even affect the corrosion resistance and scratch resistance of the car. At present, the detection of topcoats, especially color paints, is mainly manual detection, and the detection efficiency is low. There are also solutions for automated detection through high-resolution cameras, but the commonly used RGB images have certain shortcomings in detection. The RGB color space is limited by the color expression capabilities of specific devices. There may be differences in RGB color representation between different devices and display technologies. In addition, in the RGB space, calculating the difference between two colors is also relatively complex and requires a large amount of calculation. Summary of the invention
[0003] The purpose of the present invention is to provide a method for detecting color difference defects of automobile paint topcoat to solve the problems existing in the prior art.
[0004] In order to achieve the above-mentioned object, the technical solution of the present invention provides a method for detecting color difference defects of automobile paint topcoat, comprising the following steps: S1, obtaining an RGB image of a tested area and a standard sample of an automobile paint topcoat through a camera, dividing the obtained image of the tested area into a number of tested sub-areas of the same size; intercepting a standard sample area of the same size as the tested sub-area from the obtained standard sample image; S2, converting the RGB color space of the image of the standard sample area and each tested sub-area into a CIELAB color space;
[0005] S3. Calculate whether the color difference between each sub-region under test and the standard sample region under test is within a preset range. If the color difference exceeds the preset range, determine that the sub-region under test has a color defect.
[0006] Further, step S1 includes the following steps: S11, obtaining an RGB image of the automobile paint topcoat through a CCD camera, and dividing the obtained image into a number of measured sub-regions including an equal number of pixels; S12, preprocessing each measured sub-region image and the standard sample region image using the following two-dimensional zero-mean discrete Gaussian function, The Gaussian distribution parameter σ ranges from 2 to 5.
[0007] Furthermore, in step S2, the CIELAB color space value of the standard sample area and each sub-area image to be tested is the average value of the CIELAB color space Lab values of all pixels in the area.
[0008] Furthermore, the specific process of converting the image acquired in step S2 from the RGB color space to the CIELAB color space includes the following steps: converting the RGB color space of the image to the CIEXYZ color space, and then converting the CIEXYZ color space to the CIELAB color space.
[0009] Furthermore, in step S2, the TS fuzzy neural network model is used to convert the RGB color space of the image of the standard sample area and each measured sub-area to the CIELAB color space, including the following processes: M1, constructing the TS fuzzy neural network model; M2, training the TS fuzzy neural network model; M3, using the trained TS fuzzy neural network model to convert the image RGB color space to the CIELAB color space of the standard sample area and each measured sub-area.
[0010] Furthermore, the TS fuzzy neural network model includes a precondition network and a postcondition network; wherein the precondition network includes an input layer, a fuzzification layer, a fuzzy rule calculation layer, and a precondition output layer; and the postcondition network includes an input layer, a postcondition fuzzy rule calculation layer, an output layer, and a mean output layer.
[0011] Further, step S3 includes the following steps: S31, obtaining the average Lab value of each measured sub-area and the average Lab value of the standard sample area; S32, calculating the color difference ΔE between the measured sub-area and the standard sample area, and the calculation formula is as follows: Where: L*s, a*s, b*s are the average Lab* values of the standard sample area; L*i, a*i, b*i are the average Lab* values of the ith measured sub-area. If ΔE exceeds the preset range, it is considered that the measured sub-area has color deviation.
[0012] Furthermore, the standard deviation of the average Lab* values of the multiple measured sub-areas is calculated by the following formula:
[0013]
[0014] Where σL is the standard deviation of the average L* value of all sub-areas, σa is the standard deviation of the average a* value of all sub-areas, and σb is the standard deviation of the average b* value of all sub-areas; if the values of σL, σa, and σb exceed the preset range, it indicates that the color difference between the measured sub-areas is large and the color distribution is uneven.
[0015] The present invention adopts visual detection technology to carry out quantitative measurement of paint color difference to replace manual subjective evaluation, which can effectively improve the reliability and efficiency of automobile topcoat color difference detection. The method adopts TS fuzzy neural network space conversion model, which can process fuzzy and uncertain information, and maps topcoat image data from one space to another space to help discover the inherent structure and characteristics between data. Avoiding the large amount of calculation process of the traditional color space conversion formula RGB-XYZ-LAB can improve the color difference detection efficiency to a certain extent. At the same time, the block method can be used to locate the color anomaly, and then the color difference information is fed back in time. The staff can make corresponding adjustments to the equipment or parameters in time according to the feedback information, minimize waste, and ensure the quality of paint color.
[0016] The technical solution based on the present invention can help automobile manufacturers to timely discover the problem of inconsistent color difference of the whole vehicle caused by uneven spraying during the spraying process online after the automobile is painted. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of an overall scheme of an embodiment of the present invention. DETAILED DESCRIPTION
[0018] 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 described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] The method involved in the present invention relies on hardware including a light source, a linear CCD color camera system, and a machine vision processing system. Figure 1 The specific hardware used by the applicant in a certain embodiment includes a D65 light source, a 2048-line array CCD camera, and a NEO-PCE-CLD image acquisition card as a machine vision processing system. The hardware can also be other products.
[0020] The method for detecting color difference defects of automobile paint topcoat involved in the present invention comprises the following steps:
[0021] S1. Obtaining RGB images of the tested area and the standard sample of the automobile paint topcoat by a CCD camera, dividing the obtained tested area image into a number of tested sub-areas of the same size; intercepting a standard sample area of the same size as the tested sub-area from the obtained standard sample image;
[0022] S2, converting the RGB color space of the image of the standard sample area and each sub-area to be tested into the CIELAB color space;
[0023] S3. Calculate whether the color difference between each sub-region under test and the standard sample region under test is within a preset range. If the color difference exceeds the preset range, determine that the sub-region under test has a color defect.
[0024] Wherein step S1 comprises the following steps:
[0025] S11, acquiring an RGB image of the automobile paint topcoat through a CCD camera, and dividing the acquired image into a plurality of measured sub-regions including an equal number of pixels. In one embodiment of the present invention, the measured sub-region includes 128*128 pixels;
[0026] S12, using Gaussian filtering to pre-process each sub-region image to be tested and the standard sample region image. More specifically, in one embodiment, the applicant uses the following two-dimensional zero-mean discrete Gaussian function to pre-process
[0027]
[0028] The Gaussian distribution parameter σ ranges from 2 to 5. σ determines the width of the filter, and its value is positively correlated with the degree of smoothing.
[0029] In step S2, the acquired image is converted from the RGB color space to the CIELAB color space. The specific process includes the following steps: converting the RGB color space of the image to the CIEXYZ color space, and then converting the CIEXYZ color space to the CIELAB color space. CIEXYZ and CIELAB are color space standards established by the International Commission on Illumination.
[0030] Specifically, the CIELAB color space values of the standard sample area and each measured sub-area image are the average values of the CIELAB color space Lab values of all pixels in the area, which are respectively recorded as the standard sample area average Lab value and the i-th measured sub-area average Lab value.
[0031] The specific process of converting the RGB color space to the CIELAB color space for each pixel is as follows: the corresponding RGB value is obtained based on the preprocessed image, and then the numerical L*a*b* value of the CIELAB color space is obtained through CIEXYZ as a bridge. The RGB to CIEXYZ conversion formula is as follows:
[0032]
[0033] Here, X, Y, and Z represent the three components of the CIEXYZ color space. The process of converting CIEXYZ to CIELAB color space is as follows:
[0034] First you need to calculate the normalized value of CIEXYZ, then apply the following formula:
[0035]
[0036] Among them, X ref ,Y ref ,Z ref is the CIEXYZ value of the reference white point, usually D65 (daylight) is taken as the reference white point. In one embodiment, the applicant takes the following value: ref =96.42,Y ref =100,Z ref =82.49.
[0037] Then, the Lab* value of CIELAB is calculated according to the following formula:
[0038]
[0039] Among them, f(t)f(t) is an auxiliary function, defined as follows:
[0040]
[0041] Finally, calculate the lightness L* according to the following formula:
[0042] L*=116(f(Y′))-16
[0043] Furthermore, in order to reduce the conversion process of color space and the large amount of calculation process of conversion formula, and realize the rapid extraction of color feature values of topcoat image, this application adopts TS fuzzy neural network model to convert the RGB color space of standard sample area and each measured sub-area image to CIELAB color space.
[0044] The construction and training process of the TS fuzzy neural network model is as follows:
[0045] M1. Construct a TS fuzzy neural network model. The TS fuzzy neural network model in this application is as follows: The TS fuzzy neural network model includes a pre-network and a post-network. The pre-network includes four layers, and each layer is set as follows:
[0046] (1) Input layer: receives raw data and is used to input the values of multiple pixels in the RGB color space.
[0047] (2) Fuzzification layer: In this layer, the data is converted into fuzzy values. The Gaussian membership function is used to determine the membership of the elements in each fuzzy set. The Gaussian membership function is as follows:
[0048]
[0049] Among them, μ ji is the membership degree of the jth fuzzy set on the i-th input, c ji is the center of the Gaussian function s ji is the standard deviation.
[0050] (3) Fuzzy rule calculation layer: In this layer, the fuzzy product inference rule is used to calculate the applicability of each fuzzy rule.
[0051] (4) Precursor output layer: This layer normalizes the results of the fuzzy rule calculation layer so that it can be used as the input of the subsequent network. The normalization formula is as follows:
[0052]
[0053] 1.1.1 The post-processing network consists of four layers, and the settings of each layer are as follows:
[0054] (1) Input layer: receives the normalized weight W output by the previous network j .
[0055] (2) Consequent fuzzy rule calculation layer: For the jth rule, its output formula is as follows:
[0056] 1.1.2
[0057] 1.1.3 Among them, p j0 ,p ji are the parameters of the subsequent network.
[0058] (3) Output layer: The output layer performs weighted summation of the outputs of all rules and outputs multiple pixel CIELAB values.
[0059] (4) Mean output layer, averaging the CIELAB values of multiple pixels and outputting the average value. In one embodiment of the applicant, the TS fuzzy neural network model is set as follows:
[0060] 1.1.41. Definition of membership function. For each color channel (R, G, B) in the RGB color space, we define three fuzzy sets: low, medium, and high. The membership function usually uses a Gaussian function, which is defined as follows:
[0061]
[0062] Among them, cR, cG, cB are the center values of R, G, and B channels respectively, and sR, sG, sB are standard deviations that control the width of the membership function.
[0063] 1.1.52 The technical formula of fuzzy rules is defined as follows:
[0064] Rule 1, Dark Tone Area: IF R is Low and G is Low and B is Low, THEN L * is Low, a*is Negative_Small, b * is Low.
[0065] Rule 2, mid-tone area: IF R is Medium and Gis Medium and B is Medium, THENL * is Medium,a*is Near_Zero,b * is Near_Zero.
[0066] Rule 3, bright tone area: IF R is High and G is High and B is High, THEN L*isHigh, a*is Positive_Small, b * is Positive.
[0067] 3. The reasoning process of TS fuzzy neural network model is as follows:
[0068] Fuzzification: The input RGB value is converted to the membership of the fuzzy set through the membership function.
[0069] Fuzzy rule evaluation: For each rule, calculate its applicability.
[0070] w 1 =μ Low (R)×μ Low (G)×μ Low (B)
[0071] w 2 =μ Medium (R)×μ Medium (G)×μ Medium (B)
[0072] w 3 =μ High (R)×μ High (G)×μ High (B)
[0073] Normalization: The degree is normalized to ensure that the sum is 1. The normalization formula is as follows:
[0074]
[0075] Post-processing evaluation: The post-processing adopts a linear function, and the specific formula is as follows:
[0076] L * =p L1 ×W 1 +p L2 ×W 2 +p L3 ×W 3
[0077] a * =p a1 ×W 1 +p a2 ×W 2 +p a3 ×W 3
[0078] b * =p b1 ×W 1 +p b2 ×W 2 +p b3 ×W 3
[0079] Among them, p Li , p ai , p bi is the linear parameter of rule i.
[0080] M2, TS fuzzy neural network model training, obtain the training data set, the data set includes the RGB value of each pixel of the face paint sample image and the L corresponding to the RGB value * a * b * The TS fuzzy neural network model is trained by training the data set, and the L * a * b * The output layer of the model outputs multiple pixel CIELAB values. When the output error of the TS fuzzy neural network model reaches the preset range, the training of the TS fuzzy neural network model is completed. During the training process, the model is optimized by the gradient descent method, and the sum of squared errors (SSE) is selected as the performance function. The performance function is defined as follows:
[0081]
[0082] Among them, y di represents the expected output of the i-th sample, y ci Represents the actual output of the i-th sample, and N represents the total number of samples. By adjusting the network parameters, the gradient descent method can find the parameter value that minimizes SSE, thereby optimizing the performance of the model.
[0083] The trained TS fuzzy neural network model is used to convert the image RGB color space to CIELAB color space for the standard sample area and each tested sub-area.
[0084] Wherein step S3 comprises the following steps:
[0085] S31. Obtain an average Lab value of each tested sub-area and an average Lab value of the standard sample area.
[0086] S32, calculating the color difference ΔE between the sub-area to be measured and the standard sample area, the calculation formula is as follows:
[0087]
[0088] in:
[0089] L * s ,a * s ,b * s is the average Lab* value of the standard sample area; L * i ,a * i ,b * i is the average Lab* value of the i-th measured sub-area.
[0090] If ΔE exceeds the preset range, it is considered that there is color deviation in the measured sub-area.
[0091] Furthermore, the color uniformity of each measured sub-area can be evaluated. Specifically, the standard deviation of the average Lab* value of multiple measured sub-areas can be calculated by the following formula:
[0092]
[0093] where σ L is the average L of all sub-regions * The standard deviation of the values, σ a is the average of all sub-regions * The standard deviation of the values, σ b is the average b of all sub-regions * The standard deviation of the values. If σ L , σ a , σ b If the value exceeds the preset range, it indicates that the color difference between the measured sub-areas is large and the color distribution is uneven.
[0094] It should be noted that, unless otherwise clearly specified and limited, the terms such as "install", "connect", "connect", "fix", "set" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
Claims
1. A method for detecting color difference defects of automobile paint topcoat, It is characterized in that The steps include: S1. Obtaining RGB images of the tested area and the standard sample of the automobile paint topcoat through a camera, dividing the obtained tested area image into a number of tested sub-areas of the same size; intercepting a standard sample area of the same size as the tested sub-area from the obtained standard sample image; S2, converting the RGB color space of the image of the standard sample area and each sub-area to be tested into the CIELAB color space; S3. Calculate whether the color difference between each sub-region under test and the standard sample region under test is within a preset range. If the color difference exceeds the preset range, determine that the sub-region under test has a color defect.
2. The method for detecting color difference defects of automobile paint topcoat according to claim 1, It is characterized in that Step S1 includes the following steps: S11, obtaining an RGB image of the automobile paint topcoat through a CCD camera, and dividing the obtained image into a number of measured sub-regions including an equal number of pixels; S12, preprocessing each measured sub-region image and the standard sample region image using the following two-dimensional zero-mean discrete Gaussian function, The Gaussian distribution parameter σ ranges from 2 to 5.
3. The method for detecting color difference defects of automobile paint topcoat according to claim 1, It is characterized in that In step S2, the CIELAB color space value of the image of the standard sample area and each sub-area to be tested is the average value of the CIELAB color space Lab values of all pixels in the area.
4. The method for detecting color difference defects of automobile paint topcoat according to claim 3, It is characterized in that The specific process of converting the image acquired in step S2 from the RGB color space to the CIELAB color space includes the following steps: converting the RGB color space of the image to the CIEXYZ color space, and then converting the CIEXYZ color space to the CIELAB color space.
5. The method for detecting color difference defects of automobile paint topcoat according to claim 3, It is characterized in that In step S2, the TS fuzzy neural network model is used to convert the RGB color space of the image of the standard sample area and each measured sub-area to the ClELAB color space, including the following processes: M1, constructing the TS fuzzy neural network model; M2, training the TS fuzzy neural network model; M3, using the trained TS fuzzy neural network model to convert the image RGB color space of the standard sample area and each measured sub-area to the ClELAB color space.
6. The method for detecting color difference defects of automobile paint topcoat according to claim 5, It is characterized in that The TS fuzzy neural network model includes a precondition network and a postcondition network; wherein the precondition network includes an input layer, a fuzzification layer, a fuzzy rule calculation layer, and a precondition output layer; and the postcondition network includes an input layer, a postcondition fuzzy rule calculation layer, an output layer, and a mean output layer.
7. The method for detecting color difference defects of automobile paint topcoat according to claim 1, It is characterized in that Step S3 includes the following steps: S31, obtaining the average Lab value of each measured sub-area and the average Lab value of the standard sample area; S32, calculating the color difference ΔE between the measured sub-area and the standard sample area, and the calculation formula is as follows: Where: L * s , a * s , b * s is the average Lab* value of the standard sample area; L * i , a * i , b * i is the average Lab* value of the i-th measured sub-area. If ΔE exceeds the preset range, it is considered that the measured sub-area has color deviation.
8. The method for detecting color difference defects of automobile paint topcoat according to claim 7, It is characterized in that The standard deviation of the average Lab* values of multiple measured sub-areas is calculated by the following formula where σ L is the average L of all sub-regions * The standard deviation of the values, σ a is the standard deviation of the average a value of all sub-regions, σ b is the average b of all sub-regions * The standard deviation of the values; if σ L , σ a , σ b If the value exceeds the preset range, it indicates that the color difference between the measured sub-areas is large and the color distribution is uneven.
Citation Information
Cited By
Automobile coating defect detection method and system based on machine vision
CN120142303A
A method and system for detecting automobile coating defects based on machine vision
CN120142303B
Vehicle painting make-up color matching method based on computer vision
CN120823414A
Computer vision-based vehicle refinish color matching method
CN120823414B
Vehicle paint effect pigment identification method based on convolutional neural network
CN120876904A
