Spectral data processing method and device, electronic equipment and storage medium

By calculating the spectral interpolation of the spectrometer and utilizing the spectral change rate and preset adjustment coefficients, the problem of limited spectrometer resolution was solved, achieving higher resolution and real-time interpolation calculation.

CN121009255APending Publication Date: 2025-11-25CHONGQING CHUANYI AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510996253.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing spectrometers have limitations in technical specifications such as resolution due to the limited number of pixels in the array detector, and the data fitting methods are computationally complex and not easy to perform in real time.

Method used

By acquiring the initial spectral data of the spectrometer, the target spectral values ​​of multiple detector pixels are determined, and spectral interpolation is calculated based on the spectral change rate of adjacent detector pixels. Combined with preset adjustment coefficients and change trends, the interpolation is adjusted to improve resolution.

Benefits of technology

It improves spectral resolution, reduces the difficulty of interpolation calculation, and enhances the real-time performance of interpolation calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009255A_ABST
    Figure CN121009255A_ABST
Patent Text Reader

Abstract

The invention provides a spectral data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining the initial spectral data of a spectrometer, determining the target spectral values of a plurality of detection pixels according to the initial spectral data, determining the spectral change rate between a plurality of adjacent detection pixels according to each target spectral value, and determining the spectral change rate of the detection pixels according to the spectral change rate. The spectral interpolation of each to-be-interpolated position is determined based on two target spectral values corresponding to each adjacent detection pixel and a plurality of spectral change rates corresponding to each target pixel, the to-be-interpolated position is used for representing the position between the adjacent detection pixels, and the target pixels comprise a plurality of detection pixels corresponding to the to-be-interpolated position before and after; combining the spectral interpolation of each to-be-interpolated position with the target spectral value of the corresponding adjacent detection pixel to obtain target spectral data; according to the method, the spectral resolution is improved, the difficulty of interpolation calculation is reduced, and the real-time performance of the interpolation calculation is also improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of spectrometer technology, and in particular to a spectrum data processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the design process of a spectrometer, the number of array detector pixels is limited, which restricts the technical indicators of the spectrometer, such as resolution. For example, when designing a near-infrared spectrometer, the maximum number of array detector pixels that can be purchased is 512.

[0003] In order to improve the technical indicators such as resolution of the spectrometer under the same hardware conditions, the resolution and other technical indicators are usually improved by data fitting, such as the least squares method. However, data fitting requires data calibration in advance, and the calculation method is complex and not easy to perform real-time calculation. SUMMARY

[0004] The present application provides a spectrum data processing method, device, electronic equipment and storage medium to solve the technical problem of improving the technical indicators of the spectrometer.

[0005] The present application provides a spectrum data processing method, which comprises: obtaining initial spectrum data of a spectrometer, and determining target spectrum values of a plurality of detection pixels according to the initial spectrum data; determining a spectrum change rate between a plurality of adjacent detection pixels according to each target spectrum value; determining a spectrum interpolation value of each interpolation position based on two target spectrum values corresponding to each adjacent detection pixel and a plurality of spectrum change rates corresponding to each target pixel, the interpolation position being used to represent a position between the adjacent detection pixels, and the target pixel comprising a plurality of detection pixels corresponding to positions before and after the interpolation position; and combining the spectrum interpolation value of each interpolation position with the target spectrum value of the corresponding adjacent detection pixel to obtain target spectrum data.

[0006] In an embodiment of the present application, determining a spectrum interpolation value of an interpolation position based on two target spectrum values corresponding to adjacent detection pixels and a plurality of spectrum change rates corresponding to a target pixel comprises: determining an initial interpolation value according to a target spectrum value of a current pixel and a target spectrum value of a next pixel; determining a target adjustment value based on the existence state of the plurality of spectrum change rates corresponding to the target pixel and the change trend of each spectrum change rate; and adjusting the initial interpolation value according to the target adjustment value to obtain the spectrum interpolation value of the interpolation position; wherein the current pixel is used to represent a first detection pixel in the adjacent detection pixels, and the next pixel is used to represent a second detection pixel in the adjacent detection pixels.

