Automobile ornament color difference detection method based on image recognition
By combining multi-narrowband imaging and spectrophotometry with a reference spot method, the problem of unstable detection results in the color difference detection of automotive trim parts is solved. This method enables reliable discrimination of the color consistency of the entire trim part and clear identification of local anomalies, and is suitable for both online and offline detection environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGYIN EXCELLENT AUTOMOTIVE TRIM CO LTD
- Filing Date
- 2026-01-13
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies for color difference detection of automotive trim parts struggle to quickly and comprehensively assess the color consistency of the entire trim part while ensuring detection reliability. This is especially true when dealing with different film layers of the same color, discontinuous local defects, and mismatches between the camera and the material's spectral response, making it difficult to provide clear criteria for anomaly identification.
Using a multi-narrowband imaging device and a spectrometer, combined with a reference spot with known spectral characteristics, imaging response data and spectral measurement data are acquired. Reflectance spectral data are calculated through a linear mapping relationship and normalized. Multidimensional spectral signature data are calculated, and color difference anomalies are determined based on robust statistical methods.
It achieves stable color difference detection on high-gloss and multi-curved surfaces, effectively suppresses interference from brightness fluctuations and specular reflections, improves the stability and practicality of detection, and can identify local abnormal areas, making it suitable for online inspection and offline sampling scenarios.
Smart Images

