Spectral calibration method for hyperspectral imager based on spectral line lamp
Through the spectral calibration method of hyperspectral imager based on spectral line lamps, Gaussian fitting and least squares fitting technology are used to solve the problem of spectral drift of hyperspectral imager, and efficient and accurate spectral calibration and equipment calibration are achieved.
Patent Information
- Application Number
- CN202411913866.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-08
AI Technical Summary
Hyperspectral imagers may experience spectral drift after long-term use, resulting in errors in target recognition and object classification. The existing spectral calibration methods are complex and inefficient enough.
The spectral calibration method of hyperspectral imager based on spectral line lamp is used to obtain dark background image data under dark background conditions, light up the spectral line lamp to obtain calibration image data, use the spectral line data to perform Gaussian fitting and least squares fitting, calculate the spectral response parameters and fit coefficients, and generate calibration files for equipment calibration.
It realizes efficient and simple spectral calibration, improves calibration accuracy and equipment reliability, and is suitable for calibration of hyperspectral imagers and ultraspectral equipment.
Smart Images

Figure CN119779482A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of optical remote sensing, and in particular relates to a spectral calibration method for a hyperspectral imager based on a spectral line lamp. Background Art
[0002] Hyperspectral imaging has been rated by the European Commission as one of the “100 Major Innovative Breakthroughs for the Future”. It combines images and spectra, has the characteristics of many bands and high resolution, and can provide more detailed data than conventional imaging systems. It has been applied in many fields.
[0003] After long-term use, hyperspectral imagers may experience spectral drift due to device aging and other issues, which may lead to problems such as target recognition and object classification errors in subsequent applications. Therefore, the device needs to be spectrally calibrated regularly.
[0004] Currently, the commonly used hyperspectral imager spectral calibration equipment mainly includes: monochromator, gas absorption cell, etc. However, the monochromator equipment itself needs to be calibrated regularly, and the gas absorption cell and other systems are slightly complicated.
[0005] Therefore, it is urgent to develop a new spectral calibration method for hyperspectral imagers to overcome the technical problems existing in the current spectral calibration methods. Summary of the invention
[0006] The object of the present invention is to provide a spectral calibration method for a hyperspectral imager based on a spectral line lamp, which can quickly and efficiently perform spectral calibration for a hyperspectral imager, and has the advantages of simple operation, high economy and high reliability.
[0007] The technical solution to achieve the purpose of the present invention is:
[0008] A new hyperspectral imager spectral calibration method, the method comprising:
[0009] Step S1, obtaining dark background image data of the hyperspectral imager to be calibrated under dark background conditions;
[0010] Step S2, lighting up the spectral line lamps in sequence to obtain calibration image data;
[0011] Step S3, using the calibration image data, according to the spectral line position of the existing spectral line lamp, determine the channel number corresponding to the spectral line;
[0012] Step S4, using the spectral line data, performing Gaussian fitting on the channel data to obtain the relative spectral response curve of each channel, and calculating the spectral response parameters;
[0013] Step S5, performing least square fitting according to the spectral line wavelength and the corresponding channel number to obtain the fitting coefficient;
[0014] Step S6, writing the fitting coefficients and spectral response parameters into the calibration file according to the device calibration file format.
[0015] The step S2 is specifically as follows: selecting a spectral line lamp according to the spectral range of the hyperspectral imager, and multiple spectral line lamps can be selected for combination so that the emission spectrum of the spectral line lamp is distributed in the entire spectral range of the device; after lighting a spectral line lamp, an image is recorded once, and after replacing the spectral line lamp, the image is recorded again until all the spectral line lamps used in the spectral range are recorded.
[0016] The step S3 specifically includes: comparing the known wavelength value of the emission spectrum of the spectral line lamp, finding the channel number corresponding to each emission spectral line from the collected image data; and recording all the spectral lines of all the spectral line lamps used in the recorded calibration image and their corresponding channel numbers one by one.
[0017] The step S4 is specifically as follows: using the spectral line data, performing Gaussian fitting on the channel data to obtain the Gaussian function of the relative spectral response curve of each channel as the predicted response value; calculating the variance of the measured response value and the predicted response value, and using least squares fitting to minimize the variance of the measured response value and the predicted response value or to be less than an acceptable threshold, and calculating the coefficient of the Gaussian function; and calculating the spectral response parameters based on the fitted Gaussian function.
[0018] The spectral response parameters include the half-width of the channel spectral response; according to the fitted Gaussian function, two wavelength values corresponding to half of the spectral response peak are calculated, and the value obtained by subtracting the two wavelength values is the half-width of the channel spectral response.
[0019] In step S4, the Gaussian function formula of the spectral response curve is:
[0020]
[0021] Wherein, A represents the amplitude, b represents the central wavelength, c represents the standard deviation, x represents the wavelength, and f(x) represents the predicted response value calculated using the spectral response function.
[0022] In step S4, the variance calculation formula of the measured response value and the predicted response value is:
[0023]
[0024] Among them, m represents the number of data, x i and i They represent the i-th wavelength value and its corresponding spectral response value, and p represents the variance between the measured response value and the predicted response value.
[0025] The step S5 is specifically as follows: according to the wavelength value of the spectral line and the corresponding channel number, a fitting function of the channel number and the wavelength value is obtained to obtain a predicted wavelength value, the variance of the measured wavelength value and the predicted wavelength value is calculated, and the variance of the measured wavelength value and the predicted wavelength value is minimized or less than an acceptable threshold value by least squares fitting, and a fitting coefficient is calculated.
[0026] In step S5, the fitting function formula of the channel number and the wavelength value is:
[0027] f(t)=a n *t n +…+a2*t 2 +a1*t+a0
[0028] Where f(t) represents the predicted wavelength value, t represents the channel number, a0, a1, ..., a n represents the fitting coefficient, and n represents the order of the fitting polynomial.
[0029] In step S5, the variance calculation formula of the measured wavelength value and the predicted wavelength value is:
[0030]
[0031] Where l represents the number of spectral lines, t i and x i They represent the i-th channel and its corresponding wavelength respectively, and q represents the variance between the measured wavelength value and the predicted wavelength value.
[0032] The beneficial technical effects of the present invention are:
[0033] 1. The present invention provides a spectral calibration method for a hyperspectral imager based on a spectral line lamp, which can quickly and efficiently perform spectral calibration for a hyperspectral imager, and has the advantages of simple operation, high economy and high reliability.
[0034] 2. The fitting algorithm in the spectral calibration method of a hyperspectral imager based on a spectral line lamp provided by the present invention adopts the least square method, and the calibration accuracy is high;
[0035] 3. The spectral calibration method of a hyperspectral imager based on a spectral line lamp provided by the present invention can also be extended to be used for calibration of hyperspectral equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a flow chart of a spectral calibration method for a hyperspectral imager based on a spectral line lamp provided by the present invention. DETAILED DESCRIPTION
[0037] The present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0038] like Figure 1 As shown, the present invention provides a spectral calibration method for a hyperspectral imager based on a spectral line lamp, which specifically includes the following steps:
[0039] Step S1, obtaining dark background image data of the hyperspectral imager to be calibrated under dark background conditions
[0040] Data is collected under no-light conditions, and the dark background image data can be used to calculate the device sensor parameters to confirm the sensor performance, such as calculating the signal-to-noise ratio, gain, dark current, etc.
[0041] Step S2: Light up the spectral line lamps in sequence to obtain calibration image data
[0042] Spectral line lamps need to be selected according to the spectral range of the hyperspectral imager. Commonly used spectral line lamps include mercury lamps, mercury-argon lamps, xenon lamps, krypton lamps, neon lamps, oxygen lamps, hydrogen lamps, helium lamps, argon lamps, etc. Multiple spectral line lamps can be selected for combination so that the emission spectrum of the spectral line lamp is distributed in the entire spectral range of the equipment, thereby improving the subsequent fitting accuracy.
[0043] An image is recorded once after a line lamp is lit, and an image is recorded again after a line lamp is replaced, until all line lamps used within the spectral range are recorded.
[0044] Step S3, using the calibration image data, according to the existing spectral line position of the spectral line lamp, determine the channel number corresponding to the spectral line
[0045] Taking a xenon lamp as an example, the emission spectrum of a known xenon lamp is shown in Table 1.
[0046] Table 1 Xenon lamp emission spectrum wavelength table (nm)
[0047] 916.265 1365.706 1647.29 1809.09 979.97 1414.244 1656.023 1832.53 992.319 1473.281 1672.815 1959.94 1083.837 1541.839 1763.882 1984.638 1262.339 1605.328 1790.45
[0048] By comparing the known wavelength values of the spectrum emitted by the spectrum lamp, find the channel number corresponding to each emission spectrum line from the collected image data. For example, the 916.265nm spectrum line corresponds to the device channel number 12.
[0049] And so on, all spectral lines of all spectral line lamps used in the recorded calibration image and their corresponding channel numbers are recorded one by one.
[0050] Step S4, using the spectral line data, Gaussian fitting is performed on the channel data to obtain the relative spectral response curve of each channel, and the corresponding spectral parameters are calculated. Assuming the wavelength is x and the measured response value is y, the spectral response function can be expressed as a Gaussian function as follows:
[0051]
[0052] Wherein, A represents the amplitude, b represents the central wavelength, c represents the standard deviation, and f(x) represents the predicted response value calculated using the spectral response function.
[0053] The least squares method can be used for Gaussian fitting, and the variance between the measured response value and the predicted response value is expressed as p, which can be obtained
[0054]
[0055] Among them, m represents the number of data, x i and i They respectively represent the i-th wavelength value and its corresponding spectral response value.
[0056] The coefficient of the Gaussian function is obtained by making the value of p the minimum (or less than the acceptable threshold) through least square fitting. According to the fitted Gaussian function, the required spectral response parameters are calculated, for example, the value obtained by subtracting the two wavelength values corresponding to half of the spectral response peak is the half-height width of the spectral response of the channel.
[0057] Step S5, perform least squares fitting based on the spectral line wavelength and the corresponding channel number to obtain the fitting coefficient
[0058] According to the wavelength value of the spectrum line recorded in step S3 and the corresponding channel number, assuming that the wavelength value of a spectrum line is x and the corresponding channel number is t, the relationship between the channel number and the wavelength is fitted, and the fitting predicted wavelength is assumed to be f(t).
[0059] The relationship between the fitting prediction wavelength and the channel number can be a linear equation or a high-order nonlinear polynomial equation, which can be expressed by the formula
[0060] f(t)=a n *t n +…+a2*t 2 +a1*t+a0
[0061] Among them, a0, a1, ..., a n represents the fitting coefficient, and n represents the order of the fitting polynomial.
[0062] The variance between the measured wavelength value and the predicted wavelength value is expressed as q, which can be obtained
[0063]
[0064] Where l represents the number of spectral lines, t i and x i They represent the i-th channel and its corresponding wavelength respectively.
[0065] The value of q is minimized (or smaller than an acceptable threshold) by least square fitting. If necessary, the spectrum lines can be appropriately selected to obtain the required fitting coefficients.
[0066] Step S6, writing the parameters required for calibration, such as fitting coefficients and spectral response parameters, into the device according to the device calibration file format to complete the calibration of the device.
[0067] The present invention is described in detail above with reference to the accompanying drawings and embodiments, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of ordinary technicians in the field without departing from the purpose of the present invention. The contents not described in detail in the present invention can adopt the existing technology.
Claims
1. A new spectral calibration method for a hyperspectral imager, characterized in that: The method comprises: Step S1, obtaining dark background image data of the hyperspectral imager to be calibrated under dark background conditions; Step S2, lighting up the spectral line lamps in sequence to obtain calibration image data; Step S3, using the calibration image data, according to the spectral line position of the existing spectral line lamp, determine the channel number corresponding to the spectral line; Step S4, using the spectral line data, performing Gaussian fitting on the channel data to obtain the relative spectral response curve of each channel, and calculating the spectral response parameters; Step S5, performing least square fitting according to the spectral line wavelength and the corresponding channel number to obtain the fitting coefficient; Step S6, writing the fitting coefficients and spectral response parameters into the calibration file according to the device calibration file format.
2. A new hyperspectral imager spectral calibration method according to claim 1, characterized in that: The step S2 is specifically as follows: selecting a spectral line lamp according to the spectral range of the hyperspectral imager, and multiple spectral line lamps can be selected for combination so that the emission spectrum of the spectral line lamp is distributed in the entire spectral range of the device; after lighting a spectral line lamp, an image is recorded once, and after replacing the spectral line lamp, the image is recorded again until all the spectral line lamps used in the spectral range are recorded.
3. A new hyperspectral imager spectral calibration method according to claim 1, characterized in that: The step S3 specifically includes: comparing the known wavelength value of the emission spectrum of the spectral line lamp, finding the channel number corresponding to each emission spectral line from the collected image data; and recording all the spectral lines of all the spectral line lamps used in the recorded calibration image and their corresponding channel numbers one by one.
4. A new hyperspectral imager spectral calibration method according to claim 1, characterized in that: The step S4 is specifically as follows: using the spectral line data, performing Gaussian fitting on the channel data to obtain the Gaussian function of the relative spectral response curve of each channel as the predicted response value; calculating the variance of the measured response value and the predicted response value, and using least squares fitting to minimize the variance of the measured response value and the predicted response value or to be less than an acceptable threshold, and calculating the coefficient of the Gaussian function; and calculating the spectral response parameters based on the fitted Gaussian function.
5. A new hyperspectral imager spectral calibration method according to claim 4, characterized in that: The spectral response parameters include the half-width of the channel spectral response; according to the fitted Gaussian function, two wavelength values corresponding to half of the spectral response peak are calculated, and the value obtained by subtracting the two wavelength values is the half-width of the channel spectral response.
6. A new hyperspectral imager spectral calibration method according to claim 4, characterized in that: In step S4, the Gaussian function formula of the spectral response curve is: Wherein, A represents the amplitude, b represents the central wavelength, c represents the standard deviation, x represents the wavelength, and f(x) represents the predicted response value calculated using the spectral response function.
7. A new hyperspectral imager spectral calibration method according to claim 4, characterized in that: In step S4, the variance calculation formula of the measured response value and the predicted response value is: Among them, m represents the number of data, x i and i They represent the i-th wavelength value and its corresponding spectral response value, and p represents the variance between the measured response value and the predicted response value.
8. A new hyperspectral imager spectral calibration method according to claim 1, characterized in that: The step S5 is specifically as follows: according to the wavelength value of the spectral line and the corresponding channel number, a fitting function of the channel number and the wavelength value is obtained to obtain a predicted wavelength value, the variance of the measured wavelength value and the predicted wavelength value is calculated, and the variance of the measured wavelength value and the predicted wavelength value is minimized or less than an acceptable threshold value by least squares fitting, and a fitting coefficient is calculated.
9. A new hyperspectral imager spectral calibration method according to claim 8, characterized in that: In step S5, the fitting function formula of the channel number and the wavelength value is: f(t)=a n *t n +…+a2*t 2 +a1*t+a0 Where f(t) represents the predicted wavelength value, t represents the channel number, a0, a1, ..., a n represents the fitting coefficient, and n represents the order of the fitting polynomial.
10. A new hyperspectral imager spectral calibration method according to claim 8, characterized in that: In step S5, the variance calculation formula of the measured wavelength value and the predicted wavelength value is: Where l represents the number of spectral lines, t i and x i They represent the i-th channel and its corresponding wavelength respectively, and q represents the variance between the measured wavelength value and the predicted wavelength value.