[0007] In an embodiment of the present application, the target adjustment value is determined based on the existence of the spectral variation rates corresponding to the target pixel and the variation trend of each of the spectral variation rates, including: if the first variation rate exists, determining a first parameter value based on a preset first adjustment coefficient, the second variation rate and the first variation rate; if the first variation rate does not exist, determining the first parameter value based on the preset first adjustment coefficient and the second variation rate; if the third variation rate exists, determining a second parameter value according to a preset second adjustment coefficient, the second variation rate and the third variation rate; if the third variation rate does not exist, determining the second parameter value according to the preset second adjustment coefficient and the second variation rate; and determining the target adjustment value according to the first parameter value, the second parameter value and the variation trend of each of the spectral variation rates; wherein the first variation rate represents the spectral variation rate between the current pixel and a previous pixel before the current pixel, the second variation rate represents the spectral variation rate between the current pixel and a next pixel, and the third variation rate represents the spectral variation rate between the next pixel and a second next pixel after the next pixel.

[0008] In an embodiment of the present application, the target adjustment value is determined according to the first parameter value, the second parameter value and the variation trend of each of the spectral variation rates, including: if the first variation rate is negative, determining the opposite of the first parameter value as a first adjustment value; if the first variation rate is positive or zero, determining the first parameter value as the first adjustment value; if the third variation rate is negative, determining the second parameter value as a second adjustment value; if the third variation rate is positive or zero, determining the opposite of the first parameter value as the second adjustment value; and determining the target adjustment value according to the first adjustment value and the second adjustment value.

[0009] In an embodiment of the present application, the determination of the first parameter value and the second parameter value includes: determining the first parameter value according to the difference between a first variation value and a second variation value and the preset first adjustment coefficient;

[0010] determining the second parameter value according to the difference between a third variation value and the second variation value and the preset second adjustment coefficient;

[0011] wherein the first variation value is the first variation rate or the absolute value of the first variation rate, the second variation value is the second variation rate or the absolute value of the second variation rate, and the third variation value is the third variation rate or the absolute value of the third variation rate.

[0012] In an embodiment of the present application, the initial interpolation value is determined according to the target spectrum value of the current pixel and the target spectrum value of the next pixel, including: determining the sum of the target spectrum value of the current pixel and the target spectrum value of the next pixel as an initial parameter value; and determining the average of the initial parameter value as the initial interpolation value.

[0013] In an embodiment of the present application, the target spectrum values of the plurality of detection pixels are determined according to the initial spectrum data, including: if the initial spectrum data is one-time acquisition data, determining the initial spectrum values of the plurality of detection pixels in the initial spectrum data as the target spectrum values of the plurality of detection pixels; and if the initial spectrum data is multi-time acquisition data, performing smoothing processing on the plurality of initial spectrum values of each detection pixel in the initial spectrum data to obtain the target spectrum value of each detection pixel.

[0014] The present application provides a spectrum data processing device, including: a data acquisition module, configured to acquire initial spectrum data of a spectrum instrument, and determine target spectrum values of a plurality of detection pixels according to the initial spectrum data; a rate of change determination module, configured to determine a spectrum rate of change between a plurality of adjacent detection pixels according to the target spectrum values; a spectrum interpolation module, configured to determine a spectrum interpolation value of each interpolation position based on two target spectrum values corresponding to each adjacent detection pixel, and a plurality of spectrum rates of change corresponding to each target pixel, the interpolation position being used to represent a position between the adjacent detection pixels, and the target pixel including a plurality of detection pixels corresponding to positions before and after the interpolation position; and an interpolation combination module, configured to combine the spectrum interpolation value of each interpolation position with the target spectrum value of the corresponding adjacent detection pixel to obtain target spectrum data.

[0015] The present application provides an electronic device, including: one or more processors; a storage device, configured to store one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the spectrum data processing method according to any one of the above embodiments.

[0016] The present application also provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor of a computer, causes the computer to perform the spectrum data processing method according to any one of the above embodiments.

[0017] The present application provides a spectrum data processing method, device, electronic device and storage medium, which determines the spectrum interpolation value of the interpolation position according to the spectrum rates of change of a plurality of detection pixels before and after the interpolation position, and two target spectrum values corresponding to the adjacent detection pixels, thereby improving the spectrum resolution, reducing the difficulty of interpolation calculation, and improving the real-time performance of interpolation calculation. BRIEF DESCRIPTION OF DRAWINGS

[0018] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate embodiments consistent with the application and, together with the description, further serve to explain the principles of the application. It is to be expressly understood that the drawings are only exemplary and are provided to further facilitate an understanding of the application. In the drawings, the same reference number typically represents the same component or element throughout multiple

[0019] In the drawings:

[0020] Figure 1 A schematic diagram of an exemplary system architecture provided in an embodiment of the application;