Figure CN121899042A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual and spectral measurement technology, specifically to a method for detecting color difference in automotive trim parts based on image recognition. Background Technology
[0002] In the process of vehicle assembly and interior / exterior exterior quality control, the surface color difference detection of automotive trim parts is usually completed at online workstations or post-assembly re-inspection workstations. Under these conditions, the trim parts being inspected often have a large inspection area, complex surface coating structures, and high gloss requirements. In existing technologies, visual inspection methods based on visible light images are commonly used. Images of the trim parts are acquired through white light or multispectral RGB imaging, and the color consistency of the trim parts is judged by combining color space conversion and color difference calculation formulas. However, in a continuous production line environment, due to differences in the thickness of the clear coat layer, film layer, or base material on the surface of the trim parts, the same color sample often shows significant brightness changes and specular reflection differences at different workstations or in different batches. Such changes directly affect the camera imaging response, resulting in unstable color difference judgment results based on RGB or brightness information.
[0003] On the other hand, in offline spot inspection or rework inspection scenarios, spot inspection equipment such as spectrophotometers can be used to obtain high-precision reflectance spectral information; however, such equipment can usually only measure a single point or a very small number of points, making it difficult to cover the entire surface of the part; when the part has discontinuous defects such as local color difference, local contamination or uneven film layer, the spot measurement method is difficult to detect the problem in time; in inspection scenarios that require a rapid and comprehensive evaluation of the entire part, the applicability of such methods is significantly limited.
[0004] To address these limitations, especially when dealing with critical issues such as different films of the same color, discontinuous local defects, and mismatch between the spectral response of the camera and the material, existing methods struggle to provide clear criteria for anomaly identification while ensuring detection reliability. There is an urgent need for a technical solution that can combine on-site measurable references, estimate stable spectral information, and differentiate spectral morphologies. Summary of the Invention
[0005] This invention provides a method for detecting color difference in automotive trim parts based on image recognition, which helps to solve the problems mentioned in the background art.
[0006] This invention provides the following technical solution: a method for detecting color difference in automotive trim parts based on image recognition, comprising:
[0007] Set up multiple narrowband imaging devices, spectrometers, and reference spots with known spectral characteristics, and acquire dark frame data and local reference region data;
[0008] Imaging response data of the reference spot was acquired under various narrowband illumination conditions, and corresponding spectral measurement data were also acquired.
[0009] Based on the imaging response data and spectral measurement data of the reference spot, a linear mapping relationship is calculated to map the imaging response to a discrete reflectance spectrum;
[0010] Imaging response data of the tested automotive trim parts were acquired under various narrowband lighting conditions, and the corresponding reflectance spectral data were calculated based on the linear mapping relationship.
[0011] The reflectance spectral data are normalized to eliminate the influence of brightness variations on the spectral morphology.
[0012] Based on the normalized reflectance spectral data, multidimensional spectral signature data characterizing spectral morphology features are calculated.
[0013] Based on spectral signature data within a local reference region, statistical baseline parameters and thresholds for detection are calculated.
[0014] The spectral signature data of the tested automotive trim is compared with the statistical benchmark parameters, and the result of the color difference anomaly is output.
[0015] Optionally, the arrangement of the multi-narrowband imaging device, the spectrometer, and the reference spot with known spectral characteristics, and the acquisition of dark frame data and local reference region data, includes:
[0016] Fix the part to be inspected at the inspection station and make the optical axis of the camera perpendicular to the normal of the surface of the part to ensure that the imaging field of view covers the surface to be inspected.
[0017] Several narrowband LED illumination modules of different wavelengths are fixed in a ring around the camera, ensuring that each narrowband LED can be triggered individually and synchronized with the camera.
[0018] Several reference spots are fixed on a rigid bracket near the edge of the inspected part within the camera's field of view, so that the reference spots are geometrically coplanar with the inspected part.
[0019] Optical shielding is installed in the testing environment to block external visible light;
[0020] Several dark frames were collected for each narrowband under completely dark conditions, and the average dark current of each band was calculated.
[0021] The reflectance spectrum of each reference spot was measured and saved using a portable spectrophotometer.
[0022] Select and record a qualified local reference area on the inspected part, and collect the true reflectance spectrum of the area.
[0023] Each narrowband band is illuminated briefly in sequence, and several frames of images are acquired simultaneously. The median of the pixels in the reference spot area is taken to obtain the summary response.
[0024] Optionally, acquiring imaging response data of the reference spot under various narrowband illumination conditions and acquiring corresponding spectral measurement data includes:
[0025] For each reference spot, the response components after dark frame correction are calculated in each narrowband, and the responses of each band are integrated according to the reference spot to form a response data set.
[0026] At the same time, the measured discrete reflection spectra of each reference spot are sampled and organized into a spectral data set according to a unified wavelength;
[0027] The response data set and the spectral data set are used for subsequent mapping solutions.
[0028] Optionally, the step of calculating a linear mapping relationship for mapping the imaging response to a discrete reflectance spectrum based on the imaging response data and spectral measurement data of the reference spot includes:
[0029] The pseudo-inverse of the constructed response data set is obtained and multiplied with the spectral data set to obtain a linear mapping matrix used to map the narrowband imaging response to a discrete reflection spectrum.
[0030] After constructing the mapping matrix, the condition number of the response matrix is calculated and its numerical stability is evaluated. If the condition number does not meet the implementation requirements, the conditionality is improved by supplementing or replacing the reference patch.
[0031] Optionally, acquiring imaging response data of the tested automotive trim component under various narrowband illumination conditions and calculating the corresponding reflectance spectral data based on the linear mapping relationship includes:
[0032] Dark frame correction is performed on each pixel in the tested image under each narrow band, and the median is taken as the pixel response;
[0033] The pixel's multi-band response is input into the obtained linear mapping matrix to calculate the discrete reflectance estimation spectrum of the pixel.
[0034] Pixels identified as highlights are removed before spectral estimation, the highlight determination being based on a percentile threshold of pixel energy or brightness.
[0035] Optionally, the normalization process for the reflectance spectral data to eliminate the influence of brightness variations on the spectral morphology includes:
[0036] For each pixel, the reflection spectrum is estimated by calculating the spectral energy and normalizing it based on the spectral energy. The normalized spectrum is then used for subsequent morphological feature calculations.
[0037] Highlight pixels are removed before normalization.
[0038] Optionally, the calculation of multidimensional spectral signature data characterizing spectral morphology based on normalized reflectance spectral data includes:
[0039] The spectral centroid and spectral width of the normalized spectrum are calculated as low-order morphological quantities.
[0040] The first-order and second-order difference energies of the calculated spectrum are used as higher-order morphological quantities.
[0041] The spectral centroid, spectral width, first-order difference energy, and second-order difference energy are combined in a fixed order to form a four-dimensional spectral signature.
[0042] Optionally, the calculation of statistical benchmark parameters and thresholds for detection based on spectral signature data within a local reference region includes:
[0043] Within the local reference region, the median of the components of the estimated reflection spectrum and the spectral signature are calculated respectively, and used as the median of the components of the reference spectrum and the reference signature.
[0044] The median absolute deviation of each component of the reference signature is calculated as a robust metric.
[0045] For each pixel: calculate its spectral angular distance from the reference spectrum. When calculating, the ratio of the inner product to the norm is truncated to a defined effective range before calculating the inverse cosine.
[0046] Divide the difference between the signature components by the corresponding median absolute deviation and calculate their Euclidean norm to obtain the standardized distance of the signature.
[0047] Based on the spectral angular distance and signature normalization distance within the reference region, a robust statistical method is used to convert the median absolute deviation into the corresponding standard deviation estimate for threshold construction.
[0048] Optionally, the spectral signature data of the tested automotive trim component is compared with the statistical benchmark parameters, and the result of the color difference anomaly determination is output, including:
[0049] Thresholds are constructed for spectral angular distance and signature-standardized distance, respectively. Each threshold is composed of the median of the corresponding metric plus a significance factor multiplied by a robust standard deviation estimate of that metric.
[0050] A pixel is considered abnormal when any metric exceeds its threshold.
[0051] If the spectral angle distance exceeds its threshold and the signature normalization distance does not exceed its threshold, it is determined to be an overall color bias.
[0052] If the signature normalization distance exceeds its threshold, it is judged as spectral distortion;
[0053] If both exceed their thresholds, it is determined to be a mixed anomaly.
[0054] The present invention has the following beneficial effects:
[0055] 1. In specific environments such as online color inspection or post-assembly re-inspection of automotive trim parts, the surface of trim parts typically has characteristics such as high gloss, multiple curved surfaces, and complex film structures. Conventional inspection methods based on visible light images or simple colorimetric calculations are easily affected by factors such as changes in ambient light, specular reflection, and inconsistent camera response, leading to unstable inspection results. In particular, it is difficult to distinguish subtle color differences or spectral anomalies caused by differences in film layers or local process variations. To address this, this technical solution introduces reference response information under controlled lighting conditions and combines it with multi-channel imaging data to perform overall modeling and analysis of the surface reflection characteristics of trim parts. This allows for more reliable judgment of the color consistency of the entire trim part without relying on single-point measurements. It can effectively suppress interference caused by high gloss and brightness fluctuations, improve the consistency and repeatability of color judgment of the entire trim part, and form a clearer identification basis for local abnormal areas, thereby improving the stability and practicality of automated inspection.
[0056] 2. By fixing multiple known spectral reference spots within the camera's field of view at the inspection station and employing individually triggerable narrowband illumination, on-site calibration and control of the imaging system and illumination conditions are achieved. This allows all subsequent pixel responses to be interpreted using the same reference system, significantly reducing the impact of external scattered light and light source chromatographic drift on the inspection results. In practical application environments such as production lines or sampling stations, decorative parts may exhibit multi-curved surfaces and high gloss characteristics. Traditional white light imaging struggles to distinguish between observational differences caused by illumination variations and actual material differences. However, by maintaining the continuous presence of on-site reference spots and sequential narrowband acquisition, the baseline of the actual imaging response can be obtained for each inspection, providing stable reference conditions. Furthermore, this calibration method allows for real-time estimation and elimination of the camera's dark current and fundamental noise, thereby improving the signal-to-noise ratio and reducing the probability of misjudgment in low-brightness areas.
[0057] 3. By acquiring the pixel-level response of the reference spot and the reflectance spectrum measured by the spectrophotometer in parallel under each narrow-band illumination condition, a direct correspondence between the imaging response and the true spectrum of the object is established. This design allows the mapping relationship to be constructed based on field-measurable data rather than offline or prior models, thereby enhancing the robustness of the model to changes in field conditions. In actual industrial scenarios, the reference spot material and the material of the inspected part may have complexities such as similar chromatograms but different film layers. The synchronously acquired spectral information can ensure that the mapping can reflect the spectral characteristics of such subtle differences. In addition, this parallel acquisition method facilitates the use of robust statistics to summarize the reference response, reducing the impact of individual pixel anomalies or short-term noise on the calibration results, thereby ensuring the numerical stability and repeatability of the mapping matrix.
[0058] 4. By using the reference response set and its corresponding reflectance spectrum set to calculate the linear mapping from the imaging response to the discrete spectrum, and then testing the numerical stability and conditional evaluation after the mapping is constructed, this design makes the spectral estimation have a clear physical correspondence and interpretability by completing the mapping solution in the field, thus avoiding the performance degradation problem commonly seen in black-box training models when transferred to new working conditions.
[0059] 5. By inputting the response of each pixel in each narrow band into the constructed linear mapping, a discrete reflectance spectrum estimate of the entire part is obtained. Simultaneously, highlight pixels are identified and removed before estimation, enabling the acquisition of spectral information distribution close to point measurement at the area array level. On the surface of the part where highlights and specular reflections are common, highlight removal avoids the malicious distortion of spectral estimation by specular components, allowing subsequent spectral shape analysis to be based on physical reflectance components rather than observations mixed with specular components. Compared with single-point detection, whole-part pixel-level spectral estimation can identify the spatial distribution characteristics of local anomalies, making it easier to locate the location of uneven film layers or local contamination and output it to the production line for process correction. In addition, the parallel nature of pixel-level estimation supports real-time or near-real-time processing, which is suitable for the time constraints of online inspection on the production line.
[0060] 6. Energy normalization of the estimated pixel spectrum eliminates brightness scale differences. This method is a key operation to separate brightness-related factors from spectral information. It allows subsequent comparison of spectral features to focus on the morphological differences of the spectrum itself, without being affected by overall illumination intensity or local geometric shadows. This is crucial for distinguishing color shift caused by overall changes in dye content from spectral distortion caused by film thickness or local contamination. In production inspection scenarios, the brightness of the surface of the parts can fluctuate significantly due to different workstation positioning, surface curvature, or local treatment. Energy normalization can ensure that the detection index maintains its discrimination sensitivity under these changing conditions, thereby reducing system false alarms and false negatives caused by brightness fluctuations.
[0061] 7. By combining the spectral centroid, spectral width, and first- and second-order differential energies into a multidimensional spectral signature, the signature contains both low-order overall color shift information and high-order local spectral abrupt change information, forming the ability to distinguish differences caused by different factors. The spectral centroid and spectral width measurements are directly sensitive to overall color shift and spectral broadening, while the differential energy is particularly sensitive to spectral anomalies in the form of peaks or depressions. The combination of the two can significantly improve the detection capability of complex phenomena such as film non-uniformity, varnish treatment differences, and film contamination. In addition, the signature design uses a normalized spectrum as input, which naturally has brightness invariance, making it easy to maintain discrimination consistency under multiple operating conditions.
[0062] 8. By utilizing the median spectrum and signature median within the local reference region that has passed quality inspection, as well as robust scaling estimation based on median absolute deviation, a statistical benchmark and scaling quantity for detection are constructed, enabling the construction of adaptive thresholds under field conditions. The median and median absolute deviation, as robust statistics, have natural resistance to interference from anomalous pixels, thus providing a stable benchmark estimate even in reference regions with a small amount of contamination or measurement noise.
[0063] 9. By using spectral direction difference measurement and spectral pattern signature difference measurement side-by-side for detection, and constructing thresholds with robustly estimated statistical scales, and then performing anomaly judgment by logical combination, the overall judgment can identify both overall color shift and spectral pattern distortion, and distinguish between their different causes. This dual-channel judgment logic avoids confusing anomalies with multiple different physical causes into a single measurement, thus providing more granular information for quality attribution. In actual operation and maintenance, distinguishing between overall color shift and spectral pattern distortion helps to take different process adjustment measures respectively, improving the efficiency of problem localization and the targeting of repair. At the same time, the use of logical combination and robust thresholds reduces the false alarm rate caused by abnormal fluctuations of a single measurement. Attached Figure Description
[0064] Figure 1 This is a schematic diagram of the basic process of the present invention. Detailed Implementation
[0065] 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.
[0066] Example 1, refer to Figure 1 A method for detecting color difference in automotive trim parts based on image recognition, comprising:
[0067] Set up multiple narrowband imaging devices, spectrometers, and reference spots with known spectral characteristics, and acquire dark frame data and local reference region data;
[0068] Imaging response data of the reference spot was acquired under various narrowband illumination conditions, and corresponding spectral measurement data were also acquired.
[0069] Based on the imaging response data and spectral measurement data of the reference spot, a linear mapping relationship is calculated to map the imaging response to a discrete reflectance spectrum;
[0070] Imaging response data of the tested automotive trim parts were acquired under various narrowband lighting conditions, and the corresponding reflectance spectral data were calculated based on the linear mapping relationship.
[0071] The reflectance spectral data are normalized to eliminate the influence of brightness variations on the spectral morphology.
[0072] Based on the normalized reflectance spectral data, multidimensional spectral signature data characterizing spectral morphology features are calculated.
[0073] Based on spectral signature data within a local reference region, statistical baseline parameters and thresholds for detection are calculated.
[0074] The spectral signature data of the tested automotive trim is compared with the statistical benchmark parameters, and the result of the color difference anomaly is output.
[0075] The arrangement includes a multi-narrowband imaging device, a spectrometer, and a reference spot with known spectral characteristics, and the acquisition of dark frame data and local reference region data, including:
[0076] Fix the part to be inspected at the inspection station and make the optical axis of the camera perpendicular to the normal of the surface of the part to ensure that the imaging field of view covers the surface to be inspected.
[0077] Several narrowband LED illumination modules of different wavelengths are fixed in a ring around the camera, ensuring that each narrowband LED can be triggered individually and synchronized with the camera.
[0078] Several reference spots are fixed on a rigid bracket near the edge of the inspected part within the camera's field of view, so that the reference spots are geometrically coplanar with the inspected part.
[0079] Optical shielding is installed in the testing environment to block external visible light;
[0080] Several dark frames were collected for each narrowband under completely dark conditions, and the average dark current of each band was calculated.
[0081] The reflectance spectrum of each reference spot was measured and saved using a portable spectrophotometer.
[0082] Select and record a qualified local reference area on the inspected part, and collect the true reflectance spectrum of the area.
[0083] Each narrowband band is illuminated briefly in sequence, and several frames of images are acquired simultaneously. The median of the pixels in the reference spot area is taken to obtain the summary response.
[0084] The process of acquiring imaging response data of the reference spot under various narrowband illumination conditions and acquiring corresponding spectral measurement data includes:
[0085] For each reference spot, the response components after dark frame correction are calculated in each narrowband, and the responses of each band are integrated according to the reference spot to form a response data set.
[0086] At the same time, the measured discrete reflection spectra of each reference spot are sampled and organized into a spectral data set according to a unified wavelength;
[0087] The response data set and the spectral data set are used for subsequent mapping solutions.
[0088] The step of calculating a linear mapping relationship for mapping the imaging response to a discrete reflectance spectrum based on the imaging response data and spectral measurement data of the reference spot includes:
[0089] The pseudo-inverse of the constructed response data set is obtained and multiplied with the spectral data set to obtain a linear mapping matrix used to map the narrowband imaging response to a discrete reflection spectrum.
[0090] After constructing the mapping matrix, the condition number of the response matrix is calculated and its numerical stability is evaluated. If the condition number does not meet the implementation requirements, the conditionality is improved by supplementing or replacing the reference patch.
[0091] The process of acquiring imaging response data of the tested automotive trim under various narrowband illumination conditions and calculating the corresponding reflectance spectral data based on the linear mapping relationship includes:
[0092] Dark frame correction is performed on each pixel in the tested image under each narrow band, and the median is taken as the pixel response;
[0093] The pixel's multi-band response is input into the obtained linear mapping matrix to calculate the discrete reflectance estimation spectrum of the pixel.
[0094] Pixels identified as highlights are removed before spectral estimation, the highlight determination being based on a percentile threshold of pixel energy or brightness.
[0095] The normalization process for the reflectance spectral data to eliminate the influence of brightness variations on the spectral morphology includes:
[0096] For each pixel, the reflection spectrum is estimated by calculating the spectral energy and normalizing it based on the spectral energy. The normalized spectrum is then used for subsequent morphological feature calculations.
[0097] Highlight pixels are removed before normalization.
[0098] The calculation of multidimensional spectral signature data characterizing spectral morphology based on normalized reflectance spectral data includes:
[0099] The spectral centroid and spectral width of the normalized spectrum are calculated as low-order morphological quantities.
[0100] The first-order and second-order difference energies of the calculated spectrum are used as higher-order morphological quantities.
[0101] The spectral centroid, spectral width, first-order difference energy, and second-order difference energy are combined in a fixed order to form a four-dimensional spectral signature.
[0102] The calculation of statistical benchmark parameters and thresholds for detection based on spectral signature data within a local reference region includes:
[0103] Within the local reference region, the median of the components of the estimated reflection spectrum and the spectral signature are calculated respectively, and used as the median of the components of the reference spectrum and the reference signature.
[0104] The median absolute deviation of each component of the reference signature is calculated as a robust metric.
[0105] For each pixel: calculate its spectral angular distance from the reference spectrum. When calculating, the ratio of the inner product to the norm is truncated to a defined effective range before calculating the inverse cosine.
[0106] Divide the difference between the signature components by the corresponding median absolute deviation and calculate their Euclidean norm to obtain the standardized distance of the signature.
[0107] Based on the spectral angular distance and signature normalization distance within the reference region, a robust statistical method is used to convert the median absolute deviation into the corresponding standard deviation estimate for threshold construction.
[0108] The spectral signature data of the automotive trim component under test is compared with the statistical benchmark parameters, and the result of the color difference anomaly determination is output, including:
[0109] Thresholds are constructed for spectral angular distance and signature-standardized distance, respectively. Each threshold is composed of the median of the corresponding metric plus a significance factor multiplied by a robust standard deviation estimate of that metric.
[0110] A pixel is considered abnormal when any metric exceeds its threshold.
[0111] If the spectral angle distance exceeds its threshold and the signature normalization distance does not exceed its threshold, it is determined to be an overall color bias.
[0112] If the signature normalization distance exceeds its threshold, it is judged as spectral distortion;
[0113] If both exceed their thresholds, it is judged as a mixed anomaly. In specific environments such as online color inspection of automotive trim parts or post-assembly re-inspection, the surface of the trim parts usually has characteristics such as high gloss, multiple curved surfaces, and complex film structure. Conventional detection methods based on visible light images or simple colorimetric calculations are easily affected by factors such as changes in ambient light, specular reflection, and inconsistent camera response, resulting in unstable detection results. In particular, it is difficult to distinguish subtle color differences or spectral anomalies caused by differences in film layers and local process variations. To this end, this technical solution introduces reference response information under controlled lighting conditions and combines multi-channel imaging data to perform overall modeling and analysis of the surface reflection characteristics of the trim parts. This allows for more reliable judgment of the color consistency of the entire trim part without relying on single-point measurements. It can effectively suppress the interference caused by high gloss and brightness fluctuations, improve the consistency and repeatability of the color judgment of the entire trim part, and form a clearer identification basis for local abnormal areas, thereby improving the stability and practicality of automated detection.
[0114] Example 2: A method for detecting color difference in automotive trim parts based on image recognition, further comprising:
[0115] The arrangement includes a multi-narrowband imaging device, a spectrometer, and a reference spot with known spectral characteristics, and the acquisition of dark frame data and local reference region data, including:
[0116] The part to be inspected is clamped at the inspection station, and the camera is mounted on a stable bracket so that the optical axis of the camera is perpendicular to the normal of the surface of the part to be inspected, and the imaging field of the camera completely covers the surface of the part to be inspected. In addition, the radiometric response of the camera is linearized by photographing a standard reflector and establishing a pixel response mapping to ensure that the imaging response is approximately linear within the working range. Specifically, this can be done by photographing a standard gray card and fitting a pixel response curve, and then applying an inverse response mapping to correct the nonlinear response.
[0117] Will Narrowband LED lighting modules of different wavelengths are fixed around the camera in a ring layout, ensuring that each wavelength LED can be triggered individually and synchronously with the camera triggering; (The last part, "can be replaced," appears to be a fragment and doesn't translate directly.) And to cover the 400-700nm band to cover the visible spectrum;
[0118] Fix it on a rigid bracket within the camera's field of view, near the edge of the ornament to be inspected. A reference patch is used to ensure that the reference patch is geometrically coplanar with the inspected part; in addition, to ensure the invertibility of the subsequent constructed response matrix, it is required that... Furthermore, the spectra of the reference spots are different from each other;
[0119] Optical shielding is installed around the inspection station to block the influence of external visible light and ensure that imaging is controlled only by narrowband LEDs.
[0120] Under completely shaded conditions, each narrowband LED band was independently sampled. Frame by frame, and calculate the average dark current for each band. Among them, take ;
[0121] At the fixed location of the reference spot, a portable spectrophotometer was used to measure each reference spot. Collect reflectance spectra and save them as , forming a reference spot reflectance spectrum set ;
[0122] Select a local reference area on the part to be inspected that has passed quality inspection, and record it as... The reflectance spectrum was measured using a portable spectrophotometer and used as a local true spectrum. ;
[0123] For each narrowband band in sequence Only when the LED in this band is lit will the camera trigger synchronous data acquisition. Frame, for each reference patch Select the covered pixel region from these frames and take the median of the pixels to obtain the single-frame summary response. Among them, take By fixing multiple known spectral reference spots within the camera's field of view at the inspection station and employing individually triggerable narrowband illumination, on-site calibration and control of the imaging system and illumination conditions are achieved. This allows all subsequent pixel responses to be interpreted using the same reference system, significantly reducing the impact of external scattered light and light source chromatographic drift on the inspection results. In practical application environments such as production lines or sampling stations, decorative parts may exhibit multi-curved surfaces and high gloss characteristics. Traditional white light imaging struggles to distinguish between observational differences caused by illumination variations and actual material differences. However, by maintaining the continuous presence of on-site reference spots and sequential narrowband acquisition, the baseline of the actual imaging response can be obtained for each inspection, providing stable reference conditions. Furthermore, this calibration method allows for real-time estimation and elimination of the camera's dark current and fundamental noise, thereby improving the signal-to-noise ratio and reducing the probability of misjudgment in low-brightness areas.
[0124] The process of acquiring imaging response data of the reference spot under various narrowband illumination conditions and acquiring corresponding spectral measurement data includes:
[0125] Calculate in the first Under narrowband illumination conditions, the camera focuses on the reference spot. The response vector components removed by the dark frame: ,in, Indicates the first In the band, reference spot Median brightness of regional pixels, This represents the average dark current for each band.
[0126] Constructing the response matrix and spectral matrix: ; ;
[0127] Each column: ; ;
[0128] in: : Number of narrowband LED lighting modules; The preset number of discretization frequency points, for example, one point every 10nm. Corresponding to 400–700nm; Reference spot The measured reflectance spectrum is derived from the set of measured reference spot reflectance spectra. Acquisition. By acquiring the pixel-level response of the reference spot and the reflectance spectrum measured by the spectrophotometer in parallel under each narrowband illumination condition, a direct correspondence between the imaging response and the true spectrum of the object is established. This design allows the construction of the mapping relationship to be based on field-measurable data rather than offline or prior models, thereby enhancing the robustness of the model to changes in field conditions. In actual industrial scenarios, the reference spot material and the material of the inspected part may have complexities with similar chromatograms but different film layers. The synchronously acquired spectral information can ensure that the mapping can reflect the spectral characteristics of such subtle differences. In addition, this parallel acquisition method facilitates the use of robust statistics to summarize the reference response, reducing the impact of individual pixel anomalies or short-term noise on the calibration results, thereby ensuring the numerical stability and repeatability of the mapping matrix.
[0129] The step of calculating a linear mapping relationship for mapping the imaging response to a discrete reflectance spectrum based on the imaging response data and spectral measurement data of the reference spot includes:
[0130] Obtain the linear mapping matrix using the Moore–Penrose pseudoinverse: ;
[0131] in: The constructed response matrix Moore–Penrose pseudo-inverse; The constructed spectral matrix; : A linear mapping matrix that maps the imaging response to a discrete reflectance spectrum; : Number of narrowband LED lighting modules; The preset number of discretized frequency points. By using the reference response set and its corresponding reflectance spectrum set to calculate the linear mapping from the imaging response to the discrete spectrum, and after the mapping is constructed, the numerical stability is tested and the condition is evaluated. This design completes the mapping solution in the field, so that the spectral estimation has a clear physical correspondence and interpretability, avoiding the performance degradation problem commonly seen in black-box trained models when transferred to new working conditions.
[0132] The process of acquiring imaging response data of the tested automotive trim under various narrowband illumination conditions and calculating the corresponding reflectance spectral data based on the linear mapping relationship includes:
[0133] For each pixel in the acquired imaging response data Using matrices In the pixel The de-darkening response vector mapping under the band is as follows Point reflectance estimation spectrum: ;
[0134] in: : pixel exist The linear response vector of the darkened frame under each band is calculated by subtracting the average dark current of that band from the median of the pixel in that band. ; : pixel Estimated discrete reflectance spectrum; : A linear mapping matrix that maps the imaging response to a discrete reflectance spectrum; : Number of narrowband LED lighting modules; The preset number of discretized frequency points;
[0135] In this process, highlight pixels in the imaging response data are detected and identified, and then removed to avoid interference from specular reflection on spectral estimation. Highlight pixels are determined based on their pixel energy or brightness percentile; for example, pixels exceeding a certain multiple of the upper quartile of the reference area are considered highlights and removed. By inputting the response of each pixel in each narrow band into a pre-constructed linear mapping, a discrete reflectance spectrum estimate of the entire component is obtained. Simultaneously, highlight pixel identification and removal before estimation allows for near-point-scale spectral information distribution at the area array level. On surfaces where highlights and specular reflections are prevalent, highlight removal avoids the malicious distortion of spectral estimation by specular components, ensuring that subsequent spectral shape analysis is based on physical reflectance components rather than observations mixed with specular components. Compared to single-point detection, whole-component pixel-level spectral estimation can identify the spatial distribution characteristics of local anomalies, facilitating the location of uneven film layers or local contamination and outputting the results to the production line for process correction. Furthermore, the parallel nature of pixel-level estimation supports real-time or near-real-time processing, suitable for the time constraints of online production line inspection.
[0136] The normalization process for the reflectance spectral data to eliminate the influence of brightness variations on the spectral morphology includes:
[0137] Estimated spectrum Energy normalization is performed on each pixel to eliminate brightness differences: ; ;
[0138] in: : pixel Estimated discrete reflectivity spectrum Each item in; : Normalized spectral vector; The energy of the pixel spectrum is used. Energy normalization of the estimated pixel spectrum eliminates brightness scale differences. This method is a key operation to separate brightness-related factors from spectral shape information. It allows subsequent comparison of spectral shape features to focus on the morphological differences of the spectrum itself, regardless of the overall illumination intensity or local geometric shadows. This is crucial for distinguishing between color shifts caused by overall changes in dye content and spectral distortions caused by film thickness or local contamination. In production inspection scenarios, the brightness of the surface of the part can fluctuate significantly due to different workstation positioning, surface curvature, or local treatment. Energy normalization can ensure that the detection index maintains its discrimination sensitivity under these changing conditions, thereby reducing system false alarms and false negatives caused by brightness fluctuations.
[0139] The calculation of multidimensional spectral signature data characterizing spectral morphology based on normalized reflectance spectral data includes:
[0140] Calculate the centroid and width of the spectral shape as low-order shape quantities: ; ;
[0141] in: Based on the preset number of discretized frequency points The discrete wavelength points are divided; : Normalized spectral vector Each item in the list; : The spectral centroid reflecting the overall color shift; : Spectral width, which reflects the broadening or narrowing of the spectral shape;
[0142] The normalized first-order and second-order difference energies of the calculated spectrum are amplified to amplify local spectral abrupt changes, thereby detecting film differences or contaminants. ; ;
[0143] in: First-order difference energy; Second-order difference energy;
[0144] Combine the spectral barycenter, width, and first and second order difference energies: ;
[0145] in: Material consistency spectral signature vector. By combining the spectral centroid, spectral width, and first- and second-order differential energies into a multi-dimensional spectral signature, the signature contains both low-order overall color shift information and high-order local spectral abrupt change information, forming the ability to distinguish differences caused by different factors. The spectral centroid and spectral width measures are directly sensitive to overall color shift and spectral broadening, while the differential energy is particularly sensitive to spectral anomalies in the form of peaks or depressions. The combination of the two can significantly improve the detection capability of complex phenomena such as film non-uniformity, varnish treatment differences, and film contamination. In addition, the signature design uses a normalized spectrum as input, which naturally has brightness invariance, making it easy to maintain discrimination consistency under multiple operating conditions.
[0146] The calculation of statistical benchmark parameters and thresholds for detection based on spectral signature data within a local reference region includes:
[0147] Let the set of pixels in the reference region be Calculate the median spectrum of the reference spectrum and the median of the signature: ; ;
[0148] in: : pixel Estimated discrete reflectance spectrum; Material consistency spectrum signature vector; : Local reference areas on the part to be inspected that have passed quality inspection;
[0149] Define spectral angular distance Used to measure angular differences in spectral directions: ; ; ;
[0150] Calculate the signature vector. Median absolute deviation of the components: ;
[0151] in: Signature vector The Quantity, correspond The four components ;
[0152] Define the signature normalized distance: ;
[0153] Estimating the noise standard deviation of a single pixel SAD Noise standard deviation of SD : ; ;
[0154] in: , They represent taking The median of all spectral angular distances and signature-normalized distances; Robust estimation conversion factors are commonly used in statistics. By utilizing the median spectrum and signature median within a local reference region that has passed quality inspection, as well as robust scaling estimation based on median absolute deviation, a statistical benchmark and scaling quantity for detection are constructed, enabling the construction of adaptive thresholds under field conditions. The median and median absolute deviation, as robust statistics, are naturally resistant to interference from anomalous pixels, thus providing stable benchmark estimates even in reference regions with minor contamination or measurement noise.
[0155] The spectral signature data of the automotive trim component under test is compared with the statistical benchmark parameters, and the result of the color difference anomaly determination is output, including:
[0156] Define the detection threshold: ; ;
[0157] in: Significance factor, ranging from 4 to 8, is chosen based on the requirement for extremely low false alarm rates in on-site production testing. For example, if a false alarm rate of less than 0.001 is required, a value of 8 can be used. Choose a larger z value to ensure that the probability of false alarms caused by noise is extremely low; if it is necessary to improve sensitivity, you can... Lower; when reduced Lowering the threshold increases the detection rate but also increases false alarms; improving... Conversely;
[0158] Define the final decision logic:
[0159] Pixels Deemed abnormal ;
[0160] in: : pixel spectral angular distance; : pixel The signature-normalized distance;
[0161] If a pixel is determined to be abnormal, output the abnormality type determination:
[0162] like and The presence of an overall color deviation is determined to be due to differences in dye concentration or colorants.
[0163] If it exists The presence of spectral distortion was determined, which may be caused by differences in film thickness, varnish variations, stains, or local deposits.
[0164] like and The anomaly was identified as a mixed-type anomaly. By using spectral direction difference and spectral signature difference measures side-by-side for detection, and constructing thresholds with robustly estimated statistical scales, anomaly determination is then performed through logical combination. This allows the overall determination to identify both overall color shift and spectral distortion, and to distinguish between their different causes. This dual-channel determination logic avoids confusing anomalies with multiple different physical causes into a single measure, thus providing more granular information for quality attribution. In actual operation and maintenance, distinguishing between overall color shift and spectral distortion helps to take different process adjustment measures, improving the efficiency of problem localization and the targeted nature of repair. Simultaneously, the use of logical combination and robust thresholds reduces the false alarm rate caused by anomalous fluctuations in a single measure.
[0165] 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.
[0166] 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 in automotive trim parts based on image recognition, characterized in that, include: Set up multiple narrowband imaging devices, spectrometers, and reference spots with known spectral characteristics, and acquire dark frame data and local reference region data; Imaging response data of the reference spot was acquired under various narrowband illumination conditions, and corresponding spectral measurement data were also acquired. Based on the imaging response data and spectral measurement data of the reference spot, a linear mapping relationship is calculated to map the imaging response to a discrete reflectance spectrum; Imaging response data of the tested automotive trim parts were acquired under various narrowband lighting conditions, and the corresponding reflectance spectral data were calculated based on the linear mapping relationship. The reflectance spectral data are normalized to eliminate the influence of brightness variations on the spectral morphology. Based on the normalized reflectance spectral data, multidimensional spectral signature data characterizing spectral morphology features are calculated. Based on spectral signature data within a local reference region, statistical baseline parameters and thresholds for detection are calculated. The spectral signature data of the tested automotive trim is compared with the statistical benchmark parameters, and the result of the color difference anomaly is output.
2. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The arrangement includes a multi-narrowband imaging device, a spectrometer, and a reference spot with known spectral characteristics, and the acquisition of dark frame data and local reference region data, including: Fix the part to be inspected at the inspection station and make the optical axis of the camera perpendicular to the normal of the surface of the part to ensure that the imaging field of view covers the surface to be inspected. Several narrowband LED illumination modules of different wavelengths are fixed in a ring around the camera, ensuring that each narrowband LED can be triggered individually and synchronized with the camera. Several reference spots are fixed on a rigid bracket near the edge of the inspected part within the camera's field of view, so that the reference spots are geometrically coplanar with the inspected part. Optical shielding is installed in the testing environment to block external visible light; Several dark frames were collected for each narrowband under completely dark conditions, and the average dark current of each band was calculated. The reflectance spectrum of each reference spot was measured and saved using a portable spectrophotometer. Select and record a qualified local reference area on the inspected part, and collect the true reflectance spectrum of the area. Each narrowband band is illuminated briefly in sequence, and several frames of images are acquired simultaneously. The median of the pixels in the reference spot area is taken to obtain the summary response.
3. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The process of acquiring imaging response data of the reference spot under various narrowband illumination conditions and acquiring corresponding spectral measurement data includes: For each reference spot, the response components after dark frame correction are calculated in each narrowband, and the responses of each band are integrated according to the reference spot to form a response data set. At the same time, the measured discrete reflection spectra of each reference spot are sampled and organized into a spectral data set according to a unified wavelength; The response data set and the spectral data set are used for subsequent mapping solutions.
4. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The step of calculating a linear mapping relationship for mapping the imaging response to a discrete reflectance spectrum based on the imaging response data and spectral measurement data of the reference spot includes: The pseudo-inverse of the constructed response data set is obtained and multiplied with the spectral data set to obtain a linear mapping matrix used to map the narrowband imaging response to a discrete reflection spectrum. After constructing the mapping matrix, the condition number of the response matrix is calculated and its numerical stability is evaluated. If the condition number does not meet the implementation requirements, the conditionality is improved by supplementing or replacing the reference patch.
5. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The process of acquiring imaging response data of the tested automotive trim under various narrowband illumination conditions and calculating the corresponding reflectance spectral data based on the linear mapping relationship includes: Dark frame correction is performed on each pixel in the tested image under each narrow band, and the median is taken as the pixel response; The pixel's multi-band response is input into the obtained linear mapping matrix to calculate the discrete reflectance estimation spectrum of the pixel. Pixels identified as highlights are removed before spectral estimation, the highlight determination being based on a percentile threshold of pixel energy or brightness.
6. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The normalization process for the reflectance spectral data to eliminate the influence of brightness variations on the spectral morphology includes: For each pixel, the reflection spectrum is estimated by calculating the spectral energy and normalizing it based on the spectral energy. The normalized spectrum is then used for subsequent morphological feature calculations. Highlight pixels are removed before normalization.
7. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The calculation of multidimensional spectral signature data characterizing spectral morphology based on normalized reflectance spectral data includes: The spectral centroid and spectral width of the normalized spectrum are calculated as low-order morphological quantities. The first-order and second-order difference energies of the calculated spectrum are used as higher-order morphological quantities. The spectral centroid, spectral width, first-order difference energy, and second-order difference energy are combined in a fixed order to form a four-dimensional spectral signature.
8. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The calculation of statistical benchmark parameters and thresholds for detection based on spectral signature data within a local reference region includes: Within the local reference region, the median of the components of the estimated reflection spectrum and the spectral signature are calculated respectively, and used as the median of the components of the reference spectrum and the reference signature. The median absolute deviation of each component of the reference signature is calculated as a robust metric. For each pixel: calculate its spectral angular distance from the reference spectrum. When calculating, the ratio of the inner product to the norm is truncated to a defined effective range before calculating the inverse cosine. Divide the difference between the signature components by the corresponding median absolute deviation and calculate their Euclidean norm to obtain the standardized distance of the signature. Based on the spectral angular distance and signature normalization distance within the reference region, a robust statistical method is used to convert the median absolute deviation into the corresponding standard deviation estimate for threshold construction.
9. The method for detecting color difference in automotive trim parts based on image recognition according to claim 1, characterized in that, The spectral signature data of the automotive trim component under test is compared with the statistical benchmark parameters, and the result of the color difference anomaly determination is output, including: Thresholds are constructed for spectral angular distance and signature-standardized distance, respectively. Each threshold is composed of the median of the corresponding metric plus a significance factor multiplied by a robust standard deviation estimate of that metric. A pixel is considered abnormal when any metric exceeds its threshold. If the spectral angle distance exceeds its threshold and the signature normalization distance does not exceed its threshold, it is determined to be an overall color bias. If the signature normalization distance exceeds its threshold, it is judged as spectral distortion; If both exceed their thresholds, it is determined to be a mixed anomaly.