A plastic paint-sprayed part surface color difference detection method based on image recognition
Patent Information
- Application Number
- CN202611109492.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-11-03
AI Technical Summary
Existing technologies for detecting color differences on the surface of painted plastic parts suffer from problems such as high-gloss interference, gradient discontinuity, curvature color deviation, and noise amplification in flat areas, resulting in large errors in the detection results.
The surface Gaussian curvature value is obtained by calculating the derivative of the surface depth spatial value, the brightness value and the reflective interference mask weight are decoupled, and the continuous reconstruction channel value is calculated by combining the local spatial gradient magnitude. The color shift is calculated based on the surface Gaussian curvature value and the color difference-free standard template value, and the directional compensation channel value is calculated by combining the local spatial gradient magnitude. Finally, the global comprehensive curvature-weighted color difference score value is generated.
It effectively reduces color difference misjudgment caused by high light interference and curvature changes, reduces the impact of curved surface structure on the test results, provides a reference-worthy paint quality assessment, and can accurately detect color difference in complex curved surface environments.
Smart Images

Figure CN123032606A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, specifically to a method for detecting color difference on the surface of painted plastic parts based on image recognition. Background Technology
[0002] In industrial manufacturing, painted plastic parts are widely used. Surface color difference detection of painted plastic parts is a crucial aspect of quality control. Common surface color difference detection methods rely heavily on two-dimensional image recognition technology. Conventional methods typically use a color camera to acquire two-dimensional color images of the product surface. Then, the color channel features of the image are extracted. Finally, the extracted color features are compared with a standard template using a threshold to determine product quality. However, existing technologies face several interferences in real-world scenarios. First, industrial plastic parts often contain complex curved surface structures. These curved structures cause uneven reflections from external light sources, easily leading to severe highlight interference in the image. Existing methods typically set brightness thresholds to directly remove highlight pixels. This approach results in spatial color gradient discontinuities, disrupting the continuity of surface color features and causing misjudgments of color differences. Second, painted parts often use special coatings. The reflective properties of these coatings are significantly affected by the curvature of the surface. Under different curvatures, the coating surface exhibits directional reflection color shifts. Conventional two-dimensional detection techniques lack three-dimensional topographic feature support. Image reconstruction processes often fail to consider these directional reflection color shifts under different curvatures. This causes the system to be unable to distinguish between geometric curvature reflective refraction and actual physical color difference, leading to false detections. Furthermore, using conventional image compensation methods to address the aforementioned color cast problem introduces new image interference. When performing directional color cast compensation, it is difficult to adaptively adjust the compensation amount in high-frequency edge regions and flat regions. This directional color cast compensation easily amplifies background noise in flat low-frequency regions. This amplified background noise interferes with the final overall color difference score.
[0003] In summary, there is a need for an image recognition-based method for detecting color difference on the surface of painted plastic parts to address defects such as specular interference, gradient discontinuity, curvature color deviation, and noise amplification in flat areas. Summary of the Invention
[0004] This invention provides a method for detecting color difference on the surface of painted plastic parts based on image recognition, which helps to solve the problems mentioned in the background art.
[0005] This invention provides the following technical solution: a method for detecting color difference on the surface of painted plastic parts based on image recognition, comprising:
[0006] Calculate the numerical Gaussian curvature of the surface by taking the spatial derivative with respect to the surface depth.
[0007] Calculate the decoupled brightness value and the weight of the reflective interference mask based on the initial values of each channel;
[0008] Calculate the local spatial gradient magnitude and its average value based on the decoupled brightness values;
[0009] The values of the continuous reconstruction channels are calculated by fusing the mask weights and the local spatial gradient magnitudes.
[0010] The color shift is calculated based on the surface Gaussian curvature value and the value of the color difference-free standard template.
[0011] The directional compensation channel value is calculated by combining the local spatial gradient magnitude with the color shift.
[0012] The curvature coupling smoothing suppression weight is calculated based on the surface Gaussian curvature to obtain the final output channel value;
[0013] A global comprehensive curvature-weighted color difference score is generated based on the final output channel values and the values of the color difference-free standard template.
[0014] Optionally, the step of calculating the surface Gaussian curvature by taking the spatial derivative with respect to the surface depth includes:
[0015] Establish a two-dimensional Cartesian coordinate system for image pixels, with the top left corner of the rectangular image field of view captured by the camera as the origin, the horizontal direction to the right as the horizontal axis, the vertical direction downward as the vertical axis, and the unit as a single pixel size;
[0016] An industrial RGB-D camera containing a color CCD sensor array and a depth sensor array is used to take a single synchronous picture of a plastic painted part, and a standard part with no color difference is pre-shot under the same conditions.
[0017] The surface depth spatial values are obtained by reading the depth sensor array;
[0018] Calculate the second partial derivative of the surface depth spatial value along the horizontal axis, the second partial derivative along the vertical axis, the mixed second partial derivative along the horizontal and vertical axes, the first partial derivative along the horizontal axis, and the first partial derivative along the vertical axis.
[0019] The first product is obtained by multiplying the second partial derivative along the horizontal axis with the second partial derivative along the vertical axis.
[0020] The first squared value is obtained by squaring the mixed second-order partial derivatives along the horizontal and vertical axes;
[0021] Subtract the first squared value from the first product to obtain the numerator value;
[0022] The second squared value is obtained by squaring the first partial derivative along the horizontal axis.
[0023] The third squared value is obtained by squaring the first partial derivative along the vertical axis.
[0024] Add 1 to the second squared value and the third squared value to obtain the sum;
[0025] The denominator value is obtained by squaring the sum.
[0026] Dividing the numerator value by the denominator value yields the surface Gaussian curvature value.
[0027] Optionally, the calculation of decoupled brightness values and reflective interference mask weights based on initial channel values includes:
[0028] The initial raw red channel value, the initial raw green channel value, and the initial raw blue channel value are obtained by reading the color CCD sensor array.
[0029] Obtain the total global pixel width and total global pixel height of the image matrix;
[0030] Multiply the initial original red channel value by 0.299, multiply the initial original green channel value by 0.587, multiply the initial original blue channel value by 0.114, and sum the three multipliers to obtain the decoupled brightness value;
[0031] Calculate the average value of the decoupled brightness of all pixels in the image matrix to obtain the global average decoupled brightness value;
[0032] Calculate the standard deviation of the decoupled brightness values of all pixels in the image matrix to obtain the global decoupled brightness standard deviation value;
[0033] The threshold is obtained by adding the average value of global decoupled brightness to the standard deviation value of global decoupled brightness;
[0034] The absolute value of the difference between the decoupled brightness value and the threshold is calculated to obtain the first absolute value;
[0035] The decoupling brightness value is added to the first absolute value and then the threshold is subtracted to obtain the mask molecule value;
[0036] Multiply the difference between 255 and the threshold by 2 to obtain the mask denominator value;
[0037] Dividing the numerator value of the mask by the denominator value of the mask yields the reflective interference mask weight.
[0038] Optionally, calculating the local spatial gradient magnitude and its average value based on the decoupled brightness value includes:
[0039] Calculate the difference in decoupled brightness values between horizontally adjacent pixels and square it to obtain the first difference square;
[0040] Calculate the difference in decoupled brightness values between vertically adjacent pixels and square it to obtain the second difference square;
[0041] The square root of the sum of the squares of the first and second differences is then calculated to obtain the local spatial gradient magnitude.
[0042] The average value of the local spatial gradient magnitude of all pixels in the image matrix is calculated to obtain the average value of the global local spatial gradient magnitude.
[0043] Optionally, the step of calculating the continuous reconstruction channel values by fusing the mask weights and the local spatial gradient magnitudes includes:
[0044] The local spatial gradient magnitude of each pixel in the four neighborhoods is added to the average value of the global local spatial gradient magnitude to obtain the sum of the four neighborhood gradients.
[0045] Divide the initial raw red channel value of each pixel in the four neighborhoods by the corresponding neighborhood gradient sum value to obtain the four neighborhood weighted channel values.
[0046] The weighted channel values of the four neighborhoods are added together to obtain the weighted channel sum value;
[0047] Calculate the reciprocal of the sum of the four neighborhood gradients respectively, and add the four reciprocals to obtain the sum of the reciprocals;
[0048] Divide the weighted channel sum by the reciprocal sum to obtain the fused channel value;
[0049] The repair channel value is obtained by multiplying the fusion channel value by the reflective interference mask weight;
[0050] The first weight difference is obtained by subtracting the weight of the reflective interference mask from 1.
[0051] Multiply the first weight difference by the initial original red channel value to obtain the base channel value;
[0052] The base channel value is added to the repair channel value to obtain the continuous reconstruction red channel value.
[0053] Optionally, the step of calculating the color shift based on the surface Gaussian curvature value and the value of the color-difference-free standard template includes:
[0054] By reading the standard part image buffer in standby mode, the values of the red channel, green channel, and blue channel of the standard template without color difference are obtained.
[0055] Calculate the absolute value of the surface Gaussian curvature of all pixels in the image matrix, and calculate the average of all absolute values to obtain the global surface Gaussian curvature absolute average value.
[0056] The curvature ratio is obtained by dividing the absolute value of the surface Gaussian curvature by the absolute average value of the global surface Gaussian curvature.
[0057] The exponent value is obtained by performing a natural exponentiation operation on the negative of the curvature ratio;
[0058] Subtracting the exponent value from 1 yields the geometric orientation reflection intensity factor;
[0059] The channel difference is obtained by subtracting the red channel value of the color difference-free standard template from the continuous reconstruction red channel value.
[0060] The red channel color shift is obtained by multiplying the geometric orientation reflection intensity factor by the channel difference.
[0061] Optionally, the step of calculating the directional compensation channel value using the local spatial gradient magnitude combined with the color shift offset includes:
[0062] The gradient sum is obtained by adding the local spatial gradient magnitude to the average of the global and local spatial gradient magnitudes.
[0063] Divide the local spatial gradient magnitude by the gradient sum to obtain the gradient weight;
[0064] The color shift compensation value is obtained by multiplying the red channel color shift by the gradient weight;
[0065] The directional compensation red channel value is obtained by subtracting the color shift compensation value from the continuous reconstruction red channel value.
[0066] Optionally, the step of calculating the curvature coupling smoothing suppression weight based on the surface Gaussian curvature value to obtain the final output channel value includes:
[0067] Calculate the absolute value of the Gaussian curvature of the surface;
[0068] The curvature sum is obtained by adding the absolute average value of the global surface Gaussian curvature to the absolute value of the surface Gaussian curvature.
[0069] The curvature coupling smoothing suppression weight is obtained by dividing the absolute average value of the global surface Gaussian curvature by the curvature and the sum of values.
[0070] The second weight difference is obtained by subtracting the curvature coupling smoothing suppression weight from 1.
[0071] The value of the directional compensation red channel is multiplied by the second weight difference to obtain the value of the retained channel;
[0072] The values of the directional compensation red channel at nine locations, including the current pixel and its eight neighboring pixels, are summed to obtain the sum of the neighboring compensation channels.
[0073] Divide the sum of the neighborhood compensation channels by 9 to obtain the average neighborhood compensation value.
[0074] The curvature coupling smoothing suppression weight is multiplied by the neighborhood average compensation value to obtain the smoothing channel value;
[0075] The final output red channel value is obtained by adding the value of the reserved channel to the value of the smoothed channel.
[0076] Optionally, generating a global comprehensive curvature-weighted color difference score based on the final output channel value and the color difference-free standard template value includes:
[0077] Using the same steps as calculating the final output red channel value, obtain the final output green channel value and the final output blue channel value respectively;
[0078] Subtract the red channel value of the color difference-free standard template from the final output red channel value and square the result to obtain the squared red channel difference value.
[0079] Subtract the green channel value of the color difference-free standard template from the final output green channel value and square the result to obtain the squared green channel difference value.
[0080] Subtract the blue channel value of the color difference-free standard template from the final output blue channel value and square the result to obtain the squared blue channel difference value.
[0081] The square root of the sum of the squared differences of the red channel, the green channel, and the blue channel is then taken to obtain the overall channel distance value.
[0082] Calculate the absolute value of the surface Gaussian curvature and add 1 to obtain the curvature weighting coefficient;
[0083] Multiply the channel composite distance value by the curvature weighting coefficient to obtain the single-pixel color difference score value;
[0084] The average value of the single-pixel color difference score of all pixels in the image matrix is calculated to obtain the global comprehensive curvature-weighted color difference score.
[0085] The present invention has the following beneficial effects:
[0086] 1. By collecting initial channel values and surface depth spatial values of the plastic painted parts, this technical solution calculates the surface Gaussian curvature value, decoupled brightness value, and reflective interference mask weight. In the color difference detection environment of plastic painted parts with curved surfaces, the complex geometry can cause uneven reflection of the light source, leading to specular interference and directional reflection color shift that varies with curvature. To address these issues, the solution uses mask weights and local spatial gradient amplitudes to calculate continuous reconstruction channel values, reducing spatial color gradient discontinuities when processing specular areas. Simultaneously, the solution calculates color shift based on the surface Gaussian curvature value and the value of the color difference-free standard template, and combines this with the local spatial gradient amplitude to calculate directional compensation channel values, thereby correcting the color deviation caused by three-dimensional artifacts resulting from the curved surface geometry. To suppress background noise amplification in the flat low-frequency region during this directional compensation process, the solution calculates curvature coupling smoothing suppression weights based on the surface Gaussian curvature value to obtain the final output channel values and generates a global comprehensive curvature-weighted color difference score. In optical inspection environments with interference from curved surface reflections, this solution can integrate the two-dimensional color features of an image with its three-dimensional spatial shape, reduce the influence of curvature geometric bending on the optical reflection characteristics of the coating, reduce the color difference judgment error caused by geometric optical distortion, and provide a reference-based objective quantitative result for the evaluation of surface paint quality.
[0087] 2. By establishing a two-dimensional Cartesian coordinate system for image pixels and obtaining surface depth spatial values, the first-order partial derivatives, second-order partial derivatives, and mixed second-order partial derivatives of the surface depth spatial values along different directions are calculated. The surface Gaussian curvature values are obtained through combined operations such as product, square, subtraction, and division of these partial derivatives. This computational mechanism based on differential geometric features can transform the depth physical space information acquired by the image sensor into curvature features characterizing the degree of geometric curvature on the surface of the painted part. When dealing with plastic painted parts with complex curved structures, this curvature feature can provide basic three-dimensional spatial structural data support for subsequent directional reflection color shift quantization and curvature coupling smoothing. Compared to methods relying solely on two-dimensional planar images, introducing surface Gaussian curvature values helps analyze the non-uniform reflection effect of the object's shape on external light sources, distinguishing between optical changes caused by geometric deformation and the differences in actual coating physical characteristics during the detection process, and reducing the interference caused by the curved surface shape on surface color feature extraction.
[0088] 3. By acquiring the initial raw channel values and accumulating them with a specific proportional coefficient, the decoupled brightness value is calculated. Then, the global decoupled brightness average value and standard deviation value in the image matrix are calculated. The threshold and mask numerator and denominator values are constructed using the aforementioned statistical parameters, and then divided to obtain the reflection interference mask weight. This processing method separates the color dimension and the illumination dimension, extracting parameters that reflect the distribution of illumination intensity. The judgment threshold and mask weight are dynamically generated using the average level and dispersion of the global brightness of the image, which can adapt to the overall illumination fluctuations of different batches or different detection environments. The generated reflection interference mask weight reflects the degree of high light interference of each pixel within a continuous and smooth numerical range, avoiding the edge discontinuity and abrupt change problems caused by using a single fixed empirical threshold. It provides dynamic weight parameters with statistical distribution characteristics for subsequent location of color distortion areas.
[0089] 4. By calculating the square of the difference between the decoupled brightness values of horizontally adjacent pixels and the square of the difference between vertically adjacent pixels, and then summing the two and taking the square root, the local spatial gradient magnitude is obtained. The average value of the local spatial gradient magnitude is then calculated to obtain the global average local spatial gradient magnitude. This calculation process uses the central difference of local brightness to reflect the intensity of spatial color changes and texture edge structure within the image. The extracted local spatial gradient magnitude can quantify the spatial structure guidance of the surface color of the plastic painted parts, serving as a directional guidance coefficient in subsequent pixel processing. The introduction of the global average local spatial gradient magnitude quantifies the overall gradient level of the image. Using it as a regularization parameter in subsequent denominator operations can prevent abnormal weight allocation caused by gradients approaching minimum values in local areas, ensuring the continuity and stability of numerical mapping, and helping to suppress abnormal responses caused by weak gradients in flat areas.
[0090] 5. By adding the local spatial gradient magnitude of the pixels in the four neighboring areas to the average value of the global local spatial gradient magnitude, a neighborhood gradient sum is generated. This neighborhood gradient sum is then used to perform inverse weighted fusion of the initial original channel values in the four neighboring areas, and combined with the reflection interference mask weight, the continuous reconstruction channel values are calculated. This step uses the gradient parameter representing the edge structure intensity as a suppression term, assigning higher fusion weights to flat areas with smaller local spatial gradient magnitudes and lower fusion weights to edge areas with larger magnitudes. Combined with the reflection interference mask weight, the system can guide the colors of surrounding effective pixels to perform structural interpolation within the masked area affected by specular interference. This directionally selective diffusion mechanism can fill specular gaps while suppressing pixel fusion across physical edges, maintaining the spatial continuity of surface color distribution, and alleviating the spatial color gradient discontinuity phenomenon caused by removing specular pixels.
[0091] 6. By calculating the absolute average value of the global surface Gaussian curvature and dividing the absolute value of the local surface Gaussian curvature by it to obtain the curvature ratio, a geometrically oriented reflection intensity factor is generated using exponential operations. Finally, the color shift is obtained by combining the values of the continuous reconstruction channel and the channel values of the color difference-free standard template. This step establishes a correlation function between surface curvature topography and optical reflection magnitude. The geometrically oriented reflection intensity factor uses the exponential decay law to characterize the severity of light source deflection caused by surface curvature, allocating relatively higher intensity weights to areas with larger curvature. The color shift generated by combining the channel difference can quantify the absolute amount of directional reflection chromaticity deviation produced by a specific coating in different curvature regions, separating the visual differences of artifacts caused by geometric reflection from the actual color differences on the surface, and providing a geometrically based bias parameter for subsequent compensation of specific chromaticity deviations caused by curvature.
[0092] 7. By adding the local spatial gradient magnitude to the average global local spatial gradient magnitude, the gradient sum is obtained, and then the gradient weight is derived. The color shift offset is multiplied by this gradient weight to obtain the color shift compensation value. Finally, the color shift compensation value is subtracted from the continuous reconstruction channel value to obtain the directional compensation channel value. This step uses gradient parameters that reflect the strength of spatial texture features to dynamically adjust the quantized color shift offset in the spatial domain. In edge feature regions with obvious gradient changes, the system assigns higher weights to perform relatively strong color offset compensation. In flat regions with weak gradient changes, the system assigns lower weights to converge the compensation amplitude. The adjusted color shift compensation value is fed back into the reconstructed channel data, which can specifically correct the stereoscopic visual color difference induced by the three-dimensional shape changes of the curved surface, and reduce the interference of abrupt curvature changes on the system's comprehensive color difference judgment result.
[0093] 8. By combining the absolute average value of the global surface Gaussian curvature with the absolute value of the surface Gaussian curvature, a curvature coupling smoothing suppression weight is calculated. This weight is then used to proportionally fuse the average compensation value of the surrounding pixels with the current directional compensation channel value to obtain the final output channel value. This step addresses the phenomenon that local directional color shift compensation operations easily induce background noise amplification in flat low-frequency regions by establishing a coupling constraint mechanism between the spatial filtering coefficients and surface curvature features. In flat regions where the curvature approaches zero, the curvature coupling smoothing suppression weight is increased accordingly, activating a higher proportion of neighborhood smoothing operations to filter out background compensation noise. In structural feature regions with large curvature, this weight is decreased accordingly, preserving the independent color information of the directional compensation channel value itself. This geometry-based adaptive filtering mechanism suppresses noise in flat regions while protecting the edge details of the inherent texture of the image surface.
[0094] 9. By subtracting the corresponding channel values of the color-difference-free standard template from the final output channel values and squaring them, then summing the squares of the channel differences and taking the square root, the overall channel distance value is obtained. This value is then multiplied by a weighting coefficient that includes the absolute value of the surface Gaussian curvature. Finally, the global average of the image is taken to obtain the global overall curvature-weighted color difference score. This step summarizes the channel data after blind spot repair, directional color shift compensation, and noise reduction filtering, and measures the overall color deviation between the tested plastic part and the standard part in the three-dimensional joint color space. The introduction of a weighting coefficient that includes curvature components can appropriately adjust the scoring weight of edge defect parts according to the degree of local geometric curvature when evaluating the overall image color difference. The generated global score value integrates the geometric curvature shape and two-dimensional color distribution characteristics of the tested part's surface, and uses it as a quantitative indicator to judge the paint quality, which is closer to the real color perception state of the actual three-dimensional physical surface. Attached Figure Description
[0095] Figure 1 This is a schematic diagram of the basic process of the present invention.
[0096] Figure 2 This is a schematic diagram illustrating the relationship between the spatial numerical values of the surface depth and the calculation of the surface Gaussian curvature in this invention.
[0097] Figure 3 This is a schematic diagram illustrating the relationship between decoupled brightness, reflective interference mask, and continuity reconstruction in this invention.
[0098] Figure 4 This is a schematic diagram illustrating the relationship between curvature color shift compensation, smoothing suppression, and comprehensive color difference scoring in this invention. Detailed Implementation
[0099] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0100] Example 1, refer to Figure 1 A method for detecting color difference on the surface of painted plastic parts based on image recognition, comprising:
[0101] Calculate the numerical Gaussian curvature of the surface by taking the spatial derivative with respect to the surface depth.
[0102] Calculate the decoupled brightness value and the weight of the reflective interference mask based on the initial values of each channel;
[0103] Calculate the local spatial gradient magnitude and its average value based on the decoupled brightness values;
[0104] The values of the continuous reconstruction channels are calculated by fusing the mask weights and the local spatial gradient magnitudes.
[0105] The color shift is calculated based on the surface Gaussian curvature value and the value of the color difference-free standard template.
[0106] The directional compensation channel value is calculated by combining the local spatial gradient magnitude with the color shift.
[0107] The curvature coupling smoothing suppression weight is calculated based on the surface Gaussian curvature to obtain the final output channel value;
[0108] A global comprehensive curvature-weighted color difference score is generated based on the final output channel values and the values of the color difference-free standard template.
[0109] The calculation of the surface Gaussian curvature by taking the spatial derivative of the surface depth includes:
[0110] Reference Figure 2 It shows the correspondence between the surface depth spatial values, the first-order partial derivative, the second-order partial derivative, and the mixed second-order partial derivative, to form the numerator and denominator values, and to obtain the surface Gaussian curvature values.
[0111] The purpose of this step is to convert the surface depth spatial values obtained by the depth sensor array into curvature features that characterize the degree of surface geometric curvature, providing basic spatial structure data for subsequent directional reflection color shift quantization and curvature coupling smoothing.
[0112] A two-dimensional Cartesian coordinate system is established with the top left corner of the rectangular image field of view captured by the camera as the origin, the horizontal direction to the right as the horizontal axis, the vertical direction downward as the vertical axis, and the image pixel size as the unit. A single synchronous shooting of plastic painted parts is carried out using an industrial RGB-D camera containing a color CCD sensor array and a depth sensor array, and synchronous shooting of standard parts with no color difference is carried out in advance under the same conditions.
[0113] The surface depth spatial values are obtained by reading the depth sensor array;
[0114] To obtain the extreme bending values at various points on the surface, the Gaussian curvature of the surface is calculated using the following steps:
[0115] Calculate the second partial derivatives of the surface depth spatial value along the horizontal axis, the second partial derivatives along the vertical axis, the mixed second partial derivatives along the horizontal and vertical axes, the first partial derivative along the horizontal axis, and the first partial derivative along the vertical axis; multiply the second partial derivatives along the horizontal axis and the second partial derivatives along the vertical axis to obtain a first product; square the mixed second partial derivatives along the horizontal and vertical axes to obtain a first squared value; subtract the first squared value from the first product to obtain the numerator value; square the first partial derivatives along the horizontal axis to obtain a second squared value; square the first partial derivatives along the vertical axis to obtain a third squared value; add 1 to the second squared value and the third squared value to obtain a sum; square the sum to obtain the denominator value; divide the numerator value by the denominator value to obtain the surface Gaussian curvature value.
[0116] By establishing a two-dimensional Cartesian coordinate system for image pixels and obtaining surface depth spatial values, the first-order partial derivatives, second-order partial derivatives, and mixed second-order partial derivatives of the surface depth spatial values along different directions are calculated. The surface Gaussian curvature values are then derived using a combination of operations such as multiplication, squaring, subtraction, and division among these partial derivatives. This computational mechanism based on differential geometric features can transform the depth physical space information acquired by the image sensor into curvature features characterizing the degree of geometric curvature on the surface of the painted part. When dealing with plastic painted parts with complex curved structures, this curvature feature can provide basic three-dimensional spatial structural data support for subsequent directional reflection color shift quantization and curvature coupling smoothing. Compared to methods relying solely on two-dimensional planar images, introducing surface Gaussian curvature values helps analyze the non-uniform reflection effect of the object's shape on external light sources, distinguishing between optical changes caused by geometric deformation and the differences in actual coating physical characteristics during the detection process, and reducing the interference caused by the curved surface shape on surface color feature extraction.
[0117] The calculation of decoupled brightness values and reflective interference mask weights based on initial channel values includes:
[0118] Reference Figure 3 It shows the relationship between the initial original channel values, the decoupled brightness statistics to generate reflective interference mask weights, and the continuous reconstruction of red channel values by combining local spatial gradient magnitude and four-neighbor weighting.
[0119] The initial raw red channel value, initial raw green channel value, and initial raw blue channel value are obtained by reading the color CCD sensor array.
[0120] Obtain the total global pixel width and total global pixel height of the image matrix;
[0121] This step aims to solve the "spectral interference problem caused by curved surfaces". The principle is to decouple the RGB color space, separate the pure luminance component, and generate reflective interference mask weights based on the statistical characteristics of the globally decoupled luminance values.
[0122] To separate the color dimension from the illumination dimension, the decoupled brightness value is calculated using the following steps:
[0123] Multiply the initial original red channel value by 0.299, multiply the initial original green channel value by 0.587, multiply the initial original blue channel value by 0.114, and sum the three multipliers to obtain the decoupled brightness value;
[0124] To establish an adaptive specular determination benchmark and avoid using empirical thresholds, the global decoupled brightness average value is calculated through the following steps:
[0125] Calculate the average value of the decoupled brightness of all pixels in the image matrix to obtain the global average decoupled brightness value;
[0126] To establish an adaptive specular determination benchmark and avoid using empirical thresholds, the global decoupled brightness standard deviation is calculated using the following steps:
[0127] Calculate the standard deviation of the decoupled brightness values of all pixels in the image matrix to obtain the global decoupled brightness standard deviation value;
[0128] To continuously and smoothly locate areas of color distortion caused by highlights, the reflective interference mask weights are calculated using the following steps:
[0129] The threshold is obtained by adding the average global decoupling brightness value to the standard deviation of global decoupling brightness value; the absolute value of the difference between the decoupling brightness value and the threshold is calculated to obtain the first absolute value; the threshold is subtracted from the first absolute value after adding the decoupling brightness value to obtain the mask numerator value; the difference between 255 and the threshold is multiplied by 2 to obtain the mask denominator value; the mask numerator value is divided by the mask denominator value to obtain the reflective interference mask weight.
[0130] By acquiring the initial values of each channel and accumulating them with a specific scaling factor, the decoupled brightness value is calculated. Then, the global decoupled brightness average value and standard deviation value in the image matrix are calculated. The threshold and mask numerator and denominator values are constructed using the aforementioned statistical parameters, and then divided to obtain the reflection interference mask weight. This processing method separates the color dimension and the illumination dimension, extracting parameters that reflect the distribution of illumination intensity. The judgment threshold and mask weight are dynamically generated using the average level and dispersion of the global brightness of the image, which can adapt to the overall illumination fluctuations of different batches or different detection environments. The generated reflection interference mask weight reflects the degree of high light interference of each pixel within a continuous and smooth numerical range, avoiding the edge discontinuity and abrupt change problems caused by using a single fixed empirical threshold. It provides dynamic weight parameters with statistical distribution characteristics for subsequent location of color distortion areas.
[0131] The step of calculating the local spatial gradient magnitude and its average value based on the decoupled brightness value includes:
[0132] The purpose of this step is to extract the spatial structure guidance of colors within the image, providing a directional guidance matrix to solve the problem of "spatial color gradient discontinuity caused by highlight removal". Its principle is to use the decoupled brightness difference between horizontally adjacent pixels and vertically adjacent pixels to reflect color changes and edge structures;
[0133] To quantify the severity of local color spatial changes, the local spatial gradient magnitude is calculated using the following steps:
[0134] Calculate the difference in decoupled brightness values between horizontally adjacent pixels and square it to obtain the first difference square; calculate the difference in decoupled brightness values between vertically adjacent pixels and square it to obtain the second difference square; add the first difference square and the second difference square and then perform a square root calculation to obtain the local spatial gradient magnitude.
[0135] To provide a global baseline for zeroing in subsequent calculations, the average value of the global and local spatial gradient magnitudes is calculated through the following steps:
[0136] The average value of the local spatial gradient magnitude of all pixels in the image matrix is calculated to obtain the average value of the global local spatial gradient magnitude.
[0137] By calculating the square of the difference in decoupled brightness values between horizontally adjacent pixels and the square of the difference in vertically adjacent pixels, and then summing the two and taking the square root, the local spatial gradient magnitude is obtained. The average of these local spatial gradient magnitudes is then calculated to obtain the global average local spatial gradient magnitude. This calculation process utilizes the central difference of local brightness to reflect the intensity of spatial color changes and texture edge structure within the image. The extracted local spatial gradient magnitude can quantify the spatial structure guidance of the surface color of plastic painted parts, serving as a directional guidance coefficient in subsequent pixel processing. The introduction of the global average local spatial gradient magnitude quantifies the overall gradient baseline level of the image. Using it as a regularization parameter in subsequent denominator operations prevents abnormal weight allocation caused by gradients approaching minimum values in local areas, ensuring the continuity and stability of numerical mapping, and helping to suppress abnormal responses caused by weak gradients in flat regions.
[0138] The calculation of continuous reconstruction channel values using the fusion of the mask weights and the local spatial gradient magnitudes includes:
[0139] This step aims to completely resolve the "spatial color gradient discontinuity problem." The principle is to use the local spatial gradient magnitude to weight and fuse the initial raw channel values within four neighboring regions, and combine this with the weight of the reflective interference mask to form continuous reconstructed channel values.
[0140] To fill in highlight gaps while suppressing cross-edge diffusion, the continuous reconstruction red channel values are calculated using the following steps:
[0141] The local spatial gradient magnitude of each pixel within four neighborhoods is added to the average global local spatial gradient magnitude to obtain four neighborhood gradient sums. The initial original red channel value of each pixel within four neighborhoods is divided by the corresponding neighborhood gradient sum to obtain four neighborhood weighted channel values. The four neighborhood weighted channel values are added together to obtain a weighted channel sum. The reciprocal of each of the four neighborhood gradient sums is calculated and added together to obtain a reciprocal sum. The weighted channel sum is divided by the reciprocal sum to obtain a fused channel value. The fused channel value is multiplied by the reflection interference mask weight to obtain a repaired channel value. The reflection interference mask weight is subtracted from 1 to obtain a first weight difference. The first weight difference is multiplied by the initial original red channel value to obtain a base channel value. The base channel value is added to the repaired channel value to obtain a continuous reconstructed red channel value.
[0142] The system generates a neighborhood gradient sum by adding the local spatial gradient magnitudes of pixels in four neighboring neighborhoods to the average of the global local spatial gradient magnitudes. This neighborhood gradient sum is then used to perform inverse weighted fusion of the initial original channel values in the four neighboring neighborhoods. Combined with the reflection interference mask weights, the continuous reconstruction channel values are calculated. This step uses gradient parameters representing edge structure intensity as a suppression term, assigning higher fusion weights to flat areas with smaller local spatial gradient magnitudes and lower fusion weights to edge areas with larger magnitudes. Combined with the reflection interference mask weights, the system can guide the colors of surrounding effective pixels to perform structural interpolation within the masked area affected by specular interference. This directionally selective diffusion mechanism can fill specular gaps while suppressing pixel fusion across physical edges, maintaining the spatial continuity of surface color distribution, and mitigating the spatial color gradient discontinuity caused by removing specular pixels.
[0143] The calculation of color shift based on the surface Gaussian curvature value and the value of the color difference-free standard template includes:
[0144] Reference Figure 4 It shows the relationship between the surface Gaussian curvature value, the continuous reconstruction channel value, and the color difference-free standard template value, which sequentially participate in color shift compensation and curvature coupling smoothing, forming a global comprehensive curvature-weighted color difference score value.
[0145] The purpose of this step is to establish the correspondence between surface curvature characteristics and channel color shift amount for directional reflection color shifts generated in different curvature regions of plastic painted parts.
[0146] By reading the standard part image buffer in standby mode, the values of the red channel, green channel, and blue channel of the standard template without color difference are obtained.
[0147] To establish a reference standard for measuring the overall curvature of the surface, the absolute average value of the global surface Gaussian curvature is calculated through the following steps:
[0148] Calculate the absolute value of the surface Gaussian curvature of all pixels in the image matrix, and calculate the average of all absolute values to obtain the global surface Gaussian curvature absolute average value.
[0149] To characterize the severity of light source deflection caused by surface curvature, the geometric orientation reflection intensity factor is calculated using the following steps:
[0150] The curvature ratio is obtained by dividing the absolute value of the surface Gaussian curvature by the absolute average value of the global surface Gaussian curvature; the exponent value is obtained by performing a natural exponentiation operation on the negative of the curvature ratio; and the geometric orientation reflection intensity factor is obtained by subtracting the exponent value from 1.
[0151] To quantify the absolute amount of channel color deviation caused by surface reflection distortion, the red channel color shift is calculated using the following steps:
[0152] The channel difference is obtained by subtracting the red channel value of the color difference-free standard template from the continuous reconstructed red channel value; the red channel color shift is obtained by multiplying the geometric orientation reflection intensity factor by the channel difference.
[0153] By calculating the absolute average value of the global surface Gaussian curvature and dividing the absolute value of the local surface Gaussian curvature by it to obtain the curvature ratio, a geometrically oriented reflection intensity factor is generated using exponential operations. Finally, the color shift is obtained by combining the values of the continuous reconstruction channel and the channel values of the color difference-free standard template. This step establishes a correlation function between surface curvature topography and optical reflection magnitude. The geometrically oriented reflection intensity factor uses the exponential decay law to characterize the severity of light source deflection caused by surface curvature, allocating relatively higher intensity weights to areas with larger curvature. The color shift generated by combining the channel difference can quantify the absolute amount of directional reflection chromaticity deviation produced by a specific coating in different curvature regions, separating the visual differences of artifacts caused by geometric reflection from the actual color differences on the surface, and providing a geometrically based bias parameter for subsequent compensation of specific chromaticity deviations caused by curvature.
[0154] The calculation of the directional compensation channel value using the local spatial gradient magnitude combined with the color shift offset includes:
[0155] The purpose of this step is to adjust the red channel color shift based on the local spatial gradient magnitude, and apply the obtained color shift compensation value to the continuous reconstruction red channel value to obtain the directional compensation red channel value.
[0156] To perform high-intensity compensation in strong edge regions and protect flat regions, the directional compensation red channel values are calculated using the following steps:
[0157] The gradient sum is obtained by adding the local spatial gradient magnitude to the average global and local spatial gradient magnitudes; the gradient weight is obtained by dividing the local spatial gradient magnitude by the gradient sum; the color shift compensation value is obtained by multiplying the red channel color shift by the gradient weight; and the directional compensation red channel value is obtained by subtracting the color shift compensation value from the continuous reconstruction red channel value.
[0158] The gradient sum is obtained by adding the local spatial gradient magnitude to the average global local spatial gradient magnitude, and then the gradient weight is derived. The color shift offset is multiplied by this gradient weight to obtain the color shift compensation value. Finally, the color shift compensation value is subtracted from the continuous reconstruction channel value to obtain the directional compensation channel value. This step uses gradient parameters that reflect the strength of spatial texture features to dynamically adjust the quantized color shift offset in the spatial domain. In edge feature regions with obvious gradient changes, the system assigns higher weights to perform relatively strong color offset compensation. In flat regions with weak gradient changes, the system assigns lower weights to converge the compensation amplitude. The adjusted color shift compensation value is fed back into the reconstructed channel data, which can specifically correct the stereoscopic visual color difference induced by the three-dimensional shape changes of the curved surface, and reduce the interference of abrupt curvature changes on the system's comprehensive color difference judgment result.
[0159] The step of calculating the curvature coupling smoothing suppression weight based on the surface Gaussian curvature to obtain the final output channel value includes:
[0160] This step addresses the background noise amplification problem caused by directional color shift compensation in the flat low-frequency region by establishing a coupling relationship between curvature and smoothing kernel coefficients.
[0161] To define the flatness of the region containing the current pixel in order to assign noise suppression intensity, curvature coupling smoothing suppression weights are calculated through the following steps:
[0162] Calculate the absolute value of the surface Gaussian curvature; add the absolute average value of the global surface Gaussian curvature to the absolute value of the surface Gaussian curvature to obtain the curvature sum value; divide the absolute average value of the global surface Gaussian curvature by the curvature sum value to obtain the curvature coupling smoothing suppression weight;
[0163] To remove noise amplified in flat areas without sacrificing edge sharpness, the final output red channel value is calculated using the following steps:
[0164] The second weight difference is obtained by subtracting the curvature coupling smoothing suppression weight from 1; the retained channel value is obtained by multiplying the directional compensation red channel value by the second weight difference; the directional compensation red channel values of the current processed pixel and its eight neighboring pixels (a total of nine positions) are summed to obtain the neighborhood compensation channel sum; the neighborhood compensation channel sum is divided by 9 to obtain the neighborhood average compensation value; the curvature coupling smoothing suppression weight is multiplied by the neighborhood average compensation value to obtain the smoothing channel value; the retained channel value is added to the smoothing channel value to obtain the final output red channel value.
[0165] Curvature coupling smoothing suppression weight is calculated by combining the absolute average value of the global surface Gaussian curvature with the absolute value of the surface Gaussian curvature. This weight is then used to proportionally fuse the average compensation value of the surrounding pixels with the current directional compensation channel value to obtain the final output channel value. This step addresses the phenomenon that local directional color shift compensation operations can easily induce background noise amplification in flat low-frequency regions by establishing a coupling constraint mechanism between the spatial filtering coefficients and surface curvature features. In flat regions where the curvature approaches zero, the curvature coupling smoothing suppression weight is increased accordingly, activating a higher proportion of neighborhood smoothing operations to filter out background compensation noise. In structural feature regions with large curvature, this weight is decreased accordingly, preserving the independent color information of the directional compensation channel value itself. This geometry-based adaptive filtering mechanism suppresses noise in flat regions while protecting the edge details of the inherent texture of the image surface.
[0166] The step of generating a global comprehensive curvature-weighted color difference score based on the final output channel values and the values of the color difference-free standard template includes:
[0167] The purpose of this step is to summarize the final output channel values after continuous reconstruction, directional color shift compensation and curvature coupling smoothing, and combine them with the surface Gaussian curvature values to generate a global comprehensive curvature-weighted color difference score.
[0168] To accurately assess the overall paint quality of plastic parts, the global comprehensive curvature-weighted color difference score is calculated using the following steps:
[0169] Using the same steps as calculating the final output red channel value, the final output green channel value and the final output blue channel value are obtained respectively; the final output red channel value is subtracted from the red channel value of the color difference-free standard template and squared to obtain the squared red channel difference value; the final output green channel value is subtracted from the green channel value of the color difference-free standard template and squared to obtain the squared green channel difference value; the final output blue channel value is subtracted from the blue channel value of the color difference-free standard template and squared to obtain the squared blue channel difference value; the squared red channel difference value, the squared green channel difference value, and the squared blue channel difference value are added together and the square root is taken to obtain the channel comprehensive distance value; the absolute value of the surface Gaussian curvature value is calculated and 1 is added to obtain the curvature weighting coefficient; the channel comprehensive distance value is multiplied by the curvature weighting coefficient to obtain the single pixel color difference score value; the average value of the single pixel color difference score values of all pixels in the image matrix is calculated to obtain the global comprehensive curvature weighted color difference score value.
[0170] By subtracting the corresponding channel values of the color-difference-free standard template from the final output channel values and squaring them, then summing the squares of the channel differences and taking the square root, the overall channel distance value is obtained. This value is then multiplied by a weighting coefficient that includes the absolute value of the surface Gaussian curvature, and finally the global average of the image is taken to obtain the global overall curvature-weighted color difference score. This step summarizes the channel data after blind spot repair, directional color shift compensation, and noise reduction filtering, and measures the overall color deviation between the tested plastic part and the standard part in the three-dimensional joint color space. The introduction of a weighting coefficient that includes curvature components can appropriately adjust the scoring weight of edge defect parts according to the degree of local geometric curvature when evaluating the overall image color difference. The generated global score value integrates the geometric curvature shape and two-dimensional color distribution characteristics of the tested part's surface, and uses it as a quantitative indicator to judge the paint quality, which is closer to the real color perception state of the actual three-dimensional physical surface.
[0171] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0172] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for detecting color difference on the surface of painted plastic parts based on image recognition, characterized in that, include: Calculate the numerical Gaussian curvature of the surface by taking the spatial derivative with respect to the surface depth. Calculate the decoupled brightness value and the weight of the reflective interference mask based on the initial values of each channel; Calculate the local spatial gradient magnitude and its average value based on the decoupled brightness values; The values of the continuous reconstruction channels are calculated by fusing the mask weights and the local spatial gradient magnitudes. The color shift is calculated based on the surface Gaussian curvature value and the value of the color difference-free standard template. The directional compensation channel value is calculated by combining the local spatial gradient magnitude with the color shift. The curvature coupling smoothing suppression weight is calculated based on the surface Gaussian curvature to obtain the final output channel value; A global comprehensive curvature-weighted color difference score is generated based on the final output channel values and the values of the color difference-free standard template.
2. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 1, characterized in that, The calculation of the surface Gaussian curvature by taking the spatial derivative of the surface depth includes: Establish a two-dimensional Cartesian coordinate system for image pixels, with the top left corner of the rectangular image field of view captured by the camera as the origin, the horizontal direction to the right as the horizontal axis, the vertical direction downward as the vertical axis, and the unit as a single pixel size; An industrial RGB-D camera containing a color CCD sensor array and a depth sensor array is used to take a single synchronous picture of a plastic painted part, and a standard part with no color difference is pre-shot under the same conditions. The surface depth spatial values are obtained by reading the depth sensor array; Calculate the second partial derivative of the surface depth spatial value along the horizontal axis, the second partial derivative along the vertical axis, the mixed second partial derivative along the horizontal and vertical axes, the first partial derivative along the horizontal axis, and the first partial derivative along the vertical axis. The first product is obtained by multiplying the second partial derivative along the horizontal axis with the second partial derivative along the vertical axis. The first squared value is obtained by squaring the mixed second-order partial derivatives along the horizontal and vertical axes; Subtract the first squared value from the first product to obtain the numerator value; The second squared value is obtained by squaring the first partial derivative along the horizontal axis. The third squared value is obtained by squaring the first partial derivative along the vertical axis. Add 1 to the second squared value and the third squared value to obtain the sum; The denominator value is obtained by squaring the sum. Dividing the numerator value by the denominator value yields the surface Gaussian curvature value.
3. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 2, characterized in that, The calculation of decoupled brightness values and reflective interference mask weights based on initial channel values includes: The initial raw red channel value, the initial raw green channel value, and the initial raw blue channel value are obtained by reading the color CCD sensor array. Obtain the total global pixel width and total global pixel height of the image matrix; Multiply the initial original red channel value by 0.299, multiply the initial original green channel value by 0.587, multiply the initial original blue channel value by 0.114, and sum the three multipliers to obtain the decoupled brightness value; Calculate the average value of the decoupled brightness of all pixels in the image matrix to obtain the global average decoupled brightness value; Calculate the standard deviation of the decoupled brightness values of all pixels in the image matrix to obtain the global decoupled brightness standard deviation value; The threshold is obtained by adding the average value of global decoupled brightness to the standard deviation value of global decoupled brightness; The absolute value of the difference between the decoupled brightness value and the threshold is calculated to obtain the first absolute value; The decoupling brightness value is added to the first absolute value and then the threshold is subtracted to obtain the mask molecule value; Multiply the difference between 255 and the threshold by 2 to obtain the mask denominator value; Dividing the numerator value of the mask by the denominator value of the mask yields the reflective interference mask weight.
4. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 3, characterized in that, The step of calculating the local spatial gradient magnitude and its average value based on the decoupled brightness value includes: Calculate the difference in decoupled brightness values between horizontally adjacent pixels and square it to obtain the first difference square; Calculate the difference in decoupled brightness values between vertically adjacent pixels and square it to obtain the second difference square; The square root of the sum of the squares of the first and second differences is then calculated to obtain the local spatial gradient magnitude. The average value of the local spatial gradient magnitude of all pixels in the image matrix is calculated to obtain the average value of the global local spatial gradient magnitude.
5. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 4, characterized in that, The calculation of continuous reconstruction channel values using the fusion of the mask weights and the local spatial gradient magnitudes includes: The local spatial gradient magnitude of each pixel in the four neighborhoods is added to the average value of the global local spatial gradient magnitude to obtain the sum of the four neighborhood gradients. Divide the initial raw red channel value of each pixel in the four neighborhoods by the corresponding neighborhood gradient sum value to obtain the four neighborhood weighted channel values. The weighted channel values of the four neighborhoods are added together to obtain the weighted channel sum value; Calculate the reciprocal of the sum of the four neighborhood gradients respectively, and add the four reciprocals to obtain the sum of the reciprocals; Divide the weighted channel sum by the reciprocal sum to obtain the fused channel value; The repair channel value is obtained by multiplying the fusion channel value by the reflective interference mask weight; The first weight difference is obtained by subtracting the weight of the reflective interference mask from 1. Multiply the first weight difference by the initial original red channel value to obtain the base channel value; The base channel value is added to the repair channel value to obtain the continuous reconstruction red channel value.
6. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 5, characterized in that, The calculation of color shift based on the surface Gaussian curvature value and the value of the color difference-free standard template includes: By reading the standard part image buffer in standby mode, the values of the red channel, green channel, and blue channel of the standard template without color difference are obtained. Calculate the absolute value of the surface Gaussian curvature of all pixels in the image matrix, and calculate the average of all absolute values to obtain the global surface Gaussian curvature absolute average value. The curvature ratio is obtained by dividing the absolute value of the surface Gaussian curvature by the absolute average value of the global surface Gaussian curvature. The exponent value is obtained by performing a natural exponentiation operation on the negative of the curvature ratio; Subtracting the exponent value from 1 yields the geometric orientation reflection intensity factor; The channel difference is obtained by subtracting the red channel value of the color difference-free standard template from the continuous reconstruction red channel value. The red channel color shift is obtained by multiplying the geometric orientation reflection intensity factor by the channel difference.
7. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 6, characterized in that, The calculation of the directional compensation channel value using the local spatial gradient magnitude combined with the color shift offset includes: The gradient sum is obtained by adding the local spatial gradient magnitude to the average of the global and local spatial gradient magnitudes. Divide the local spatial gradient magnitude by the gradient sum to obtain the gradient weight; The color shift compensation value is obtained by multiplying the red channel color shift by the gradient weight; The directional compensation red channel value is obtained by subtracting the color shift compensation value from the continuous reconstruction red channel value.
8. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 7, characterized in that, The step of calculating the curvature coupling smoothing suppression weight based on the surface Gaussian curvature to obtain the final output channel value includes: Calculate the absolute value of the Gaussian curvature of the surface; The curvature sum is obtained by adding the absolute average value of the global surface Gaussian curvature to the absolute value of the surface Gaussian curvature. The curvature coupling smoothing suppression weight is obtained by dividing the absolute average value of the global surface Gaussian curvature by the curvature and the sum of values. The second weight difference is obtained by subtracting the curvature coupling smoothing suppression weight from 1. The value of the directional compensation red channel is multiplied by the second weight difference to obtain the value of the retained channel; The values of the directional compensation red channel at nine locations, including the current pixel and its eight neighboring pixels, are summed to obtain the sum of the neighboring compensation channels. Divide the sum of the neighborhood compensation channels by 9 to obtain the average neighborhood compensation value. The curvature coupling smoothing suppression weight is multiplied by the neighborhood average compensation value to obtain the smoothing channel value; The final output red channel value is obtained by adding the value of the reserved channel to the value of the smoothed channel.
9. The method for detecting surface color difference of plastic painted parts based on image recognition according to claim 8, characterized in that, The step of generating a global comprehensive curvature-weighted color difference score based on the final output channel values and the values of the color difference-free standard template includes: Using the same steps as calculating the final output red channel value, obtain the final output green channel value and the final output blue channel value respectively; Subtract the red channel value of the color difference-free standard template from the final output red channel value and square the result to obtain the squared red channel difference value. Subtract the green channel value of the color difference-free standard template from the final output green channel value and square the result to obtain the squared green channel difference value. Subtract the blue channel value of the color difference-free standard template from the final output blue channel value and square the result to obtain the squared blue channel difference value. The square root of the sum of the squared differences of the red channel, the green channel, and the blue channel is then taken to obtain the overall channel distance value. Calculate the absolute value of the surface Gaussian curvature and add 1 to obtain the curvature weighting coefficient; Multiply the channel composite distance value by the curvature weighting coefficient to obtain the single-pixel color difference score value; The average value of the single-pixel color difference score of all pixels in the image matrix is calculated to obtain the global comprehensive curvature-weighted color difference score.