[0021] Figure 2 A flowchart of a method of processing spectral data provided in an embodiment of the application;

[0022] FIG. 3(a) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0023] FIG. 3(b) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0024] FIG. 3(c) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0025] FIG. 3(d) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0026] FIG. 3(e) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0027] FIG. 3(f) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0028] FIG. 3(g) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0029] FIG. 3(h) is a schematic diagram of spectral interpolation provided in an embodiment of the application;

[0030] Figure 4 A block diagram of a spectral data processing apparatus provided in an embodiment of the application;

[0031] Figure 5 A structural diagram of a computer system of an electronic device provided in an embodiment of the application. DETAILED DESCRIPTION

[0032] Following make the specific concrete example explain the embodiment of the present application, the person skilled in the art can be easily understood from the disclosure of the present application other advantages and efficacy.The present application can also be implemented or applied by another different specific embodiment, the details in the present application can be based on different views and applications, in the absence of the spirit of the present application, various modifications or changes are made, in the case of no conflict, the following examples and the features in the examples can be combined with each other.

[0033] It should be noted that the drawings provided in the following examples only illustrate the basic concept of the present application in a schematic manner, and the drawings only show the components related to the present application, not the number, shape and size of the components when actually implemented, the actual implementation of each component type, number and proportion can be a random change, and the component layout type may be more complex.

[0034] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the application, however, it is obvious to those skilled in the art that the embodiments of the application can be implemented without these specific details, in other embodiments, the known structures and devices are shown in the form of block diagrams rather than in the form of details, to avoid making the embodiments of the application difficult to understand.

[0035] Please refer to Figure 1 , Figure 1 The schematic diagram of the exemplary system architecture provided by an embodiment of the present application. As Figure 1 shown, the system architecture can include a spectrometer 110 and a computer device 120. Among them, the computer device 120 can be at least one of a microcomputer, an embedded computer, a general-purpose computer, a neural network computer, etc. The spectrometer 110 transmits the initial spectral data collected to the computer device 120 for spectral interpolation to obtain target spectral data.

[0036] For example, the computer device 120 obtains the initial spectral data of the spectrometer, and determines the target spectral values of a plurality of detection pixels according to the initial spectral data; determines the spectral variation rate between a plurality of adjacent detection pixels according to each target spectral value; determines the spectral interpolation of each interpolation position based on the two target spectral values corresponding to each adjacent detection pixel and the plurality of spectral variation rates corresponding to each target pixel, the interpolation position is used to represent the position between adjacent detection pixels, and the target pixel includes a plurality of detection pixels corresponding to the front and back of the interpolation position; combine the spectral interpolation of each interpolation position with the target spectral value of the corresponding adjacent detection pixel to obtain the target spectral data.

[0037] To address the aforementioned technical problems, this application provides a spectral data processing method, apparatus, electronic device, and storage medium. The implementation details of the technical solutions in the embodiments of this application are described in detail below.

[0038] Please see Figure 2 , Figure 2 This is a flowchart illustrating a spectral data processing method provided in one embodiment of the present invention. Figure 2 As shown, in an exemplary embodiment, the spectral data processing method includes at least steps S210 to S240, which are described in detail below:

[0039] Step S210: Obtain the initial spectral data of the spectrometer, and determine the target spectral values ​​of multiple detector pixels based on the initial spectral data.

[0040] In one embodiment of the present invention, determining the target spectral value of multiple detector pixels based on initial spectral data includes: if the initial spectral data is data acquired in one session, then determining the initial spectral value of the multiple detector pixels in the initial spectral data as the target spectral value of each detector pixel; if the initial spectral data is data acquired multiple times, then smoothing the multiple initial spectral values ​​of each detector pixel in the initial spectral data to obtain the target spectral value of each detector pixel.

[0041] In one embodiment of the present invention, the spectrometer continuously acquires the initial spectral values ​​of multiple detector pixels N times, and records them as S. i (x), where x is the position of the detected pixel, x∈[1,X], X is the total number of detected pixels, and i is the number of samplings, i∈[1,N].

[0042] In one embodiment of the present invention, to reduce signal noise interference, multiple initial spectral values ​​of each detector pixel need to be smoothed. For example, the target spectral value of the detector pixel is obtained by averaging multiple initial spectral values ​​of a detector pixel, and the target spectral value is determined as follows:

[0043]

[0044] in, S represents the target spectral value of the x-th detector pixel. i (x) represents the initial spectral value of the x-th detected pixel acquired in the i-th acquisition, and N represents the number of acquisitions.

