A method and device for extrapolating reflectance of a color difference meter
By employing a dual-channel colorimeter method, the reflectance data from the colorimeter is calculated and smoothed. Combined with model screening and extrapolation calculation, the problem of instability in traditional colorimeter measurements is solved, achieving reflectance measurement with higher consistency and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AOPU TIANCHENG (WUHAN) OPTOELECTRONICS TECHNOLOGY CO LTD
- Filing Date
- 2026-01-21
- Publication Date
- 2026-04-28
AI Technical Summary
Traditional colorimeters are susceptible to the instability of light sources, optical system asymmetry, or noise in reflectance measurement, leading to unstable and unreliable measurements.
A method based on a dual-channel colorimeter is adopted. The light intensity of the inner wall of the integrating sphere and the surface of the object is collected by a spectrometer, the reflectance is calculated, and the smoothing is performed by adaptive fitting coefficients. Combined with the candidate model set and the fitting error function, the model is screened and extrapolated to calculate the tristimulus value of the color.
While maintaining the smoothness of the spectral curve, it improves the consistency of measurements and the physical rationality of data, reduces random errors caused by instrument fluctuations or environmental interference, and enhances the robustness and reliability of the colorimeter in complex measurement environments.
Smart Images

Figure CN121540285B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information technology, and in particular to a method and apparatus for extrapolating the reflectance of a colorimeter. Background Technology
[0002] Colorimeters are widely used in coatings, textiles, plastics, food packaging, and other fields, such as controlling batch color differences in textiles. However, traditional reflectance measurements are susceptible to the instability of the light source, optical system asymmetry, or noise, affecting the stability and reliability of the measurements. Summary of the Invention
[0003] The purpose of this application is to provide a color detection method and apparatus based on a dual-channel colorimeter, to solve the problem of lack of stability and reliability in colorimeter measurement. The specific technical solution is as follows:
[0004] A first aspect of this application provides a method for extrapolating the reflectance of a colorimeter, comprising:
[0005] The reference light intensity of the inner wall of the integrating sphere and the measured light intensity of the object surface are collected by a spectrometer; the ratio of the reference light intensity to the measured light intensity is calculated to obtain the reflectivity; the calculated reflectivity is collected by a window of preset size; the collected window data is smoothed by an adaptive fitting coefficient to obtain smoothed data.
[0006] Based on the collected window data and the smoothed data, the trend strength, difference magnitude and non-smoothing value are calculated, wherein the trend strength is used to characterize the overall rising or falling speed of the window, the difference magnitude is used to characterize the overall strength of the change within the window, and the non-smoothing value is used to characterize the degree of non-linearity.
[0007] Obtain a candidate model set; based on the model parameters of the candidate models in the candidate model set, create a fitting error function, wherein the fitting error function is used to characterize the degree of fit of the candidate models on the window data, and the fitting error function is created based on the trend strength, difference magnitude and non-smoothness values; select the top target number of target models with the smallest loss function values from the candidate model set;
[0008] Create constant, linear, quadratic, cubic, and logarithmic models based on the window index; calculate extrapolated values for the window data based on the created constant, linear, quadratic, cubic, and logarithmic models respectively;
[0009] The calculated extrapolated values are weighted and summed by a preset weight to obtain a fused extrapolated value, wherein the preset weight is determined according to the target model;
[0010] The corresponding constraint interval is determined based on the extrapolated value of the fusion; the preset window size is adaptively adjusted according to the determined constraint interval and the preset adjustment rule to obtain the adjusted window; the step of collecting window data of the calculated reflectance through the preset window size is returned to the adjusted window and the process continues until the preset number of iterations is reached, and the tristimulus value of the color is calculated based on the calculated reflectance.
[0011] In one possible implementation, selecting the top target models with the smallest loss function values from the candidate model set includes:
[0012] Each candidate model in the candidate model set is simplified to obtain the simplified model parameters corresponding to each candidate model;
[0013] Based on the simplified model parameters corresponding to each candidate model, a fitting loss function is created;
[0014] Based on the fitting loss function, the loss function value of each candidate model is calculated, and multiple candidate models are screened based on the calculated loss function value to obtain the top target models with the smallest loss function value.
[0015] In one possible implementation, the smoothing process of the collected window data using adaptive fitting coefficients to obtain smoothed data includes:
[0016] The collected window data items are summed to obtain the sum of the window data; the ratio of the sum of the window data to the number of window data items is calculated to obtain the mean of the window data.
[0017] Calculate the difference between adjacent window data items; sum the calculated window data differences and calculate the mean of the window data differences; calculate the average fixed cost based on the window data items and the mean of the window data, and use the calculation result as the smoothed data.
[0018] In one possible implementation, the step of creating constant models, linear models, quadratic models, cubic models, and logarithmic models based on window data and window index includes:
[0019] Based on the index of the window subscript By creating constant model, linear model, quadratic model, cubic model, and logarithmic model, we obtain:
[0020]
[0021] Among them, w iRepresents window data items; a1, a2, a3, a4, a5, b2, b3, b4, b5, c3, c4, c5, and d4 are hyperparameters.
[0022] In one possible implementation, the step of adaptively adjusting the preset window size according to the determined constraint range and preset adjustment rules to obtain the adjusted window includes:
[0023] Based on the defined constraint intervals and window data, identify whether there is an intersection;
[0024] If the intersection is not empty, the preset window size is adaptively adjusted. Specifically, the window is shrunk when the window data is greater than the maximum value of the constraint interval, and the window is expanded when the window data is less than the minimum value of the constraint interval.
[0025] A second aspect of this application provides a device for extrapolating the reflectance of a colorimeter, comprising:
[0026] The data acquisition module is used to collect the reference light intensity of the inner wall of the integrating sphere and the measured light intensity of the object surface through a spectrometer; calculate the ratio of the reference light intensity to the measured light intensity to obtain the reflectivity; collect window data of the calculated reflectivity through a preset window size; and smooth the collected window data through an adaptive fitting coefficient to obtain smoothed data.
[0027] The feature calculation module is used to calculate the trend strength, difference magnitude and non-smoothing value based on the collected window data and the smoothed data, wherein the trend strength is used to characterize the overall rising or falling speed of the window, the difference magnitude is used to characterize the overall strength of the change within the window, and the non-smoothing value is used to characterize the degree of nonlinearity.
[0028] The model selection module is used to obtain a set of candidate models; based on the model parameters of the candidate models in the set, a fitting error function is created, wherein the fitting error function is used to characterize the degree of fit of the candidate models on the window data, and the fitting error function is created based on the trend strength, difference magnitude and non-smoothness values; from the set of candidate models, the top target number of target models with the smallest loss function values are selected.
[0029] The model creation module is used to create constant models, linear models, quadratic models, cubic models, and logarithmic models based on window indexes; and to calculate extrapolated values for window data based on the created constant models, linear models, quadratic models, cubic models, and logarithmic models, respectively.
[0030] The extrapolation value fusion module is used to perform a weighted summation of multiple sets of extrapolated values calculated by means of preset weights to obtain a fused extrapolated value, wherein the preset weights are determined according to the target model;
[0031] The stimulus value acquisition module is used to determine the corresponding constraint interval based on the extrapolated value of the fusion; adaptively adjust the preset window size according to the determined constraint interval and preset adjustment rules to obtain the adjusted window; return to the step of collecting window data of the calculated reflectance through the preset window size according to the adjusted window and continue to execute until the preset number of iterations is reached, and calculate the tristimulus value of the color based on the calculated reflectance.
[0032] In one possible implementation, the model screening module is specifically used to simplify each candidate model in the candidate model set to obtain simplified model parameters corresponding to each candidate model; create a fitting loss function based on the simplified model parameters corresponding to each candidate model; calculate the loss function value of each candidate model based on the fitting loss function; and screen multiple candidate models based on the calculated loss function value to obtain the top target number of target models with the smallest loss function value.
[0033] In one possible implementation, the data acquisition module is specifically used to sum the collected window data items to obtain the sum of the window data; calculate the ratio of the sum of the window data to the number of window data items to obtain the mean of the window data; calculate the difference between adjacent window data items; sum the calculated window data differences and calculate the mean of the window data differences; calculate the average fixed cost based on the window data items and the mean of the window data, and use the calculation result as smoothed data.
[0034] In one possible implementation, the model creation module is specifically configured to base its model creation on the index of the window subscript. By creating constant model, linear model, quadratic model, cubic model, and logarithmic model, we obtain:
[0035]
[0036] Among them, w i Represents window data items; a1, a2, a3, a4, a5, b2, b3, b4, b5, c3, c4, c5, and d4 are hyperparameters.
[0037] In one possible implementation, the stimulus value acquisition module is specifically used to identify whether there is an intersection based on the determined constraint interval and window data; if the intersection is not empty, the preset window size is adaptively adjusted, wherein the window is shrunk when the window data is greater than the maximum value of the constraint interval, and the window is enlarged when the window data is less than the minimum value of the constraint interval.
[0038] Another aspect of the application embodiments also provides an electronic device, including:
[0039] Memory, used to store computer programs;
[0040] When the processor executes the program stored in the memory, it implements any of the above-mentioned methods for extrapolating the reflectance of the colorimeter.
[0041] In another aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the above-described methods for extrapolating the reflectance of a colorimeter.
[0042] In another aspect of the embodiments of this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the above-described methods for extrapolating the reflectance of a colorimeter.
[0043] Beneficial effects of the embodiments in this application:
[0044] This application provides a method and apparatus for extrapolating the reflectance of a colorimeter. The method includes: acquiring a reference light intensity from the inner wall of an integrating sphere and a measured light intensity from the surface of an object using a spectrometer; calculating the ratio of the reference light intensity to the measured light intensity to obtain the reflectance; acquiring window data of the calculated reflectance using a preset window size; smoothing the acquired window data using an adaptive fitting coefficient to obtain smoothed data; calculating trend intensity, difference amplitude, and non-smoothing value based on the acquired window data and the smoothed data, wherein the trend intensity characterizes the overall rising or falling speed of the window, the difference amplitude characterizes the overall intensity of changes within the window, and the non-smoothing value characterizes the degree of nonlinearity; obtaining a set of candidate models; and creating a fitting error function based on the model parameters of the candidate models in the set, wherein the fitting error function characterizes the degree of fit of the candidate models to the window data. The model is created based on the trend strength, difference magnitude, and non-smoothness values. From the candidate model set, the top target models with the smallest loss function values are selected. Constant, linear, quadratic, cubic, and logarithmic models are created based on the window index. Extrapolated values are calculated for the window data using each of the created constant, linear, quadratic, cubic, and logarithmic models. Multiple sets of extrapolated values are weighted and summed using preset weights to obtain a fused extrapolated value, where the preset weights are determined based on the target models. A corresponding constraint interval is determined based on the fused extrapolated value. The preset window size is adaptively adjusted according to the determined constraint interval and preset adjustment rules to obtain an adjusted window. The process continues with the step of collecting window data based on the calculated reflectance using the preset window size, until a preset number of iterations is reached. Finally, the tristimulus values of the color are calculated based on the calculated reflectance. The present application's solution allows for the calculation of reflectance by the ratio of the reference light intensity to the measured light intensity. Window data is then collected from the calculated reflectance, enabling the creation of a fitting error function based on model parameters. Multiple candidate models are then selected using this fitting error function to obtain multiple target models. The preset window size is adaptively adjusted based on these target models, and finally, the tristimulus values of the color are calculated. This approach maintains the smoothness of the spectral curve while improving measurement consistency through a local adaptive mechanism, ensuring the physical rationality of the data.
[0045] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0047] Figure 1 A flowchart illustrating a method for extrapolating the reflectance of a colorimeter provided in an embodiment of this application;
[0048] Figure 2a A schematic diagram illustrating the extrapolated values of red reflectance provided in the embodiments of this application;
[0049] Figure 2b A schematic diagram illustrating the extrapolated values of green reflectance provided in the embodiments of this application;
[0050] Figure 3 A schematic diagram of a device for extrapolating the reflectance of a colorimeter provided in an embodiment of this application;
[0051] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0052] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0053] A first aspect of this application provides a method for extrapolating the reflectance of a colorimeter, see [link to relevant documentation]. Figure 1 , Figure 1 A flowchart illustrating a method for extrapolating the reflectance of a colorimeter provided in this application embodiment includes:
[0054] Step S11: Collect the reference light intensity of the inner wall of the integrating sphere and the measured light intensity of the object surface using a spectrometer; calculate the ratio of the reference light intensity to the measured light intensity to obtain the reflectivity; collect window data of the calculated reflectivity using a preset window size; and smooth the collected window data using an adaptive fitting coefficient to obtain smoothed data.
[0055] Step S12: Based on the collected window data and the smoothed data, calculate the trend strength, difference amplitude, and non-smoothing value, wherein the trend strength is used to characterize the overall rising or falling speed of the window, the difference amplitude is used to characterize the overall strength of the change within the window, and the non-smoothing value is used to characterize the degree of nonlinearity.
[0056] Step S13: Obtain a candidate model set; create a fitting error function based on the model parameters of the candidate models in the candidate model set, wherein the fitting error function is used to characterize the degree of fit of the candidate model on the window data, and the fitting error function is created based on the trend strength, difference magnitude and non-smoothness values; select the top target number of target models with the smallest loss function values from the candidate model set;
[0057] Step S14: Create constant model, linear model, quadratic model, cubic model and logarithmic model according to the window subscript index; calculate the extrapolation value of the window data according to the created constant model, linear model, quadratic model, cubic model and logarithmic model respectively;
[0058] Step S15: The calculated extrapolated values are weighted and summed using preset weights to obtain the fused extrapolated values, wherein the preset weights are determined based on the target model;
[0059] Step S16: Determine the corresponding constraint interval based on the extrapolated value of the fusion; adaptively adjust the preset window size according to the determined constraint interval and the preset adjustment rule to obtain the adjusted window; return to the step of collecting window data of the calculated reflectance through the preset window size according to the adjusted window and continue to execute until the preset number of iterations is reached, and calculate the tristimulus value of the color based on the calculated reflectance.
[0060] Corresponding to step S11 above, the reference light intensity on the inner wall of the integrating sphere and the measured light intensity on the object surface are collected using a spectrometer. The ratio of the reference light intensity to the measured light intensity is calculated to obtain the reflectivity. The reference light intensity on the inner wall of the integrating sphere can be collected using a spectrometer. Measuring light intensity on the surface of an object The corresponding reflectance is calculated. When collecting window data of the calculated reflectance using a preset window size, the initial window size is... Specifically, the settings can be adjusted according to the actual situation. The collected window data is smoothed using adaptive fitting coefficients to obtain smoothed data, which can then be used for further smoothing.
[0061] Corresponding to step S12 above, when calculating the trend strength, difference magnitude, and non-smoothing value based on the collected window data and the smoothed data, the trend strength is used to characterize the overall rate of increase or decrease of the window, the difference magnitude is used to characterize the overall strength of the change within the window, and the non-smoothing value is used to characterize the degree of nonlinearity. Specifically, the statistical information within the window can be compressed into three "features" to guide model selection and dynamic weight allocation. In one example, trend strength represents the overall rate of increase or decrease of the window and is an important indicator for judging the degree of trend linearity.
[0062] The difference magnitude reflects the overall strength of changes within the window; more drastic changes will result in greater uncertainty and variance in the model. Here, f1 represents the trend strength. This represents the difference average.
[0063]
[0064] A smoother correlation index indicates a higher AFC (afc) and lower nonlinearity, making the model easier to fit. Here, f2 represents the difference magnitude. Let W represent the first-order difference within the window, and W represent the window data. Therefore, the "non-smoothness" is quantized using 1-afc.
[0065] Feature standardization compresses all features to the 0-1 range, allowing them to stably enter the range. Mapping model:
[0066]
[0067] in, Indicates non-smoothness, and afc represents the smoothness coefficient. Represents the mapping model, To represent different linear functions.
[0068] Corresponding to step S13 above, when obtaining a candidate model set and creating a fitting error function based on the model parameters of the candidate models in the candidate model set, the fitting error function is used to characterize the degree of fit of the candidate models on the window data; from the candidate model set, select the top target number of target models with the smallest loss function value. In one possible implementation, selecting the top target number of target models with the smallest loss function value from the candidate model set includes: simplifying each candidate model in the candidate model set to obtain simplified model parameters corresponding to each candidate model; creating a fitting loss function based on the simplified model parameters corresponding to each candidate model; calculating the loss function value of each candidate model based on the fitting loss function; and filtering multiple candidate models based on the calculated loss function value to obtain the top target number of target models with the smallest loss function value. In one example, a candidate model set can be defined for quick model filtering. Each model is simplified to , where e is each model If the number of parameters is such that the optimal parameters are:
[0069]
[0070] Calculate the fitting error for model j :
[0071]
[0072] Error measures how well a model fits the window of data. The smaller the value, the better the model matches the data. Therefore, for Sort and select The k smallest models. For selection The set of models is denoted as .
[0073] Corresponding to step S14 above, creating constant models, linear models, quadratic models, cubic models, and logarithmic models based on window data and window indexes, and calculating extrapolated values based on the created constant models, linear models, quadratic models, cubic models, and logarithmic models, the creation of constant models, linear models, quadratic models, cubic models, and logarithmic models based on the target model may include: based on the window index... By creating constant model, linear model, quadratic model, cubic model, and logarithmic model, we obtain:
[0074]
[0075] Among them, w iThe window data items are represented by a1, a2, a3, a4, a5, b2, b3, b4, b5, c3, c4, c5, and d4, which are hyperparameters. The model parameters can then be solved using nonlinear normal equations or iterative methods.
[0076] Corresponding to step S15 above, the multiple sets of extrapolated values are weighted and summed using preset weights to obtain a fused extrapolated value, which can be used to select... The weights are calculated for each optimal model, and the results of extrapolation are then combined.
[0077] Corresponding to step S16 above, when determining the corresponding constraint interval based on the extrapolated value of the fusion, a pre-defined correspondence can be established, thereby determining the constraint interval through this correspondence. Based on the determined constraint interval and the preset adjustment rule, the preset window size is adaptively adjusted. When the adjusted window is obtained, an adjustment rule can be set, and adjustments can be made according to this rule. The window is adjusted until the expansion value is calculated. The extrapolated data is then inserted into the window. In actual use, the above steps can be iterated until the preset number of iterations is reached. Specifically, the steps of collecting window data of the calculated reflectance using the preset window size can be returned to the adjusted window and continued until the preset number of iterations is reached, at which point the tristimulus value of the color is calculated based on the reflectance.
[0078] As can be seen, the reflectance can be obtained by calculating the ratio of the reference light intensity to the measured light intensity using the method of this application. Then, window data is collected on the calculated reflectance, so that a fitting error function can be created according to the model parameters. Multiple candidate models are screened according to the fitting error function to obtain multiple target models. The preset window size is adaptively adjusted according to the multiple target models. Finally, the tristimulus values of the color are calculated. Thus, while maintaining the smoothness of the spectral curve, the consistency of the measurement is improved through a local adaptive mechanism, ensuring the physical rationality of the data.
[0079] In one possible implementation, smoothing the acquired window data using adaptive fitting coefficients to obtain smoothed data includes: summing the acquired window data items to obtain the sum of the window data; calculating the ratio of the sum of the window data to the number of window data items to obtain the mean of the window data; calculating the difference between adjacent window data items; summing the calculated window data differences and calculating the mean of the window data differences; calculating the average fixed cost based on the window data items and the mean of the window data, and using the calculation result as the smoothed data. Specifically, the step of acquiring the reference light intensity of the inner wall of the integrating sphere and the measured light intensity of the object surface using a spectrometer; calculating the ratio of the reference light intensity to the measured light intensity to obtain the reflectivity; acquiring window data of the calculated reflectivity using a preset window size; and smoothing the acquired window data using adaptive fitting coefficients to obtain smoothed data includes: acquiring the reference light intensity of the inner wall of the integrating sphere using a spectrometer. Measuring light intensity on the surface of an object ;
[0080] Through the formula: The reflectivity is obtained by calculating the ratio of the reference light intensity to the measured light intensity.
[0081] The calculated reflectivity is collected by pre-setting the window size;
[0082] The collected window data is processed using the following formula:
[0083]
[0084]
[0085] The adaptive fitting coefficients are then smoothed to obtain smoothed data, where W represents the number of data points in the window. This represents the average value of the window data. Represents the sum of window data. These represent different window data items, and afc represents the smoothing coefficient. In one example, a spectrometer can be used to collect the reference light intensity from the inner wall of the integrating sphere. Measuring light intensity on the surface of an object The corresponding reflectivity is calculated. The leftmost index is... The initial value is The initial window size is Therefore, the data in the window is:
[0086]
[0087] Sum of window elements It is used to construct the mean and also for normal equations:
[0088]
[0089] Window mean It is a fundamental indicator of window strength and provides a benchmark for subsequent autocorrelation coefficients. It will be used for AFC and feature construction:
[0090]
[0091] First-order difference within the window Used to estimate the average trend of change, structural features, and derivative constraint interval within the window:
[0092]
[0093] Difference Mean This indicates whether the window is rising, falling, or basically flat overall.
[0094]
[0095] The adaptive fit coefficient (AFC) measures whether the window data is stationary, continuous, and whether there is a trend. A higher AFC indicates that the sequence is more "smooth" or the trend is more obvious.
[0096]
[0097] In one possible implementation, the step of creating constant models, linear models, quadratic models, cubic models, and logarithmic models based on window data and window index includes:
[0098] Based on the index of the window subscript By creating constant model, linear model, quadratic model, cubic model, and logarithmic model, we obtain:
[0099]
[0100] Among them, w i This represents the window data items; a1, a2, a3, a4, a5, b2, b3, b4, b5, c3, c4, c5, and d4 are hyperparameters. In practical applications, the model parameters above can be solved using nonlinear normal equations or iterative methods. Simultaneously, for the selected k solved models, based on the original w and the values calculated through the model within this window... Calculate :
[0101]
[0102] Furthermore, the variance of the data within the window can be calculated. This reflects whether the window is stable and whether there is excessive noise.
[0103] .in, This represents the fitting error. This represents the variance of the data within the window.
[0104] In one possible implementation, the step of weighting and summing the multiple sets of extrapolated values using preset weights to obtain the fused extrapolated value includes:
[0105] By pre-setting weights, using the formula:
[0106]
[0107]
[0108] The weighted sum of the multiple extrapolated values is used to obtain the fused extrapolated value. ,in, For hyperparameters, Represents the weight, and In practical use, for the selected model, the extrapolated value can be... . These represent intermediate parameters in the calculation process. Represents a priori mapping, This represents the score of the unnormalized logarithm. This represents the similarity score.
[0109] In one possible implementation, the step of adaptively adjusting the preset window size according to the determined constraint interval and preset adjustment rules to obtain the adjusted window includes: identifying whether there is an intersection between the determined constraint interval and window data; if the intersection is not empty, adaptively adjusting the preset window size, wherein the window is shrunk when the window data is greater than the maximum value of the constraint interval, and the window is enlarged when the window data is less than the minimum value of the constraint interval. Specifically, the step of adaptively adjusting the preset window size according to the determined constraint interval and preset adjustment rules to obtain the adjusted window includes:
[0110] Based on the defined constraint interval:
[0111]
[0112] If the intersection is not empty, and
[0113] If the intersection is empty, adjust the window size:
[0114]
[0115]
[0116] Minimize the window:
[0117]
[0118] Then expand the window:
[0119]
[0120] In other cases, shrink the window.
[0121]
[0122] in, To reduce the lower limit of the window, To expand the window's online reach, Reduce the window step size. To expand the window step size, The window variance with extrapolated values, For the threshold, For the threshold, Representing different constraint intervals, For hyperparameters, The boundary values of the preset interval, These are intermediate parameters in the calculation process. In actual use, they can be adjusted through the window above until the extended value is calculated. Insert the extrapolated data into the window. These are intermediate parameters used in the calculation process.
[0123] In one possible implementation, the step of satisfying a preset iteration stopping condition and calculating the tristimulus values of the color includes:
[0124] When the preset iteration stopping condition is met, the tristimulus values of the color are calculated.
[0125]
[0126] in, The step size is the wavelength. This represents the spectral power distribution of the illuminator. , This is a CIE standard color matching function. The normalization coefficient is... In one example, the reflectance data can be continuously extrapolated using the method described in the above embodiment until a termination condition is met. In practical applications, this extrapolation can be extended to 380nm. Specifically, reflectance data from 380nm to 780nm can be obtained. .
[0127] The scheme in this application allows for the calculation and normalization of the first-order difference, second-order difference, and moving variance of the original sequence; it also constructs a feature vector for each window and applies prior knowledge to the candidate prediction model using this feature vector. Mapping; fusion predictions are applied to the optimal model set using log-sum-exp and projected according to magnitude and first-order derivative constraints; if no feasible projection is found, the window is expanded / contracted until the stopping condition is met; prediction points are inserted point by point to the left in this manner. See also Figure 2a and Figure 2b The adaptive local feature-driven colorimeter reflectance extrapolation method proposed in this application can be effective in reflectance measurements requiring high repeatability and accuracy. For example, when performing multiple measurements on the same standard white board or sample, this method, through dynamic window adjustment and multi-model fusion, can significantly reduce random errors caused by instrument fluctuations or environmental interference. Traditional reflectance measurements are susceptible to light source stability, optical system asymmetry, or noise, while this method effectively preserves key color features (such as absorption peaks, inflection points, and other physical information) while maintaining the smoothness of the spectral curve. Its local adaptive mechanism improves measurement consistency, while physical constraint rules (such as amplitude range limits and first-order derivative continuity constraints) ensure the physical rationality of the data. Optimizing both in synergy is expected to enhance the robustness and reliability of the colorimeter in complex measurement environments.
[0128] A second aspect of this application provides a device for extrapolating the reflectance of a colorimeter, see [link to previous section]. Figure 3 , Figure 3 A schematic diagram of a device for extrapolating the reflectance of a colorimeter provided in this application embodiment, comprising:
[0129] The data acquisition module 301 is used to acquire the reference light intensity of the inner wall of the integrating sphere and the measured light intensity of the object surface through a spectrometer; calculate the ratio of the reference light intensity to the measured light intensity to obtain the reflectivity; acquire window data of the calculated reflectivity through a preset window size; and smooth the acquired window data through an adaptive fitting coefficient to obtain smoothed data.
[0130] The feature calculation module 302 is used to calculate the trend strength, difference amplitude and non-smoothing value based on the collected window data and the smoothed data, wherein the trend strength is used to characterize the overall rising or falling speed of the window, the difference amplitude is used to characterize the overall strength of the change inside the window, and the non-smoothing value is used to characterize the degree of nonlinearity.
[0131] The model selection module 303 is used to obtain a set of candidate models; create a fitting error function based on the model parameters of the candidate models in the set of candidate models, wherein the fitting error function is used to characterize the degree of fit of the candidate models on the window data, and the fitting error function is created based on the trend strength, difference magnitude and non-smoothness values; and select the top target number of target models with the smallest loss function values from the set of candidate models.
[0132] The model creation module 304 is used to create constant models, linear models, quadratic models, cubic models, and logarithmic models based on the window index; and to calculate extrapolated values of the window data based on the created constant models, linear models, quadratic models, cubic models, and logarithmic models respectively.
[0133] The extrapolation value fusion module 305 is used to perform a weighted summation of multiple sets of extrapolation values calculated by means of preset weights to obtain a fused extrapolation value, wherein the preset weights are determined according to the target model;
[0134] The stimulus value acquisition module 306 is used to determine the corresponding constraint interval based on the extrapolated value of the fusion; adaptively adjust the preset window size according to the determined constraint interval and the preset adjustment rule to obtain the adjusted window; return to the step of collecting window data of the calculated reflectance through the preset window size according to the adjusted window and continue to execute until the preset number of iterations is reached, and calculate the tristimulus value of the color based on the calculated reflectance.
[0135] In one possible implementation, the model screening module is specifically used to simplify each candidate model in the candidate model set to obtain simplified model parameters corresponding to each candidate model; create a fitting loss function based on the simplified model parameters corresponding to each candidate model; calculate the loss function value of each candidate model based on the fitting loss function; and screen multiple candidate models based on the calculated loss function value to obtain the top target number of target models with the smallest loss function value.
[0136] In one possible implementation, the data acquisition module is specifically used to sum the collected window data items to obtain the sum of the window data; calculate the ratio of the sum of the window data to the number of window data items to obtain the mean of the window data; calculate the difference between adjacent window data items; sum the calculated window data differences and calculate the mean of the window data differences; calculate the average fixed cost based on the window data items and the mean of the window data, and use the calculation result as smoothed data.
[0137] In one possible implementation, the model creation module is specifically configured to base its model creation on the index of the window subscript. By creating constant model, linear model, quadratic model, cubic model, and logarithmic model, we obtain:
[0138]
[0139] Among them, w i Represents window data items; a1, a2, a3, a4, a5, b2, b3, b4, b5, c3, c4, c5, and d4 are hyperparameters.
[0140] In one possible implementation, the stimulus value acquisition module is specifically used to identify whether there is an intersection based on the determined constraint interval and window data; if the intersection is not empty, the preset window size is adaptively adjusted, wherein the window is shrunk when the window data is greater than the maximum value of the constraint interval, and the window is enlarged when the window data is less than the minimum value of the constraint interval.
[0141] As can be seen, the reflectance can be obtained by calculating the ratio of the reference light intensity to the measured light intensity using the device of this application. Then, window data is collected on the calculated reflectance, so that a fitting error function can be created according to the model parameters. Multiple candidate models are screened according to the fitting error function to obtain multiple target models. The preset window size is adaptively adjusted according to the multiple target models. Finally, the tristimulus values of the color are calculated. Thus, while maintaining the smoothness of the spectral curve, the consistency of the measurement is improved through a local adaptive mechanism, ensuring the physical rationality of the data.
[0142] In another aspect of the embodiments of this application, an electronic device is also provided, see [link to relevant documentation]. Figure 4 ,include:
[0143] Memory 401 is used to store computer programs;
[0144] When processor 402 executes a program stored in memory, it implements the following:
[0145] The reference light intensity of the inner wall of the integrating sphere and the measured light intensity of the object surface are collected by a spectrometer; the ratio of the reference light intensity to the measured light intensity is calculated to obtain the reflectivity; the calculated reflectivity is collected by a window of preset size; the collected window data is smoothed by an adaptive fitting coefficient to obtain smoothed data.
[0146] Based on the collected window data and the smoothed data, the trend strength, difference magnitude and non-smoothing value are calculated, wherein the trend strength is used to characterize the overall rising or falling speed of the window, the difference magnitude is used to characterize the overall strength of the change within the window, and the non-smoothing value is used to characterize the degree of non-linearity.
[0147] Obtain a candidate model set; based on the model parameters of the candidate models in the candidate model set, create a fitting error function, wherein the fitting error function is used to characterize the degree of fit of the candidate models on the window data, and the fitting error function is created based on the trend strength, difference magnitude and non-smoothness values; select the top target number of target models with the smallest loss function values from the candidate model set;
[0148] Create constant, linear, quadratic, cubic, and logarithmic models based on the window index; calculate extrapolated values for the window data based on the created constant, linear, quadratic, cubic, and logarithmic models respectively;
[0149] The calculated extrapolated values are weighted and summed by a preset weight to obtain a fused extrapolated value, wherein the preset weight is determined according to the target model;
[0150] The corresponding constraint interval is determined based on the extrapolated value of the fusion; the preset window size is adaptively adjusted according to the determined constraint interval and the preset adjustment rule to obtain the adjusted window; the step of collecting window data of the calculated reflectance through the preset window size is returned to the adjusted window and the process continues until the preset number of iterations is reached, and the tristimulus value of the color is calculated based on the calculated reflectance.
[0151] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0152] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0153] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0154] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0155] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements any of the above-described methods for extrapolating the reflectance of a colorimeter.
[0156] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to implement any of the above-described methods for extrapolating the reflectance of a colorimeter.
[0157] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state drive (SSD), etc.
[0158] 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 a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0159] The various embodiments in this specification are described in a related manner. For the same or similar parts between the various embodiments, please refer to each other. Each embodiment focuses on describing the differences from other embodiments. For related parts, please refer to the description of the method embodiment.
[0160] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for extrapolating the reflectance of a colorimeter, characterized in that, include: The reference light intensity on the inner wall of the integrating sphere and the measured light intensity on the surface of the object are collected by a spectrometer. The reflectivity is obtained by calculating the ratio of the reference light intensity to the measured light intensity. The calculated reflectivity is collected by pre-setting the window size; The collected window data is smoothed using adaptive fitting coefficients to obtain smoothed data. Based on the collected window data and the smoothed data, the trend strength, difference magnitude and non-smoothing value are calculated, wherein the trend strength is used to characterize the overall rising or falling speed of the window, the difference magnitude is used to characterize the overall strength of the change within the window, and the non-smoothing value is used to characterize the degree of non-linearity. Obtain a candidate model set; based on the model parameters of the candidate models in the candidate model set, create a fitting error function, wherein the fitting error function is used to characterize the degree of fit of the candidate models on the window data, and the fitting error function is created based on the trend strength, difference magnitude and non-smoothness values; select the top target number of target models with the smallest loss function values from the candidate model set; Create constant, linear, quadratic, cubic, and logarithmic models based on the window index; calculate extrapolated values for the window data based on the created constant, linear, quadratic, cubic, and logarithmic models respectively; The calculated extrapolated values are weighted and summed by a preset weight to obtain a fused extrapolated value, wherein the preset weight is determined according to the target model; The corresponding constraint interval is determined based on the extrapolated value of the fusion; the preset window size is adaptively adjusted according to the determined constraint interval and the preset adjustment rule to obtain the adjusted window; the step of collecting window data of the calculated reflectance through the preset window size is returned to the adjusted window and the process continues until the preset number of iterations is reached, and the tristimulus value of the color is calculated based on the calculated reflectance.
2. The method according to claim 1, characterized in that, The step of selecting the top target models with the smallest loss function values from the candidate model set includes: Each candidate model in the candidate model set is simplified to obtain the simplified model parameters corresponding to each candidate model; Based on the simplified model parameters corresponding to each candidate model, a fitting loss function is created; Based on the fitting loss function, the loss function value of each candidate model is calculated, and multiple candidate models are screened based on the calculated loss function value to obtain the top target models with the smallest loss function value.
3. The method according to claim 1, characterized in that, The process of smoothing the collected window data using adaptive fitting coefficients to obtain smoothed data includes: The collected window data items are summed to obtain the sum of the window data; the ratio of the sum of the window data to the number of window data items is calculated to obtain the mean of the window data. Calculate the difference between adjacent window data items; sum the calculated window data differences and calculate the mean of the window data differences; calculate the average fixed cost based on the window data items and the mean of the window data, and use the calculation result as the smoothed data.
4. The method according to claim 1, characterized in that, The window subscript index creates constant models, linear models, quadratic models, cubic models, and logarithmic models, including: Based on the index of the window subscript By creating constant model, linear model, quadratic model, cubic model, and logarithmic model, we obtain: Among them, w i Represents window data items; a1, a2, a3, a4, a5, b2, b3, b4, b5, c3, c4, c5, and d4 are hyperparameters.
5. The method according to claim 1, characterized in that, The step of adaptively adjusting the preset window size according to the determined constraint range and preset adjustment rules to obtain the adjusted window includes: Based on the defined constraint intervals and window data, identify whether there is an intersection; If the intersection is not empty, the preset window size is adaptively adjusted. Specifically, the window is shrunk when the window data is greater than the maximum value of the constraint interval, and the window is expanded when the window data is less than the minimum value of the constraint interval.
6. A device for extrapolating the reflectance of a colorimeter, characterized in that, include: The data acquisition module is used to collect the reference light intensity on the inner wall of the integrating sphere and the measured light intensity on the surface of the object through a spectrometer. The reflectance is obtained by calculating the ratio of the reference light intensity to the measured light intensity; the calculated reflectance is then collected using a preset window size. The collected window data is smoothed using adaptive fitting coefficients to obtain smoothed data. The feature calculation module is used to calculate the trend strength, difference magnitude and non-smoothing value based on the collected window data and the smoothed data, wherein the trend strength is used to characterize the overall rising or falling speed of the window, the difference magnitude is used to characterize the overall strength of the change within the window, and the non-smoothing value is used to characterize the degree of nonlinearity. The model selection module is used to obtain a set of candidate models; based on the model parameters of the candidate models in the set, a fitting error function is created, wherein the fitting error function is used to characterize the degree of fit of the candidate models on the window data, and the fitting error function is created based on the trend strength, difference magnitude and non-smoothness values; from the set of candidate models, the top target number of target models with the smallest loss function values are selected. The model creation module is used to create constant models, linear models, quadratic models, cubic models, and logarithmic models based on window indexes; and to calculate extrapolated values for window data based on the created constant models, linear models, quadratic models, cubic models, and logarithmic models, respectively. The extrapolation value fusion module is used to perform a weighted summation of multiple sets of extrapolated values calculated by means of preset weights to obtain a fused extrapolated value, wherein the preset weights are determined according to the target model; The stimulus value acquisition module is used to determine the corresponding constraint interval based on the extrapolated value of the fusion; adaptively adjust the preset window size according to the determined constraint interval and preset adjustment rules to obtain the adjusted window; return to the step of collecting window data of the calculated reflectance through the preset window size according to the adjusted window and continue to execute until the preset number of iterations is reached, and calculate the tristimulus value of the color based on the calculated reflectance.
7. The apparatus according to claim 6, characterized in that, The model selection module is specifically used to simplify each candidate model in the candidate model set to obtain simplified model parameters corresponding to each candidate model; create a fitting loss function based on the simplified model parameters corresponding to each candidate model; calculate the loss function value of each candidate model based on the fitting loss function; and select multiple candidate models based on the calculated loss function value to obtain the top target number of target models with the smallest loss function value.
8. The apparatus according to claim 6, characterized in that, The data acquisition module is specifically used to sum the collected window data items to obtain the sum of the window data; and to calculate the ratio of the sum of the window data to the number of window data items to obtain the mean of the window data. Calculate the difference between adjacent window data items; sum the calculated window data differences and calculate the mean of the window data differences; Calculate the average fixed cost based on the window data items and the mean of the window data, and use the calculation result as the smoothed data.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-5.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains a computer program that, when executed by a processor, implements the method described in any one of claims 1-5.
Citation Information
Patent Citations
Soil physical and chemical parameter inversion method based on multi-task deep convolutional neural network
CN118569069A
Energy storage lithium battery charging electric quantity estimation system and method
CN121254108A