[0045] Step S220: Determine the spectral change rate between multiple adjacent detector pixels based on the spectral values ​​of each target.

[0046] In one embodiment of the present invention, the spectral change rate corresponding to the target spectral value between two adjacent detector pixels is calculated using a differential method. The spectral change rate is determined as follows:

[0047]

[0048] Where ΔS(x) is the spectral change rate of the x-th detector pixel. The target spectral value of the (x+1)th detector pixel. Let x be the target spectral value of the x-th detected pixel.

[0049] Step S230: Determine the spectral interpolation for each interpolation position based on the two target spectral values ​​corresponding to each adjacent detection pixel and the multiple spectral change rates corresponding to each target pixel.

[0050] The interpolation position is used to characterize the position between adjacent detector pixels, and the target pixel includes multiple detector pixels corresponding to the position before and after the interpolation position.

[0051] In one embodiment of the present invention, determining the spectral interpolation of the position to be interpolated based on two target spectral values ​​corresponding to adjacent detector pixels and multiple spectral change rates corresponding to the target pixels includes: determining an initial interpolation based on the target spectral value of the current pixel and the target spectral value of the next pixel; determining a target adjustment value based on the existence state of multiple spectral change rates corresponding to the target pixel and the changing trend of each spectral change rate; adjusting the initial interpolation based on the target adjustment value to obtain the spectral interpolation of the position to be interpolated; wherein, the current pixel is used to represent the previous detector pixel among adjacent detector pixels, and the next pixel is used to represent the next detector pixel among adjacent detector pixels.

[0052] In one embodiment of the present invention, determining the initial interpolation based on the target spectral value of the current pixel and the target spectral value of the next pixel includes: determining the sum of the target spectral value of the current pixel and the target spectral value of the next pixel as an initial parameter value; and determining the average value of the initial parameter value as the initial interpolation.

[0053] In one embodiment of the present invention, the target pixel includes the first two detector pixels and the last two detector pixels corresponding to the position to be interpolated.

[0054] In an embodiment of the present application, the target adjustment value is determined based on the existence of the plurality of spectral variation rates corresponding to the target pixel and the variation trend of each spectral variation rate, and includes: if the first variation rate exists, determining a first parameter value based on a preset first adjustment coefficient, the second variation rate and the first variation rate; if the first variation rate does not exist, determining the first parameter value based on the preset first adjustment coefficient and the second variation rate; if the third variation rate exists, determining a second parameter value according to a preset second adjustment coefficient, the second variation rate and the third variation rate; if the third variation rate does not exist, determining the second parameter value according to the preset second adjustment coefficient and the second variation rate; and determining the target adjustment value according to the first parameter value, the second parameter value and the variation trend of each spectral variation rate; wherein the first variation rate represents the spectral variation rate between the current pixel and the previous pixel before the current pixel, the second variation rate represents the spectral variation rate between the current pixel and the next pixel, and the third variation rate represents the spectral variation rate between the next pixel and the second next pixel after the next pixel.

[0055] In an embodiment of the present application, the target adjustment value is determined according to the first parameter value, the second parameter value and the variation trend of each spectral variation rate, and includes: if the first variation rate is negative, determining the opposite of the first parameter value as the first adjustment value; if the first variation rate is positive or zero, determining the first parameter value as the first adjustment value; if the third variation rate is negative, determining the second parameter value as the second adjustment value; if the third variation rate is positive or zero, determining the opposite of the first parameter value as the second adjustment value; and determining the target adjustment value according to the first adjustment value and the second adjustment value.

[0056] In an embodiment of the present application, the target adjustment value is determined according to the first adjustment value and the second adjustment value: the sum of the first adjustment value and the second adjustment value is determined as the target adjustment value.

[0057] In an embodiment of the present application, the determination of the first parameter value and the second parameter value includes: determining the first parameter value according to the difference between the first variation value and the second variation value and a preset first adjustment coefficient; and determining the second parameter value according to the difference between the third variation value and the second variation value and a preset second adjustment coefficient; wherein the first variation value is the first variation rate or the absolute value of the first variation rate, the second variation value is the second variation rate or the absolute value of the second variation rate, and the third variation value is the third variation rate or the absolute value of the third variation rate.

[0058] In an embodiment of the present application, the initial interpolation is adjusted according to the target adjustment value to obtain the spectral interpolation of the position to be interpolated, and includes: determining the sum of the target adjustment value and the initial interpolation as the spectral interpolation of the position to be interpolated.

[0059] In an embodiment of the present application, the target spectral value of the previous pixel is determined by ​a target spectrum value of a current pixel, a target spectrum value of a next pixel, a target spectrum value of a second next pixel, ΔS(x-1) represents a first change rate, ΔS(x) represents a second change rate, and ΔS(x+1) represents a third change rate.

[0060] In an embodiment of the present application, referring to FIG. 3(a), FIG. 3(a) is a schematic diagram of spectrum interpolation provided in an embodiment of the present application. As shown in FIG. 3(a), if the first change rate ΔS(x-1)>0, the second change rate ΔS(x)>0, and the third change rate ΔS(x+1)>0, the spectrum interpolation matches the change trend, and the spectrum interpolation is determined as follows:

[0061]

[0062] wherein, P (x,x+1) is the spectrum interpolation between the xth detection pixel and the x+1th detection pixel, is a target spectrum value of the xth detection pixel, is a target spectrum value of the x+1th detection pixel, ΔS(x-1) is a first change rate, ΔS(x) is a second change rate, a0 is a preset first adjustment coefficient, ΔS(x+1) is a third change rate, and a1 is a preset second adjustment coefficient.

[0063] In an embodiment of the present application, referring to FIG. 3(b), FIG. 3(b) is a schematic diagram of spectrum interpolation provided in an embodiment of the present application. As shown in FIG. 3(b), if the first change rate ΔS(x-1)>0, the second change rate ΔS(x)>0, and the third change rate ΔS(x+1)<0, the spectrum interpolation matches the change trend, and the spectrum interpolation is determined as follows:

[0064]

[0065] wherein, P (x,x+1) is the spectrum interpolation between the xth detection pixel and the x+1th detection pixel, is a target spectrum value of the xth detection pixel, is a target spectrum value of the x+1th detection pixel, ΔS(x-1) is a first change rate, ΔS(x) is a second change rate, a0 is a preset first adjustment coefficient, |ΔS(x+1)| is an absolute value of a third change rate, and a1 is a preset second adjustment coefficient.

[0066] In one embodiment of the present invention, please refer to Figure 3(c), which is a schematic diagram of spectral interpolation provided in one embodiment of the present invention. As shown in Figure 3(c), if the first rate of change ΔS(x-1) > 0, the second rate of change ΔS(x) < 0, and the third rate of change ΔS(x+1) < 0, the spectral interpolation matches the trend of change. The determination of the spectral interpolation is as follows:

[0067]

[0068] Among them, P (x,x+1) For the spectral interpolation between the x-th detector pixel and the (x+1)-th detector pixel, Let x be the target spectral value of the x-th detector pixel. Let be the target spectral value of the (x+1)th detected pixel, ΔS(x-1) be the first rate of change, |ΔS(x)| be the absolute value of the second rate of change, a0 be the preset first adjustment coefficient, |ΔS(x+1)| be the absolute value of the third rate of change, and a1 be the preset second adjustment coefficient.

[0069] In one embodiment of the present invention, please refer to Figure 3(d), which is a schematic diagram of spectral interpolation provided in one embodiment of the present invention. As shown in Figure 3(d), if the first rate of change ΔS(x-1) < 0, the second rate of change ΔS(x) < 0, and the third rate of change ΔS(x+1) < 0, the spectral interpolation matches the trend of change. The determination of the spectral interpolation is as follows:

[0070]

[0071] Among them, P (x,x+1) For the spectral interpolation between the x-th detector pixel and the (x+1)-th detector pixel, Let x be the target spectral value of the x-th detector pixel. Let |ΔS(x-1)| be the target spectral value of the (x+1)th detected pixel, |ΔS(x-1)| be the absolute value of the first rate of change, |ΔS(x)| be the absolute value of the second rate of change, a0 be the preset first adjustment coefficient, |ΔS(x+1)| be the absolute value of the third rate of change, and a1 be the preset second adjustment coefficient.

[0072] In one embodiment of the present invention, please refer to Figure 3(e), which is a schematic diagram of spectral interpolation provided in one embodiment of the present invention. As shown in Figure 3(e), if the first rate of change ΔS(x-1) < 0, the second rate of change ΔS(x) > 0, and the third rate of change ΔS(x+1) > 0, the spectral interpolation matches the trend of change. The determination of the spectral interpolation is as follows:

[0073]

[0074] Among them, P (x,x+1)a target spectrum value of the xth detection pixel, a target spectrum value of the xth detection pixel, a target spectrum value of the xth detection pixel, |ΔS(x-1)| is an absolute value of the first change rate, ΔS(x) is the second change rate, a0 is a preset first adjustment coefficient, ΔS(x+1) is the third change rate, and a1 is a preset second adjustment coefficient.

[0075] In an embodiment of the present application, referring to FIG. 3(f), FIG. 3(f) is a schematic diagram of the spectrum interpolation provided in an embodiment of the present application. As shown in FIG. 3(f), if the first change rate ΔS(x-1)<0, the second change rate ΔS(x)<0, and the third change rate ΔS(x+1)>0, the spectrum interpolation matches the change trend, and the spectrum interpolation is determined as follows:

[0076]

[0077] wherein P (x,x+1) a target spectrum value of the xth detection pixel, a target spectrum value of the xth detection pixel, a target spectrum value of the xth detection pixel, |ΔS(x-1)| is an absolute value of the first change rate, ΔS(x) is the second change rate, a0 is a preset first adjustment coefficient, ΔS(x+1) is the third change rate, and a1 is a preset second adjustment coefficient.

[0078] In an embodiment of the present application, referring to FIG. 3(g), FIG. 3(g) is a schematic diagram of the spectrum interpolation provided in an embodiment of the present application. As shown in FIG. 3(g), if the first change rate ΔS(x-1)<0, the second change rate ΔS(x)>0, and the third change rate ΔS(x+1)<0, the spectrum interpolation matches the change trend, and the spectrum interpolation is determined as follows:

[0079]

[0080] wherein P (x,x+1) a target spectrum value of the xth detection pixel, a target spectrum value of the xth detection pixel, a target spectrum value of the xth detection pixel, |ΔS(x-1)| is an absolute value of the first change rate, ΔS(x) is the second change rate, a0 is a preset first adjustment coefficient, |ΔS(x+1)| is an absolute value of the third change rate, and a1 is a preset second adjustment coefficient.

[0081] In an embodiment of the present application, referring to FIG. 3(h), which is a schematic diagram of the spectral interpolation provided in an embodiment of the present application. As shown in FIG. 3(h), if the first variation rate ΔS(x-1)>0, the second variation rate ΔS(x)<0, and the third variation rate ΔS(x+1)>0, the spectral interpolation matches the variation trend, then the spectral interpolation is determined as follows:

[0082]

[0083] wherein P (x,x+1) is the spectral interpolation between the xth detection pixel and the x+1th detection pixel, is the target spectral value of the xth detection pixel, is the target spectral value of the x+1th detection pixel, ΔS(x-1) is the first variation rate, |ΔS(x)| is the absolute value of the second variation rate, a0 is a preset first adjustment coefficient, ΔS(x+1) is the third variation rate, and a1 is a preset second adjustment coefficient.

[0084] In an embodiment of the present application, when the selected target spectral value cannot satisfy the sequence requirement of , i.e. between and , and between and , then the corresponding spectral variation rate is ignored. For example, does not exist, ΔS(0) does not exist, and the spectral interpolation between and is ignored; does not exist, ΔS(X) does not exist, and the spectral interpolation between and is ignored.

[0085] In step S240, the spectral interpolation of each position to be interpolated is combined with the target spectral values of the corresponding adjacent detection pixels to obtain the target spectral data.

[0086] In an embodiment of the present application, combining the spectral interpolation of each position to be interpolated with the target spectral values of the corresponding adjacent detection pixels to obtain the target spectral data includes: inserting each spectral interpolation between the target spectral values of the corresponding adjacent detection pixels to obtain the target spectral data. For example, the calculated spectral interpolations P (1,2) ,..., P (2,3) , and P (X-1,X) are combined with the target spectral values to obtain the target spectral data, i.e. , thereby completing the interpolation calculation of the spectral data.

[0087] Referring to Figure 4 , Figure 4 is a block diagram of a spectrum data processing apparatus provided in an embodiment of the present application. The apparatus can be applied to Figure 1 the implementation environment shown in the figure, and is specifically configured in the computer device 120. The apparatus can also be applied to other exemplary implementation environments, and is specifically configured in other devices, and the embodiment does not limit the implementation environment to which the apparatus is applied.

[0088] As Figure 4 shown, the spectrum data processing apparatus 400 according to an embodiment of the present application includes a data acquisition module 410, a change rate determination module 420, a spectrum interpolation module 430, and an interpolation combination module 440.

[0089] The data acquisition module 410 is configured to acquire initial spectrum data of a spectrometer, and determine target spectrum values of a plurality of detection pixels according to the initial spectrum data.

[0090] The change rate determination module 420 is configured to determine spectrum change rates between adjacent detection pixels according to the target spectrum values.

[0091] The spectrum interpolation module 430 is configured to determine spectrum interpolation of each to-be-interpolated position based on two target spectrum values corresponding to each adjacent detection pixel and a plurality of spectrum change rates corresponding to each target pixel, the to-be-interpolated position being used to represent a position between adjacent detection pixels, and the target pixel including a plurality of detection pixels corresponding to positions before and after the to-be-interpolated position.

[0092] The interpolation combination module 440 is configured to combine the spectrum interpolation of each to-be-interpolated position with the target spectrum values of the corresponding adjacent detection pixels to obtain target spectrum data.

[0093] It should be noted that the spectrum data processing apparatus provided in the above embodiment and the spectrum data processing method provided in the above embodiment belong to the same concept, and the specific manner in which each module and unit performs operations has been described in detail in the method embodiments, which will not be repeated here. The spectrum data processing apparatus provided in the above embodiment can be used in actual applications, and the above functions can be completed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to complete all or part of the functions described above, and this is not limited herein.

[0094] Embodiments of the present application also provide an electronic device, including: one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the spectrum data processing method provided in each of the above embodiments.

[0095] Referring now to the drawings Figure 5 , Figure 5 is a structural schematic diagram of a computer system of an electronic device provided in an embodiment of the present application. Figure 5 The computer system 500 of the electronic device shown is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0096] As shown in Figure 5 , the computer system 500 includes a central processing unit 501 which can perform various appropriate actions and processes according to programs stored in a read-only memory 502 or programs loaded into a random access memory 503 from a storage section 508, such as performing the method in the above-described embodiments. In the random access memory 503, various programs and data required for system operation are also stored. The central processing unit 501, the read-only memory 502, and the random access memory 503 are connected to each other through a bus 504. An input / output interface 505 is also connected to the bus 504.

[0097] The following components are connected to the input / output interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as necessary. A removable media 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 510 as necessary, so that a computer program read therefrom is installed in the storage section 508 as necessary.

[0098] In particular, according to the embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product including a computer program carried on a computer-readable medium, the computer program containing a computer program for executing the method shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 509, and / or installed from the removable media 511. When the computer program is executed by the central processing unit 501, various functions defined in the system of the present application are performed.

[0099] The computer readable medium shown in the embodiments of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, be an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable signal medium can include a data signal propagated in a baseband or as a carrier wave in a propagated data signal, in which the computer readable computer program is carried. Such a propagated data signal can take on many forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit the program for use by or in connection with an instruction execution system, apparatus or device. The computer program contained on the computer readable medium can be transmitted in any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination of the above.

[0100] The flowcharts and block diagrams in the drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code, which contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that shown in the figures. For example, two blocks noted in succession can actually be executed substantially concurrently, or they can sometimes be executed in reverse order, depending on the functionality involved. It should also be noted that each block in the flowcharts or block diagrams, and combinations of blocks in the flowcharts or block diagrams, can be implemented by dedicated hardware-based systems that perform the specified functions or operations, or they can be implemented by a combination of dedicated hardware and computer instructions.

[0101] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, and the software product can be stored in a nonvolatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a plurality of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0102] Another aspect of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor of a computer, causes the computer to perform the spectrum data processing method provided in each of the above embodiments. The computer-readable storage medium can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the electronic device.

[0103] In the above embodiments, unless otherwise specified, the common objects are described by using the ordinal numbers such as "first" and "second", which only represent different instances of the same object, and do not mean that the described objects must be in a given order, whether in time, space, sequence or any other manner.

[0104] The above embodiments only exemplarily illustrate the principles and effects of the present application, and are not used to limit the present application. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical ideas disclosed by the present application should still be covered by the claims of the present application.

Claims

1. A method of processing spectral data, characterized by, The method comprises: acquiring initial spectral data of a spectrometer, and determining target spectral values of a plurality of detection pixels according to the initial spectral data; determining spectral variation rates between a plurality of adjacent detection pixels according to the target spectral values; determining spectral interpolation of each interpolation position based on two target spectral values corresponding to each of the adjacent detection pixels and a plurality of spectral variation rates corresponding to each target pixel, the interpolation position being used to represent a position between the adjacent detection pixels, and the target pixel comprising a plurality of detection pixels corresponding to positions before and after the interpolation position; combining the spectral interpolation of each interpolation position with the target spectral values of the corresponding adjacent detection pixels to obtain target spectral data.

2. The method of processing spectral data according to claim 1, wherein, The method comprises: determining an initial interpolation according to a target spectral value of a current pixel and a target spectral value of a next pixel; determining a target adjustment value based on a presence state of the plurality of spectral variation rates corresponding to the target pixel and a variation trend of each of the spectral variation rates; adjusting the initial interpolation according to the target adjustment value to obtain the spectral interpolation of the interpolation position; wherein the current pixel is used to represent a first detection pixel in the adjacent detection pixels, and the next pixel is used to represent a second detection pixel in the adjacent detection pixels.

3. The method of processing spectral data according to claim 2, wherein, The method comprises: if a first variation rate exists, determining a first parameter value based on a preset first adjustment coefficient, a second variation rate and the first variation rate; if the first variation rate does not exist, determining the first parameter value based on the preset first adjustment coefficient and the second variation rate; if a third variation rate exists, determining a second parameter value according to a preset second adjustment coefficient, the second variation rate and the third variation rate; if the third variation rate does not exist, determining the second parameter value according to the preset second adjustment coefficient and the second variation rate; determining the target adjustment value according to the first parameter value, the second parameter value and the variation trend of each of the spectral variation rates; wherein the first variation rate is used to represent a spectral variation rate between the current pixel and a previous pixel before the current pixel, the second variation rate is used to represent a spectral variation rate between the current pixel and the next pixel, and the third variation rate is used to represent a spectral variation rate between the next pixel and a second next pixel after the next pixel.

4. The method of processing spectral data according to claim 3, wherein, The method comprises: if the first variation rate is negative, determining the opposite of the first parameter value as a first adjustment value; if the first variation rate is positive or zero, determining the first parameter value as the first adjustment value; if the third variation rate is negative, determining the second parameter value as a second adjustment value; if the third variation rate is positive or zero, determining the opposite of the first parameter value as the second adjustment value. The target adjustment value is determined according to the first adjustment value and the second adjustment value.

5. The method of processing spectral data according to claim 3, wherein, The determination of the first parameter value and the second parameter value comprises: The first parameter value is determined according to a difference between a first change value and a second change value, and a preset first adjustment coefficient; The second parameter value is determined according to a difference between a third change value and the second change value, and a preset second adjustment coefficient; The first change value is the first change rate or an absolute value of the first change rate, the second change value is the second change rate or an absolute value of the second change rate, and the third change value is the third change rate or an absolute value of the third change rate.

6. The method of processing spectral data according to claim 2, wherein, The initial interpolation is determined according to the target spectral value of the current pixel and the target spectral value of the next pixel, comprising: A sum of the target spectral value of the current pixel and the target spectral value of the next pixel is determined as an initial parameter value; An average value of the initial parameter value is determined as the initial interpolation.

7. The method of processing spectral data according to any one of claims 1 to 6, characterized in that, The target spectral values of the plurality of detection pixels are determined according to the initial spectral data, comprising: If the initial spectral data is one-time collected data, initial spectral values of the plurality of detection pixels in the initial spectral data are determined as the target spectral values of the plurality of detection pixels; If the initial spectral data is multi-time collected data, the plurality of initial spectral values of each detection pixel in the initial spectral data are smoothed to obtain the target spectral value of each detection pixel.

8. A spectral data processing apparatus, characterized by comprising: The device comprises: A data acquisition module is configured to acquire initial spectral data of a spectrometer, and determine target spectral values of a plurality of detection pixels according to the initial spectral data; A change rate determination module is configured to determine spectral change rates between a plurality of adjacent detection pixels according to the target spectral values; A spectral interpolation module is configured to determine spectral interpolations of each to-be-interpolated position based on two target spectral values corresponding to each adjacent detection pixel, and a plurality of spectral change rates corresponding to each target pixel, wherein the to-be-interpolated position is used to represent a position between the adjacent detection pixels, and the target pixel comprises a plurality of detection pixels corresponding to positions before and after the to-be-interpolated position; An interpolation combination module is configured to combine the spectral interpolation of each to-be-interpolated position with the target spectral value of the corresponding adjacent detection pixel to obtain target spectral data.

9. An electronic device, comprising: The electronic device comprises: One or more processors; A storage device is configured to store one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the spectral data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored thereon, when the computer program is executed by a processor of a computer, the computer executes the spectral data processing method according to any one of claims 1 to 7.