Monochromatic illumination hyperspectral detection method and camera system
By matching the pre-illumination band in a monochromatic illumination hyperspectral camera system, driving monochromatic LED beads in a time-division manner, and performing spectral reconstruction and characteristic parameter calculation, the problems of insufficient signal-to-noise ratio, loss of spectral details, and high false judgment rate in the existing technology are solved, and high-precision and stable multi-scene detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI YEELING TECHNOLOGY CO LTD
- Filing Date
- 2026-05-21
- Publication Date
- 2026-07-03
Smart Images

Figure CN122329490A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical fields of camera systems and spectral detection, and particularly relates to a monochromatic illumination hyperspectral detection method and a camera system. Background Art
[0002] The monochromatic illumination hyperspectral detection technology uses monochromatic LED (monochromatic light) time-sharing illumination to replace traditional grating spectroscopy, realizes hyperspectral imaging detection, and has the advantages of simple structure, low cost, and high detection efficiency. Currently, it is mainly applied to scenarios such as industrial product defect detection and material sorting, and is one of the mainstream technical solutions in the non-destructive testing field.
[0003] However, the existing technologies have many defects in practical applications: First, the illumination wavelength band adopts a fixed equal-interval distribution method, without optimizing the energy distribution in combination with the spectral characteristics of the待测物, resulting in insufficient signal-to-noise ratio in the characteristic wavelength band and energy waste in the redundant wavelength band; Second, spectral reconstruction only uses simple linear interpolation, and the discrete LED spectral gaps lead to the loss of spectral details, and the accuracy of material identification and defect detection is low; Third, the illumination and image acquisition timings are not synchronized, LED temperature drift causes spectral baseline shift, and out-of-band noise interference is significant, resulting in poor data stability; Fourth, the scene adaptability is extremely poor, and using a general feature library for matching leads to a high false positive rate, and it cannot meet the non-invasive, low-damage, and high-precision detection requirements of daily scenarios such as food, water bodies, and human surfaces.
[0004] The English abbreviations, English full names, and Chinese names involved in the present invention are as follows: LED, English full name Light Emitting Diode, Chinese name: Light Emitting Diode; FWHM, English full name Full Width at Half Maximum, Chinese name: Full Width at Half Maximum; [[ID=2"]]RGB, English full name Red Green Blue, Chinese name: Red, Green, Blue three primary colors. Summary of the Invention
[0005] The technical problems to be solved by the present invention at least include one of the following: The existing monochromatic illumination hyperspectral technology uses fixed equal-interval illumination without distributing energy in combination with the spectral characteristics of the待测物, resulting in insufficient signal-to-noise ratio in the characteristic wavelength band and energy waste in the redundant wavelength band; Most existing spectral reconstructions use simple interpolation and cannot solve the problem of detail loss caused by discrete monochromatic LED spectral gaps; The illumination and acquisition timings are not synchronized, temperature drift and out-of-band noise interference are large, affecting the detection accuracy; The scene adaptability is poor, the false positive rate of general feature library matching is high, and it cannot meet the requirements of daily non-invasive detection.
[0006] To address the aforementioned technical problems, the present invention provides the following technical solutions.
[0007] A monochromatic illumination hyperspectral camera system includes at least one monochromatic illumination unit, a main control unit, a light source driving unit, an optical imaging unit, a data acquisition unit, a data storage and transmission unit, a hyperspectral data processing unit, a display unit, and a buffer unit. The main control unit establishes bidirectional communication connections with the light source driving unit, optical imaging unit, data acquisition unit, data storage and transmission unit, hyperspectral data processing unit, display unit, and buffer unit via a control bus. The light source driving unit establishes an electrical connection with the monochromatic illumination unit via a power driving circuit. The optical imaging unit interfaces with the data acquisition unit via an optical coupling signal transmission link. The data acquisition unit connects to the buffer unit via a data link. The buffer unit connects to the data storage and transmission unit via a high-speed data link. The data storage and transmission unit and the hyperspectral data processing unit establish a bidirectional connection via a data interaction bus. The hyperspectral data processing unit and the main control unit establish a bidirectional connection via a data feedback link. The main control unit sends an illumination command to the light source driving unit according to the target scene, and the light source driving unit selects and drives the monochrome illumination unit to illuminate the target according to the illumination command; The optical imaging unit collects the light signal reflected from the illuminated target and focuses it onto the sensor target surface of the data acquisition unit; Under the synchronous triggering of the main control unit, the data acquisition unit acquires image data and transmits it to the buffer unit; Under the instructions of the main control unit, the data storage and transmission unit performs operations such as reading, storing, and transmitting image data in the buffer unit; Under the command of the main control unit, the hyperspectral data processing unit performs baseline correction, noise suppression, and uniformity normalization on the acquired data, and outputs the preprocessed data; reconstructs the spectrum, calculates the Mahalanobis distance or spectral angle between the feature vector of each pixel in the feature parameter matrix and the mean vector of the target feature in the sample library; compares the calculated Mahalanobis distance with the defect judgment threshold, and marks pixels with a Mahalanobis distance greater than the threshold as defect pixels, or compares the calculated spectral angle with the spectral matching threshold to complete spectral fingerprint recognition; subsequently, it calculates the confidence level of the detection result and outputs the detection result based on the confidence level.
[0008] In one embodiment of the present invention, the hyperspectral data processing unit performs background noise removal processing on the preview image data, extracts the contour features of the foreground object using an edge detection algorithm and selects the region of interest, and calculates the average gray value and preliminary overall reflectance coefficient of the region.
[0009] In one embodiment of the present invention, the hyperspectral data processing unit calculates the variance of gray values of each pre-illuminated band in the region of interest, constructs a set of feature bands with variances greater than a preset variance threshold, and uses the proportion of the variance of a single band to the total variance as the basic weight coefficient of the corresponding band.
[0010] In one embodiment of the present invention, the hyperspectral data processing unit retrieves... LED The temperature spectral offset coefficient table calculates the baseline offset, and the pixel grayscale value is subtracted from the baseline offset to complete the temperature-related baseline drift correction.
[0011] In one embodiment of the present invention, the hyperspectral data processing unit defines the effective spectral range based on the center wavelength and half-width of the characteristic band, performs sliding window averaging processing using the window length of 3 spectral channels, smooths random noise by mirror filling the window boundaries, and sets the gray values of pixels outside the range to zero.
[0012] In one embodiment of the present invention, the hyperspectral data processing unit performs spatial gray-level statistics on the corrected spectral image to generate a spatial distribution matrix, and divides the pixel spectral gray-level value by the corresponding value in the matrix to complete the spatial spectral uniformity normalization.
[0013] In one embodiment of the present invention, the hyperspectral data processing unit calls the standard emission spectral power distribution function and the sensor spectral response function to construct a forward optical observation model, sets an optimization objective function containing data fidelity terms and spectral smoothing constraints, iteratively updates the reflectance guess value using the gradient descent method, and outputs the reconstructed continuous reflectance spectral data when the convergence condition is met.
[0014] In one embodiment of the present invention, the hyperspectral data processing unit extracts feature parameters and generates a feature parameter matrix according to the detection scene type, retrieves the target feature library of the sample library to calculate Mahalanobis distance or spectral angle to mark defective pixels, counts the proportion of defective pixels in the total pixels, and determines that the illumination target with a proportion exceeding a preset threshold is unqualified. The final detection confidence is calculated using a dual-weight fusion method, and the detection result level is divided according to the confidence level.
[0015] The present invention also provides a monochromatic illumination hyperspectral detection method, applied to the above-mentioned monochromatic illumination hyperspectral camera system, comprising the following steps: Step 1: The main control unit reads the detection scene type, matches the pre-illumination band, calculates the weights, and sets the driving parameters; Step 2: The light source driving unit illuminates the target according to the parameters and drives the monochromatic illumination unit to illuminate the target. The optical imaging unit takes pictures or videos of the target and converts the signals. The data acquisition unit acquires hyperspectral data and temporarily stores it in the buffer unit. Step 3: The hyperspectral data processing unit performs baseline correction, noise suppression, and uniformity normalization on the acquired data, and outputs the preprocessed data; Step 4: The hyperspectral data processing unit reconstructs the spectrum, extracts features and compares them with the target feature library of the sample library, determines defects and calculates confidence level, and outputs the detection results through the display unit.
[0016] In one embodiment of the present invention, step 4 specifically includes: The hyperspectral data processing unit constructs a forward optical observation model, combines data fidelity terms and spectral smoothing constraints to complete constrained spectral reconstruction and outputs continuous reflectance spectral data; extracts feature parameters based on the detection scene type and generates a feature parameter matrix; retrieves the target feature library from the sample library to calculate the Mahalanobis distance between the feature vector and the mean vector of the target features in the sample library, and marks pixels greater than the defect judgment threshold as defect pixels; calculates the proportion of defect pixels and uses a dual-weight fusion method of defect pixel proportion and feature deviation to calculate the final detection confidence level, and classifies and outputs the detection result level based on the confidence level.
[0017] Compared with the prior art, the present invention has the following beneficial effects: This invention matches pre-illumination bands according to the detection scenario, selects feature bands based on spectral variance and allocates illumination energy, significantly improving the signal-to-noise ratio of feature bands while eliminating energy waste in redundant bands; it employs a constrained spectral reconstruction algorithm to restore continuous spectral details, overcoming the limitations of discrete spectral structures. LED Spectral gap defects enhance the accuracy of defect detection and material identification; integrated preprocessing including temperature baseline correction, noise smoothing, and spatial uniformity normalization eliminates interference from temperature drift, out-of-band noise, and uneven spatial distribution of illumination, improving the stability of detection data; customized feature extraction rules are tailored to specific detection scenarios, and dual-weighted fusion is used to calculate detection confidence, adapting to non-invasive detection in multiple scenarios and effectively reducing the false positive rate; a configurable sample library target feature library and sample library target feature mean vector comparison mechanism is adopted, supporting both Mahalanobis distance defect detection and spectral angle spectral fingerprint recognition algorithm modes, supporting not only conformity detection but also extending to specific defect detection, material identification, and other detection tasks, significantly improving the system's versatility. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the monochromatic illumination hyperspectral camera system provided by the present invention; Figure 2 This is a schematic diagram of the monochromatic illumination hyperspectral detection method provided by the present invention; Figure 3 A schematic diagram showing the comparison between monochrome illumination discrete sampling and spectral reconstruction effects provided by this invention.
[0019] The labels for each figure are as follows: 1: Main control unit; 2: Light source driving unit; 3: Optical imaging unit; 4: Data acquisition unit; 5: Data storage and transmission unit; 6: Hyperspectral data processing unit; 7: Display unit; 8: Cache unit. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0022] This invention provides a spectral reconstruction hyperspectral detection system, such as... Figure 1 As shown, the system includes at least one monochrome illumination unit, a light source driving unit 2, an optical imaging unit 3, a main control unit 1, a data acquisition unit 4, a data storage and transmission unit 5, a hyperspectral data processing unit 6, a display unit 7, and a cache unit 8.
[0023] The main control unit 1 reads the type parameters of the current detection scene from the built-in storage unit.
[0024] Schematic representation: The detection scenarios include food detection, water body detection, human body surface detection, cosmetics detection, and general item detection, etc., with each scenario corresponding to a preset selectable monochrome color. LED Band library, with selectable bands covering 400 nm Up to 1000 nm In the visible and near-infrared ranges, schematically, the full width at half maximum (FWHM) of the spectrum is less than 20. nm .
[0025] The main control unit 1 selects from the pre-stored monochrome data according to the scene type. LED All available bands in the band library are matched as pre-illumination bands, and the center wavelength, spectral half-width, and rated drive current parameters of each band are stored in a temporary register.
[0026] In a preferred embodiment of the present invention, the selectable wavelength bands for food detection include 500. nm 550 nm 600 nm 650 nm 700 nm 750 nm The selectable wavelengths for water body detection include 650. nm 700 nm 720nm 780 nm 850 nm The selectable wavelengths for cosmetic testing include 450. nm 500 nm 550 nm 600 nm 650 nm The selectable wavelengths for human body surface detection include 500. nm 550 nm 580 nm 630 nm 680 nm The selectable wavelengths for ordinary item detection include 450. nm 500 nm 550 nm 600 nm 650 nm 700 nm .
[0027] The main control unit 1 sends a full-band pre-illumination command to the light source driving unit 2, and the light source driving unit 2 drives the monochromatic illumination unit to illuminate all pre-illumination bands of the monochromatic illumination unit. LED The LEDs are lit simultaneously with a preset low duty cycle current.
[0028] Preferably, the low duty cycle current is set to 10% to 20% of the rated drive current, and the lighting duration is controlled to be between 50 milliseconds and 100 milliseconds.
[0029] The optical imaging unit 3 collects the reflected light signal of the illuminated target under the band illumination and focuses it onto the sensor target surface of the data acquisition unit 4.
[0030] Under the synchronous triggering of the main control unit 1, the data acquisition unit 4 acquires band preview image data and transmits it to the hyperspectral data processing unit 6.
[0031] Furthermore, the preview image can be acquired using a pixel merging mode to reduce resolution and increase acquisition speed.
[0032] The hyperspectral data processing unit 6 performs background noise removal on the preview image data, extracts the contour features of foreground objects in the image using an edge detection algorithm, and then selects the region of interest containing the illuminated target. It calculates the average grayscale value of all pixels within this region of interest in the preview image, reads the grayscale value of the pre-stored reference white board, calculates the preliminary overall reflectivity coefficient, and temporarily stores the result in the data storage and transmission unit 5.
[0033] In one non-limiting embodiment of the present invention, the total energy of low-power pre-illumination does not exceed 5% of the system's rated total energy, so as to avoid light damage or thermal effects on the illuminated target.
[0034] For the extracted region of interest, the hyperspectral data processing unit 6 calculates the grayscale value of each pixel in each pre-illuminated band, and further calculates the variance of the grayscale values of all pixels in the region under each band. The hyperspectral data processing unit 6 sets a preset variance threshold, compares the variance values of each band with the preset variance threshold, and filters out the bands with variance values greater than the threshold to form a feature band set.
[0035] Optionally, the preset variance threshold can be empirically calibrated based on the typical reflectance characteristics of the specific detection object, such as the freshness detection of strawberries or the uniformity detection of cosmetics.
[0036] For each band in the feature band set, the hyperspectral data processing unit 6 calculates the proportion of its variance to the total variance of the feature band set, and uses this proportion as the basic weighting coefficient for that band.
[0037] In a preferred embodiment of the present invention, the method for calibrating the preset variance threshold is as follows: select 100 groups of qualified samples of the same type, calculate the average variance value of each band, and take 30% of the average variance value as the preset variance threshold for this type of scenario. For example, in the strawberry freshness detection scenario, the pre-illumination band includes 500 nm 550 nm 600 nm 650 nm 700 nm 750 nm For the six bands, the variances of pixel grayscale values within the region of interest in each band are calculated to be 120, 85, 210, 190, 75, and 60, respectively. With a preset variance threshold of 80, 500 pixels are selected. nm 600 nm 650 nm The three bands constitute a set of characteristic bands, with a total variance of 120 + 210 + 190 = 520. The corresponding basic weighting coefficients are 120 / 520 ≈ 0.23, 210 / 520 ≈ 0.40, and 190 / 520 ≈ 0.37, respectively.
[0038] The main control unit 1 uses the time axis as the dividing benchmark and divides the total illumination duration equally according to the number of bands in the characteristic band set, assigning each characteristic band a monochromatic color. LED The LEDs are assigned independent lighting start and end times, and adjacent monochromatic lights... LED There are no time gaps or band overlaps between the illumination periods of the LED beads.
[0039] The main control unit 1, in conjunction with the preset system total energy budget limit, converts the basic weighting coefficients obtained by the hyperspectral data processing unit 6 into individual monochromatic coefficients. LEDThe target drive current value and illumination duration parameters for the LED chips. Preferably, the upper limit of the energy budget is determined by the system's power supply and heat dissipation capacity to ensure equipment safety. For example, for a band with a basic weighting coefficient of 0.5, the system can allocate 50% of the total energy budget, thereby setting the corresponding drive current to 90% of the rated value and the duration to 1.5 times the standard duration, to significantly improve the signal-to-noise ratio of that band.
[0040] Furthermore, the main control unit 1 integrates the divided lighting period, drive current, and lighting duration parameters into a lighting execution parameter set, which serves as the basic data for timing binding. In a non-limiting embodiment of the present invention, the upper limit of the system's total energy budget is monochromatic. LED Use 80% of the rated total power of the LED chips to avoid overheating the equipment.
[0041] The light source driving unit 2, according to the lighting execution parameter set of the main control unit 1, sequentially activates the corresponding characteristic band monochromatic lights in the order of the lighting periods. LED The power supply circuit for the LED beads. The light source driver unit 2 outputs stable power according to the set drive current and illumination duration, enabling monochromatic lighting. LED The LED chip outputs monochromatic light of constant intensity; when a single monochromatic light... LED When the illumination duration of the LED bead reaches the set value, the light source driving unit 2 immediately cuts off the monochromatic light. LED The power supply circuit of the LED then starts the next monochrome LED. LED The power supply process for the LED chips, up to the monochromatic color corresponding to all characteristic bands. LED The LED chips complete the illumination output. The entire illumination process has no band switching delay and no light intensity fluctuation, providing a stable monochromatic illumination environment for optical imaging.
[0042] The optical imaging unit 3 is in monochrome. LED During the illumination period, the main control unit 1 continuously receives monochromatic optical signals reflected from the surface of the illuminated target. The main control unit 1 controls the optical imaging unit 3 to converge the optical signals onto the surface of the photosensitive element through the lens group. The photosensitive element converts the received optical signals into electrical signals. The optical imaging unit 3 performs preliminary noise reduction processing on the electrical signals, eliminating interference signals caused by ambient stray light and retaining the effective spectral signals corresponding to the monochromatic illumination. The processed electrical signals are then transmitted to the data acquisition unit 4 in real time.
[0043] The data acquisition unit 4 receives a trigger signal from the main control unit 1 and acquires hyperspectral data simultaneously with the activation of the illumination. Indicatively, the data acquisition range covers 400... nm Up to 1000 nm The visible and near-infrared bands have a spectral sampling interval of 20. nm The resolution of a single frame is 1280×1024 pixels, and each pixel corresponds to 32 spectral channels.
[0044] Data acquisition unit 4 assigns a corresponding illumination band identifier to each set of hyperspectral data to distinguish the acquired data under different monochromatic illumination. Data acquisition unit 4 performs integrity verification on the acquired data, discarding invalid data with missing bands or abnormal signal strength, and only transmits valid data to data storage and transmission unit 5, which temporarily stores the valid data in a high-speed cache queue.
[0045] The hyperspectral data processing unit 6 extracts the corresponding data from each frame of cached data. LED Operating temperature value, the temperature value is determined by LED The thermistor on the module collects data in real time.
[0046] Hyperspectral data processing unit 6 retrieves pre-stored data. LED Temperature spectral shift coefficient table, obtained through temperature chamber calibration tests before equipment shipment, records the effect of each degree Celsius temperature change on the equipment. LED The grayscale change value of the center wavelength.
[0047] The hyperspectral data processing unit 6 further calculates the baseline offset of the current spectrum. Schematic, the baseline offset... ΔB =( T - T 0)· K ,in, T 0 = 25℃ K for LED Temperature spectral shift coefficient.
[0048] The hyperspectral data processing unit 6 subtracts the calculated baseline offset from the grayscale value of each pixel in the entire frame's spectrum to complete baseline drift correction, i.e. G corr = G orig - ΔB , G orig To correct the original grayscale value of the previous pixel, G corr This refers to the corrected pixel grayscale value.
[0049] After correction, the grayscale value fluctuation at the center wavelength is controlled within ±2 grayscale levels, eliminating the influence of temperature changes on the spectral data. This correction step is performed only on the center wavelength region of monochromatic illumination and does not change the effective characteristic information of the spectrum.
[0050] The hyperspectral data processing unit 6 defines the effective spectral range based on the selected characteristic band center wavelength and half-width at half-maximum parameter.
[0051] set up λ cFor the center wavelength of the characteristic band, FWHM For the full width at half maximum (FWHM) of the spectrum, λ start The starting wavelength of the effective spectral range, λ end This is the termination wavelength of the effective spectral range. λ start = λ c -( FWHM / 2), λ end = λ c +( FWHM / 2).
[0052] The hyperspectral data processing unit 6 performs sliding window averaging on the pixel spectral curves within the effective spectral range. The window length is set to three spectral channels. The arithmetic mean of all data within the window is taken, and this mean replaces each data point in the original window, thus smoothing out random noise. The window boundaries are filled with mirror images to avoid distortion caused by edge data processing. For pixel data outside the effective spectral range, the hyperspectral data processing unit 6 sets its grayscale value to zero.
[0053] After processing, the signal-to-noise ratio of the effective spectrum is improved, and the narrowband spectral characteristics of monochromatic illumination are fully preserved.
[0054] The hyperspectral data processing unit 6 performs spatial grayscale statistics on the corrected spectral image. First, it calculates the average grayscale value of each row of pixels in the image, and then calculates the average grayscale value of each column of pixels based on the row average grayscale value. Finally, it obtains a spatial distribution matrix consistent with the image pixel size, which represents the monochromatic... LED The spatial distribution of illumination intensity.
[0055] The hyperspectral data processing unit 6 divides the spectral gray value of each pixel in the image by the value at the corresponding position in the spatial distribution matrix to obtain normalized spectral data.
[0056] That is, the spectral image size is M Line × N 1 column, row index m =1,2,..., M Column index n =1,2,..., N 1. The spatial distribution matrix is M '( m , n (Same size as image) M × N 1) The corrected pixel grayscale value is G ( m , n ),G nrom ( m , n ) represents the corresponding position in the spatial distribution matrix. m , n The value of ) G nrom ( m , n )= G ( m , n ) / M '( m , n ).
[0057] After normalization, the standard deviation of pixel grayscale values in the same uniform material region is less than 1%, eliminating monochromaticity. The spatial distribution difference between the bright center and dark edges of the light spot ensures that the spectral data of the same material remains consistent in different spatial locations.
[0058] The hyperspectral data processing unit 6 reads the hyperspectral data cube generated by the data acquisition unit 4 from the data storage and transmission unit 5, and extracts the grayscale value of each pixel in the region of interest under each illumination band. It then calls upon the pre-stored monochromatic data... A forward optical observation model is constructed by combining the standard emission spectral power distribution function of the LED and the spectral response function of the sensor.
[0059] set up I ( ) for the sensor at wavelength The grayscale value at that location; E ( ) represents the monochromatic color corresponding to this wavelength. The actual emitted illuminance, in lux, is a known quantity; R ( ) is the target object at wavelength The surface reflectance at that location is a dimensionless unknown quantity; T ( The efficiency of the integrated system of optical imaging unit and sensor is a dimensionless quantity, obtained through prior calibration. N ( The noise is system noise, expressed in gray levels. It is a known quantity and can be obtained through dark current calibration.
[0060] The grayscale values of the sensor in a certain wavelength band satisfy the following relationship: I ( )= E ( )× R ( )× T ( )+ N ( ).
[0061] Define the objective function for spectral reconstruction, which includes two parts: a data fidelity term and a spectral smoothing constraint term. It is a set of characteristic bands. N for The total number of characteristic bands included. i For the first i The center wavelength of each characteristic band i The value range is 1 to N .
[0062] Data fidelity item J data The expression used to constrain the consistency between the reconstructed spectrum and the extracted observation data is: .
[0063] in I obs ( i () represents the actual wavelength collected. i grayscale value at that location wavelength i The predicted reflectance at that location.
[0064] Spectral smoothing constraint J smooth To ensure the continuity of the reflectance curve, the physical basis is that the optical properties of the surface materials of most everyday items, such as fruits and skin care products, do not change abruptly within a very narrow wavelength interval, and the reflectance curve has local continuity. This constraint is used to penalize unreasonable and severe jagged jumps in the reconstructed curve, and its expression is: .
[0065] Optimize the objective function to minimize the objective ,in, To minimize the overall objective function, α The weighting coefficients for the smoothing constraint terms are dimensionless and adjusted according to the detection scenario. In a preferred embodiment of the present invention, in a food detection scenario... α Set to 0.1, in the context of cosmetic testing. α Set it to 0.05 to balance data fitting and smoothing effects.
[0066] For each pixel within the region of interest, set a set of initial reflectance guesses, such as a flat spectral curve, denoted as... R0 ( i ), where 0 represents k =0, which represents the initial iteration number. Substituting this guessed value into the constructed forward optical observation model, the wavelength is calculated. i Predicted grayscale value at the location I pred ( i )= E ( i )× R 0 ( i ()( i )× T ( i )+ N ( i ).
[0067] Calculate the residual vector between the predicted grayscale value and the actual acquired grayscale value. ,in k This represents the current iteration number.
[0068] The hyperspectral data processing unit, in conjunction with the set optimization objective function, uses the gradient descent method to calculate the correction direction and step size for the current reflectance guess value. For the... k In the next iteration, the correction to reflectivity is determined by the gradient of the objective function, which is calculated using the following formula: .
[0069] in j For the current band index, adjacent indices of boundary bands are processed using a mirror-fill method to avoid distortion caused by edge data processing.
[0070] Update the estimated reflectance value based on the calculated correction direction and step size: ,in Let be the iteration step size, a dimensionless positive number. In a preferred embodiment of the present invention, Set to 0.01, and adjust using line search to ensure that the objective function monotonically decreases in each iteration.
[0071] Then, it is determined whether the updated reflectance value satisfies the convergence condition of the optimization objective function. The convergence condition is the L2 norm of the residual vector || r k ||2<0.01 and the number of iterations k≤100. If satisfied, output the final reconstructed continuous reflectance spectrum curve and the reconstructed continuous reflectance spectrum data; if not satisfied, repeat the iterative calculation.
[0072] The hyperspectral data processing unit 6 calls the feature extraction rules of the corresponding scene according to the detection scene type, and extracts feature parameters from the continuous reflectance spectral data reconstructed in step 4-1.
[0073] Schematic, the feature parameters refer to one or more quantitative indicators calculated by the hyperspectral data processing unit from the reconstructed continuous reflectance spectral data based on the currently selected specific detection scenario. Their specific mathematical forms are diverse and can be customized according to the scenario, mainly including but not limited to: the ratio of reflectance at a specific wavelength (for food and human surface detection), the difference in spectral intensity at a specific wavelength (for water detection), the rate of change of transmittance at a specific wavelength (for cosmetics detection), or the average reflectance in a specific band (for ordinary item detection).
[0074] To illustrate, for the following scenario, the method for extracting feature parameters is as follows: Extracting 650 features in a food inspection scenario. The absorption peak at the center wavelength and 550 The ratio of the reflection trough value reflects the degree of chlorophyll degradation during food spoilage; 720 was extracted from the water body detection scenario. The fluorescence intensity at the center wavelength is the same as that at 800. The difference in scattering intensity reflects the concentration of organic pollutants in the water; 450 samples were extracted from the cosmetics testing scenario. The rate of change in transmittance at the center wavelength reflects the degree of oxidation and deterioration of cosmetics; 580 scenes were extracted for human surface detection. The reflectivity at the center wavelength is 630 The ratio of reflectance, which distinguishes normal skin from inflamed areas; 550 is extracted from ordinary object detection scenarios. The average reflectance at the center wavelength reflects the degree of material damage to the surface of the object.
[0075] The hyperspectral data processing unit 6 traverses all pixels in the image, calculates the feature parameters of each pixel, and generates a feature parameter matrix consistent with the image size. For example, in a food inspection scenario, when strawberries are fresh, 650... This is the chlorophyll absorption peak (high absorption intensity, weak reflection), corresponding to a reflectance grayscale level of 120; 550. This is the green light reflection valley (low reflection intensity, weak absorption), corresponding to a reflectance grayscale level of 80, and the ratio of the two is 120 / 80 = 1.5. When strawberries begin to rot, chlorophyll degradation leads to 650... Absorption intensity decreases (reflection increases), reflectivity grayscale level rises to 80; 550 As reflection intensity increases (absorption decreases), the reflectance grayscale level rises to 100, and the ratio between the two becomes 80 / 100 = 0.8. Freshness can be determined by the change in this ratio, with each feature parameter matrix element corresponding to the feature parameter value of the pixel at that location (e.g., a ratio of 1.5 or 0.8).
[0076] The hyperspectral data processing unit 6 retrieves the pre-stored qualified sample feature library of the system. The feature library stores the feature mean vector and feature covariance matrix of various qualified items. The feature mean vector is the average value of the feature parameters of a large number of qualified samples, and the feature covariance matrix is a measure of the dispersion of the feature parameters of qualified samples.
[0077] The hyperspectral data processing unit 6 calculates the Mahalanobis distance between the feature vector of each pixel in the feature parameter matrix and the mean feature vector of qualified samples. The hyperspectral data processing unit 6 compares the calculated Mahalanobis distance with a defect judgment threshold. Schematic, the threshold is 2.5 for food inspection, 3.0 for cosmetics inspection, 2.8 for water inspection, 2.2 for human surface inspection, and 2.0 for ordinary items inspection. Pixels with a Mahalanobis distance greater than the threshold are marked as defective pixels.
[0078] The hyperspectral data processing unit 6 counts the percentage of defective pixels in the total number of pixels. Illumination targets with a percentage exceeding 5% are judged as unqualified. The percentage threshold can be adjusted according to the detection requirements.
[0079] The hyperspectral data processing unit 6 calculates the confidence level of the detection result. Preferably, the present invention calculates the detection confidence level by jointly calculating the defect pixel ratio and feature deviation, and adaptively outputs the detection result level.
[0080] set up: D rate The percentage of defective pixels; D mah The Mahalanobis distance for defective pixels; T th The defect judgment threshold corresponding to the scenario; S dev For feature deviation; C i Confidence level for a single defect region; C final This is the final test confidence level.
[0081] Feature deviation characterizes the relative degree to which defect features deviate from qualified samples, and is the ratio of Mahalanobis distance to the judgment threshold: S dev = D mah / T th .
[0082] A dual-weight fusion method is adopted, with a defect pixel proportion weight of 0.6 and a feature deviation weight of 0.4. C i =0.6· D rate +0.4· S dev .
[0083] The hyperspectral data processing unit 6 takes the maximum confidence score of all defect regions as the final detection confidence score. C final = ( C 1, C 2,…, C i ).
[0084] Confidence C final Output a failing conclusion if the confidence level is above 90%. C final When the accuracy is between 70% and 90%, a re-inspection prompt will be output, with a confidence level of [missing information]. C final If the percentage is below 70%, an invalid detection message will be displayed.
[0085] Preferably, the hyperspectral data processing unit 6 can automatically select a matching algorithm according to the detection task: for defect detection tasks, the Mahalanobis distance algorithm is used, and for material identification and authenticity identification tasks, the spectral angle algorithm is used for spectral fingerprint identification; the spectral angle calculates the vector angle between the reconstructed continuous reflectance spectrum and the target standard spectrum in the sample library. The smaller the angle, the higher the spectral similarity. When the angle is less than the preset matching threshold, it is determined to be a successful match.
[0086] Optionally, the hyperspectral detection system for spectral reconstruction also includes a display unit. The main control unit 1 transmits the detection results, confidence level values, and defect region coordinates to the display unit, which then displays the defect region in... The preview image is marked with a fixed color and displays the spectral curve of the corresponding pixel. The spectral curve is plotted with wavelength on the horizontal axis and grayscale value on the vertical axis, making it easy for users to view the detection results intuitively.
[0087] The target feature library of the sample library can be flexibly configured according to the needs of the detection task, including but not limited to a qualified sample feature library, a specific defect sample feature library, and a target substance feature library; the mean vector of the target feature of the sample library is the mean vector of the feature of the sample type targeted by the detection task, which is automatically retrieved by the system according to the detection scenario type.
[0088] Furthermore, the main control unit 1 establishes a bidirectional communication connection with the light source driving unit 2, the optical imaging unit 3, the data acquisition unit 4, the data storage and transmission unit 5, the hyperspectral data processing unit 6, and the display unit via a control bus.
[0089] The light source driving unit 2 establishes an electrical connection with all monochrome lighting units through a power driving circuit, and at the same time establishes a bidirectional communication connection with the main control unit 1 through a control bus. Based on the control commands issued by the main control unit 1, it provides adjustable driving current and precise power supply timing control for each monochrome lighting unit.
[0090] The optical imaging unit 3 receives the reflected light signal from the illuminated target through optical coupling, and after being converged by the lens group, it is connected to the sensor target surface of the data acquisition unit 4 to take pictures or videos of the illuminated target, convert the optical signal into an electrical signal and transmit it to the data acquisition unit 4.
[0091] The data acquisition unit 4 establishes a bidirectional communication connection with the main control unit 1 through the control bus and receives the synchronous acquisition trigger signal from the main control unit 1; at the same time, it establishes a one-way data transmission connection with the cache unit 8 through the high-speed data link and transmits the valid hyperspectral data after acquisition and verification to the cache unit 8 for temporary storage.
[0092] The cache unit 8 establishes a bidirectional communication connection with the main control unit 1 through the control bus, and the main control unit 1 uniformly schedules the read and write timing; at the same time, it establishes a unidirectional data transmission connection with the data storage and transmission unit 5 through the high-speed data link, and transmits the temporarily stored hyperspectral data to the data storage and transmission unit 5 completely according to the acquisition order.
[0093] The data storage and transmission unit 5 establishes a bidirectional communication connection with the main control unit 1 through the control bus. Under the command of the main control unit 1, it reads, stores and transmits the image data in the cache unit 8. At the same time, it establishes a bidirectional connection with the hyperspectral data processing unit 6 through the data interaction bus to realize the bidirectional transmission of raw data, intermediate parameters and processing results.
[0094] The hyperspectral data processing unit 6 establishes a bidirectional connection with the main control unit 1 through a data feedback link. Under the instructions of the main control unit 1, it performs data preprocessing, spectral reconstruction, feature extraction and defect determination, and sends the processing calculation results back to the main control unit 1. At the same time, it receives scene parameters and execution instructions issued by the main control unit 1.
[0095] Furthermore, under the instruction of the main control unit 1, the hyperspectral data processing unit 6 performs baseline correction, noise suppression, and uniformity normalization on the acquired data, and outputs the preprocessed data; reconstructs the spectrum, calculates the Mahalanobis distance between the feature vector of each pixel in the feature parameter matrix and the mean vector of the target feature in the sample library; compares the calculated Mahalanobis distance with the defect judgment threshold, and marks pixels with a Mahalanobis distance greater than the threshold as defect pixels; calculates the confidence level of the detection result, and outputs the result based on the confidence level.
[0096] This invention uses Mahalanobis distance as a measure of feature vector similarity. Compared with similarity measures such as spectral angle, Mahalanobis distance can take into account the correlation between feature parameters and is more sensitive to outliers.
[0097] In another optional embodiment, the present invention also supports spectral fingerprint recognition using spectral angles, the formula for calculating spectral angles being: = [( R · R 0 ) / (|| R ||·|| R 0 ||)],where, R This is the reconstructed continuous reflectance spectral vector of the pixel under test. R 0 For the target standard spectral vector of the sample library, || R ||and|| R 0 || represents the magnitudes of the two vectors. The angle between the two spectral vectors.
[0098] The spectral angle can reflect the overall shape characteristics of the spectral curve and is not affected by changes in light intensity. It is particularly suitable for spectral fingerprint matching scenarios such as material authenticity identification and material classification, and can effectively distinguish lighting targets of different materials and compositions.
[0099] Display unit 7 establishes a one-way data transmission connection with main control unit 1 via a display drive link, receives and displays the detection conclusions, confidence scores, defect area coordinates, and corresponding pixel spectral curves transmitted by main control unit 1, and displays the defect area in... The preview image is marked with a fixed color to make it easier for users to view the detection results intuitively.
[0100] The present invention also provides a detection method based on the above-described monochromatic illumination hyperspectral camera system, such as... As shown, the method includes the following steps: Step 1: The main control unit reads the detection scene type, matches the pre-illumination band, calculates the weights, and sets the driving parameters; Step 2: The light source driving unit illuminates the target according to the parameters and drives the monochromatic illumination unit to illuminate the target. The optical imaging unit takes pictures or videos of the target and converts the signals. The data acquisition unit collects and verifies the hyperspectral data and temporarily stores it in the cache unit. Step 3: The hyperspectral data processing unit performs baseline correction, noise suppression, and uniformity normalization on the acquired data, and outputs the preprocessed data; Step 4: The hyperspectral data processing unit reconstructs the spectrum, extracts features and compares them with the qualified library, determines defects and calculates the confidence level, and outputs the detection results through the display unit 7.
[0101] In step 1, the lighting parameters, timing rules, and energy distribution strategy are determined.
[0102] Step 1 further includes the following steps: Step 1-1: The main control unit reads the detection scene type, matches the corresponding pre-illumination band, and stores the band parameters to a temporary register.
[0103] The main control unit reads the type parameters of the current detection scene from the built-in storage unit.
[0104] The main control unit selects from the pre-stored monochrome values based on the scene type. All available bands in the band library are matched as pre-illumination bands, and the center wavelength, spectral half-width, and rated drive current parameters of each band are stored in a temporary register.
[0105] Steps 1-2: The main control unit sends a pre-illumination command, the light source driving unit turns on the LED, and the preview image is captured to select the area of interest.
[0106] The main control unit sends a full-band pre-illumination command to the light source driving unit, and the light source driving unit drives the monochromatic light source. Monochrome of all pre-illuminated bands in the illumination unit The LED lights up.
[0107] The optical imaging unit collects the reflected light signal from the illuminated target under the band illumination and focuses it onto the sensor target surface of the data acquisition unit.
[0108] Under the synchronous triggering of the main control unit, the data acquisition unit acquires band preview image data and transmits it to the hyperspectral data processing unit.
[0109] Furthermore, the preview image acquisition can employ a pixel merging mode to reduce resolution and improve acquisition speed. The hyperspectral data processing unit performs background noise removal on the preview image data, uses an edge detection algorithm to extract the contour features of foreground objects in the image, and then selects the region of interest containing the illuminated target.
[0110] Calculate the average grayscale value of all pixels in the preview image within the region of interest, read the grayscale value of the reference white board pre-stored by the system, calculate the preliminary overall reflectivity coefficient, and temporarily store the result in the data storage and transmission unit.
[0111] Steps 1-3: The hyperspectral data processing unit calculates the gray variance of each band, selects characteristic bands, and calculates the basic weight coefficients.
[0112] The hyperspectral data processing unit calculates the grayscale value of each pixel in the region of interest extracted in steps 1-2 under each pre-illumination band, and further calculates the variance of the grayscale values of all pixels in the region under each band. The hyperspectral data processing unit sets a preset variance threshold, compares the variance values of each band with the preset variance threshold, and filters out the bands with variance values greater than the threshold to form a feature band set.
[0113] For each band in the feature band set, the hyperspectral data processing unit calculates the proportion of its variance to the total variance of the feature band set, and uses this proportion as the basic weight coefficient for that band.
[0114] Steps 1-4: The main control unit divides the lighting time periods, combines the energy budget to convert the weights into driving parameters, and generates a set of lighting execution parameters.
[0115] The main control unit uses the time axis as the dividing line, and divides the total illumination duration equally according to the number of bands in the characteristic band set, assigning each characteristic band a monochromatic color. The LEDs are assigned independent lighting start and end times, and adjacent monochromatic lights... There are no time gaps or band overlaps between the illumination periods of the LED beads.
[0116] The main control unit, in conjunction with the preset system total energy budget upper limit, converts the basic weighting coefficients obtained in steps 1-3 into individual monochromatic coefficients. The target driving current value and lighting duration parameters of the LED chips.
[0117] The main control unit integrates the divided lighting period, drive current, and lighting duration parameters into a lighting execution parameter set.
[0118] Step 2 further includes the following steps: Step 2-1: The light source driving unit drives the characteristic bands sequentially according to the light execution parameter set. When lit, the monochrome lighting unit is in Driven by the directional light, the target is illuminated.
[0119] The light source driving unit retrieves the lighting execution parameter set issued in step 1 from the local storage unit, and sequentially activates the corresponding characteristic band monochromatic lighting according to the order of the lighting periods. The power supply circuit for the LED beads.
[0120] The light source driving unit outputs stable electrical energy according to the set driving current and illumination duration, enabling monochromatic lighting. The LED chip outputs monochromatic light of constant intensity; when a single monochromatic light... When the illumination duration of the LED reaches the set value, the light source driving unit immediately cuts off the monochromatic light. The power supply circuit of the LED then starts the next monochrome LED. The power supply process for the LED chips, up to the monochromatic color corresponding to all characteristic bands. The LED beads complete the lighting output.
[0121] Step 2-2: The optical imaging unit receives the light signal reflected by the illuminated target, takes a picture or video of the illuminated target, converts it into an electrical signal and reduces noise, and transmits it to the data acquisition unit.
[0122] Optical imaging unit in monochrome During the illumination period of the LED beads, the target is continuously illuminated by receiving monochromatic optical signals reflected from the surface of the target. The optical imaging unit focuses the optical signals onto the surface of the photosensitive element through the lens group, and the photosensitive element converts the received optical signals into electrical signals.
[0123] The optical imaging unit performs preliminary noise reduction on the electrical signal, eliminating interference signals caused by ambient stray light and retaining the effective spectral signal corresponding to monochromatic illumination. The processed electrical signal is then transmitted to the data acquisition unit in real time.
[0124] Steps 2-3: The data acquisition unit synchronously triggers acquisition, converts hyperspectral data and binds band identifiers, and stores it in the cache unit after verification.
[0125] The data acquisition unit receives the acquisition trigger signal issued in step 1 and acquires hyperspectral data at the same time as the lighting is started.
[0126] The data acquisition unit binds a corresponding illumination band identifier to each set of hyperspectral data to distinguish the acquired data under different monochromatic illumination.
[0127] The data acquisition unit performs integrity verification on the acquired data, discards invalid data with missing bands or abnormal signal strength, and only transmits valid data to the buffer unit 8. The buffer unit 8 transmits the data to the data storage and transmission unit 5 for temporary storage according to the acquisition order.
[0128] Step 3 further includes the following steps: Step 3-1: Extraction by the hyperspectral data processing unit Temperature, call the offset coefficient table to calculate the baseline offset, and correct the pixel grayscale value.
[0129] The hyperspectral data processing unit extracts the corresponding data from each frame of cached data. Operating temperature value.
[0130] The hyperspectral data processing unit retrieves the data pre-stored in the system. Table of temperature spectral offset coefficients.
[0131] The hyperspectral data processing unit calculates the baseline offset of the current spectrum.
[0132] The hyperspectral data processing unit completes baseline drift correction.
[0133] Step 3-2: The hyperspectral data processing unit defines the effective spectral range and performs sliding window smoothing.
[0134] The hyperspectral data processing unit defines the effective spectral range based on the center wavelength and full width at half maximum (FWHM) parameters of the characteristic bands selected in step 1.
[0135] The hyperspectral data processing unit performs sliding window averaging smoothing on the pixel spectral curves within the effective spectral range. The window length is set to three spectral channels. The arithmetic mean of all data within the window is used to replace each data point in the original window, thus smoothing out random noise. Mirror filling is used at the window boundaries to avoid distortion in edge data processing. For pixel data outside the effective spectral range, the hyperspectral data processing unit sets their grayscale values to zero, completely eliminating interference from ambient light and out-of-band stray signals. After processing, the signal-to-noise ratio of the effective spectrum is improved, fully preserving the narrowband spectral characteristics of monochromatic illumination.
[0136] Step 3-3: The hyperspectral data processing unit statistically analyzes the spatial grayscale distribution, generates a spatial matrix, and normalizes the spectral data to eliminate spot differences.
[0137] The hyperspectral data processing unit performs spatial gray-level statistics on the spectral image corrected in step 3-2. First, it calculates the average gray value of each row of pixels in the image, and then calculates the average gray value of each column of pixels based on the average gray value of the rows, finally obtaining a spatial distribution matrix consistent with the pixel size of the image.
[0138] The hyperspectral data processing unit divides the spectral gray value of each pixel in the image by the value at the corresponding position in the spatial distribution matrix to obtain normalized hyperspectral data.
[0139] Step 4 further includes the following steps: Step 4-1: The hyperspectral data processing unit reads the hyperspectral data, constructs a forward observation model, and iteratively reconstructs the continuous reflectance spectral curve.
[0140] The hyperspectral data processing unit reads the hyperspectral data cube generated in step 2 from the data storage and transmission unit, and extracts the grayscale value of each pixel in the region of interest under each illumination band. It then calls upon the pre-stored monochromatic data... A forward optical observation model is constructed by combining the standard emission spectral power distribution function of the LED and the spectral response function of the sensor.
[0141] Step 4-2: The hyperspectral data processing unit calls the feature rules according to the scenario, extracts feature parameters from the reconstructed spectrum, and generates a feature matrix.
[0142] The hyperspectral data processing unit calls the feature extraction rules of the corresponding scene according to the detection scene type in step 1, and extracts feature parameters from the continuous reflectance spectral data reconstructed in step 4-1.
[0143] Schematic, the feature parameters refer to one or more quantitative indicators calculated by the hyperspectral data processing unit from the reconstructed continuous reflectance spectral data based on the currently selected specific detection scenario. Their specific mathematical forms are diverse and can be customized according to the scenario, mainly including but not limited to: the ratio of reflectance at a specific wavelength (for food and human surface detection), the difference in spectral intensity at a specific wavelength (for water detection), the rate of change of transmittance at a specific wavelength (for cosmetics detection), or the average reflectance of a specific band (for ordinary item detection). For example, in a food detection scenario, the ratio of reflectance at 650nm to 550nm is used to characterize the degree of chlorophyll degradation; in a human surface detection scenario, the ratio of reflectance at 580nm to 630nm is used to distinguish inflammatory areas. These feature parameters calculated for each pixel will further constitute a feature parameter matrix for subsequent comparisons.
[0144] The hyperspectral data processing unit traverses all pixels in the image, calculates the feature parameters of each pixel, and generates a feature parameter matrix with the same size as the image.
[0145] Step 4-3: The hyperspectral data processing unit retrieves the target feature library from the sample library, calculates the Mahalanobis distance or spectral angle between the feature vector of each pixel in the feature parameter matrix and the mean vector of the target features in the sample library, compares it with the threshold, and marks defective pixels; preferably, the hyperspectral data processing unit counts the proportion of defective pixels in the total pixels, and the illumination target with a proportion exceeding the preset threshold is judged as unqualified.
[0146] The hyperspectral data processing unit retrieves the pre-stored sample library and target feature library of the system.
[0147] For the defect detection task, the hyperspectral data processing unit 6 calculates the Mahalanobis distance between the feature vector of each pixel in the feature parameter matrix and the mean vector of the target feature in the sample library, and marks the pixels with a Mahalanobis distance greater than the defect judgment threshold as defect pixels. For the spectral fingerprinting task, the hyperspectral data processing unit 6 calculates the spectral angle between the reconstructed continuous reflectance spectrum and the target standard spectrum in the sample library, marks pixels with spectral angles less than the spectral matching threshold as matching pixels, counts the proportion of matching pixels, and determines that the material matching is successful when the proportion exceeds the preset threshold.
[0148] The hyperspectral data processing unit counts the percentage of defective pixels in the total number of pixels, and lighting targets with a percentage exceeding 5% are judged as unqualified.
[0149] Step 4-4: The hyperspectral data processing unit calculates the detection confidence level, and the main control unit transmits the results to the display unit to mark the defect area and display the spectrum.
[0150] The hyperspectral data processing unit calculates the confidence level of the detection results. If the confidence level is higher than 90%, it outputs a non-compliant conclusion; if the confidence level is between 70% and 90%, it outputs a prompt for re-inspection; if the confidence level is lower than 70%, it outputs an invalid detection prompt. The main control unit 1 transmits the detection conclusion, confidence level value, defect area coordinates, and the spectral curve of the corresponding pixel to the display unit 7. The display unit 7 then... The preview image uses a fixed color to mark the defect area and displays the spectral curve simultaneously.
[0151] The technical solution of the present invention will be further illustrated below through several specific application scenarios.
[0152] Example 1: Food Testing (Strawberry Freshness Testing) This embodiment uses the monochromatic illumination weighting and spectral reconstruction hyperspectral detection method described in this invention to perform non-invasive freshness detection on strawberries.
[0153] The specific implementation steps are as follows: 1. Monochrome lighting parameter configuration and weight allocation The main control unit selects the food detection scenario and matches the pre-illumination band to 500. 550 600 650 700 750 The main control unit controls the light source drive unit to operate at 15% of the rated drive current and 80... The illumination duration is low-power full-band pre-illumination, with the total energy not exceeding 5% of the system's rated total energy. The optical imaging unit and data acquisition unit work together to acquire preview images, and the hyperspectral data processing unit selects the strawberry fruit as the region of interest.
[0154] The hyperspectral data processing unit calculated the variances of the gray values for each band to be 120, 85, 210, 190, 75, and 60, respectively. The preset variance threshold was 80, and the selected characteristic bands were 500. 600 650 The calculated basic weight coefficients are 0.23, 0.40, and 0.37, respectively.
[0155] The main control unit divides the total lighting duration equally into three characteristic bands. Considering the system's total energy budget limit is 80% of the rated power, the basic weighting coefficients are converted into corresponding monochromatic values. The driving current of the LED beads and the lighting duration are used to generate a set of lighting execution parameters.
[0156] 2. Time-synchronized illumination and hyperspectral data acquisition The light source driving unit drives the characteristic band monochromatic light source in a time sequence according to the illumination execution parameter set. The LEDs light up sequentially, with no gaps or overlaps in the illumination process; the optical imaging unit receives the reflected light signal and completes photoelectric conversion; the data acquisition unit collects hyperspectral data with a resolution of 1280×1024 pixels, binds the band identifier and completes data verification; and the valid data is stored in the high-speed cache queue of the data storage and transmission unit.
[0157] 3. Hyperspectral data preprocessing for monochromatic illumination Hyperspectral data processing unit extraction The operating temperature is 28℃, according to The temperature spectral shift coefficient table completes baseline drift correction, and the center wavelength gray value fluctuation after correction is ≤ ±1 gray level. The effective spectral range is defined based on the full width at half maximum (FWHM) of the characteristic bands, and a 3-channel sliding window averaging smoothing process is performed, increasing the effective spectral signal-to-noise ratio to 45. After spatial spectral uniformity normalization, the standard deviation of gray values in the same uniform material region is 0.8%.
[0158] 4. Spectral Reconstruction and Feature Matching Detection The hyperspectral data processing unit constructs a forward optical observation model and sets smoothing constraint weighting coefficients. α =0.1, constrained spectral reconstruction was completed through 12 iterations of gradient descent; 650 Absorption peak and 550 The ratio of reflection valley values is used as a feature parameter; the target feature library of the sample library (in this embodiment, the feature library of qualified fresh strawberry samples) is retrieved, the defect judgment threshold is set to 2.5, the Mahalanobis distance between the feature vector of each pixel in the feature parameter matrix and the mean vector of the target feature in the sample library is calculated and defective pixels are marked, the proportion of defective pixels is counted, and the detection confidence is calculated in combination with the feature deviation.
[0159] Test results: Fresh strawberries: Feature ratio 1.5, defect pixel percentage 1.2%, confidence level 65%, judged as qualified; Slightly rotten strawberries: Feature ratio 1.0, defective pixel rate 4.1%, confidence level 78%, judged to be subject to re-inspection; Severely rotten strawberries: Feature ratio 0.8, defective pixel rate 12.3%, confidence level 94%, judged as unqualified.
[0160] Appendix This is a quantitative comparison chart of the effects of monochrome illumination discrete sampling and spectral reconstruction in Embodiment 1 of the present invention. The chart shows a quantitative comparison of the effects of monochrome illumination discrete sampling and spectral reconstruction, with wavelength (… () is the horizontal axis and spectral reflectance is the vertical axis. The purple dots in the figure represent values based on monochromaticity. The original discrete sampling points acquired in the characteristic bands are only 500 600 650 Reflectance data exists in three characteristic bands; the red dashed line represents the spectral curve obtained using the traditional linear interpolation method. This curve only connects discrete sampling points with straight lines and cannot reproduce the local fluctuation characteristics of the spectrum. (At 550...) -600 There is significant signal distortion in the range, and at 650... Subsequent bands cannot reflect the true trend of spectral changes; the solid blue line represents the continuous spectral curve obtained by the constrained spectral reconstruction method of this invention. This curve achieves a smooth transition between discrete sampling points, restoring the spectrum at 550°. -580 The reflectance peak characteristics in the range, while at 650 Subsequent bands accurately captured the changing trend of spectral reflectance, eliminating the spectral gaps and distortion problems present in traditional interpolation methods.
[0161] Example 2: Human Surface Detection (Facial Skin Inflammation Detection) This embodiment uses the method described in this invention to perform non-invasive detection on areas of facial skin inflammation.
[0162] The specific implementation steps are as follows: 1. Monochrome lighting parameter configuration and weight allocation The main control unit selects the human body surface detection scene and matches the pre-illumination band to 500. 550 580 630 680 With 12% of the rated drive current, 70 The lighting duration is low-power pre-illumination, and the facial detection area is selected as the region of interest.
[0163] The variances of the gray values for each band are 90, 70, 210, 180, and 80, respectively. The preset variance threshold is 75, and the selected feature bands are 500. 580 630 680 The basic weighting coefficients are 0.15, 0.36, 0.31, and 0.18, respectively; the main control unit completes the division of lighting time periods and parameter settings.
[0164] 2. Time-synchronized illumination and hyperspectral data acquisition The time-sequential illumination process is completed without thermal damage, while the data acquisition unit completes the acquisition, verification, and caching of hyperspectral data.
[0165] 3. Hyperspectral data preprocessing for monochromatic illumination Operating temperature 32℃, grayscale value fluctuation after baseline correction ≤ ±1 grayscale level; signal-to-noise ratio reaches 43 after smoothing. Spatial normalization eliminates uneven light spot distribution.
[0166] 4. Spectral Reconstruction and Feature Matching Detection Set smoothing constraint weight coefficients α =0.08 to complete spectral reconstruction; extract 580 Reflectivity and 630 The ratio of reflectance is used as a feature parameter; the target feature library of the sample database (in this embodiment, the feature library of qualified healthy skin samples) is retrieved, the defect judgment threshold is set to 2.2, the Mahalanobis distance between the feature vector of each pixel in the feature parameter matrix and the mean vector of the target feature in the sample database is calculated, and the inflammatory area is marked and the confidence is calculated.
[0167] Test results: Healthy skin: Feature ratio 1.8, defective pixel percentage 0.3%, confidence level 48%, judged as qualified; Mildly inflamed skin: Feature ratio 1.1, defective pixel percentage 3.9%, confidence level 74%, judged to be subject to re-inspection; Severely inflamed skin: Feature ratio 0.6, defective pixel percentage 9.2%, confidence level 92%, judged as unqualified.
[0168] Furthermore, the monochromatic illumination hyperspectral camera system described in this invention possesses excellent miniaturization and portability expansion capabilities. Through hardware miniaturization design and lightweight algorithm porting, it can be highly integrated into mobile smart terminal devices such as mobile phones and tablets. Relying on the computing power, storage, and imaging infrastructure of mobile terminals, it can transform professional-grade hyperspectral detection capabilities into consumer-grade portable applications without the need to add large-scale dedicated optical and processing components. It not only covers the original detection scenarios such as food, water, and human body surfaces, but can also be expanded to diversified daily and consumer-grade scenarios such as cosmetic authenticity identification, personal skin health management, rapid household water quality testing, jewelry and antique material identification, and portable quality inspection of small industrial products. This significantly improves the popularization and applicability of hyperspectral detection technology, realizing the civilian and portable application of professional detection capabilities.
[0169] Example 3: Identification of genuine and counterfeit cosmetics (application of spectral fingerprint recognition) This embodiment uses the spectral angle spectral fingerprint recognition function described in this invention to identify the authenticity of a certain brand of face cream.
[0170] The specific implementation steps are as follows: 1. Monochrome lighting parameter configuration and weight allocation The main control unit 1 selects the cosmetic detection scene and matches the pre-illumination bands as 450nm, 500nm, 550nm, 600nm, and 650nm; it executes low-power full-band pre-illumination, selects the cream sample area as the region of interest, filters the feature bands and calculates the basic weight coefficients, and generates the illumination execution parameter set.
[0171] 2. Time-synchronized illumination and hyperspectral data acquisition The light source driving unit 2 drives the characteristic band monochrome LED beads to light up sequentially in a time-division manner. The data acquisition unit 4 collects hyperspectral data and temporarily stores it in the buffer unit 8, and then transmits it to the data storage and transmission unit 5.
[0172] 3. Hyperspectral data preprocessing for monochromatic illumination Complete temperature baseline correction, sliding window smoothing, and spatial uniformity normalization.
[0173] 4. Spectral Reconstruction and Feature Matching Detection The hyperspectral data processing unit 6 constructs a forward optical observation model, completes constrained spectral reconstruction to obtain a continuous reflectance spectrum; retrieves the target feature library of the sample library (in this embodiment, the standard spectral library of genuine face cream), calculates the spectral angle between the reconstructed spectrum of each pixel and the standard spectrum of genuine product; sets the spectral matching threshold to 0.1 radians, and marks pixels with a spectral angle less than 0.1 radians as genuine matching pixels.
[0174] Test results: Authentic face cream: 96.2% of the pixels matched, with a confidence level of 95%, indicating it is authentic; Counterfeit face cream: Matching pixel ratio 12.7%, confidence level 91%, determined to be counterfeit. It will be apparent to those skilled in the art that this invention is not limited to the details of the above exemplary embodiments, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description; thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0175] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A monochromatic illumination hyperspectral camera system, characterized in that: The system includes at least one monochrome illumination unit, a main control unit (1), a light source driving unit (2), an optical imaging unit (3), a data acquisition unit (4), a data storage and transmission unit (5), a hyperspectral data processing unit (6), a display unit (7), and a cache unit (8). The main control unit (1) establishes a bidirectional communication connection with the light source driving unit (2), the optical imaging unit (3), the data acquisition unit (4), the data storage and transmission unit (5), the hyperspectral data processing unit (6), the display unit (7), and the cache unit (8) via a control bus. The light source driving unit (2) establishes an electrical connection with the monochrome illumination unit via a power driving circuit. The optical imaging unit (3) connects to the data acquisition unit (4) via an optical coupling and a signal transmission link. The data acquisition unit (4) connects to the cache unit (8) via a data link. The cache unit (8) connects to the data storage and transmission unit (5) via a high-speed data link. The data storage and transmission unit (5) and the hyperspectral data processing unit (6) establish a bidirectional connection via a data interaction bus. The hyperspectral data processing unit (6) and the main control unit (1) establish a bidirectional connection via a data feedback link. The main control unit (1) sends an illumination command to the light source driving unit (2) according to the target scene. The light source driving unit (2) selects and drives the monochrome lighting unit to illuminate the target according to the illumination command. The optical imaging unit (3) collects the light signal reflected from the illuminated target and focuses it onto the sensor target surface of the data acquisition unit (4); Under the synchronous triggering of the main control unit (1), the data acquisition unit (4) acquires image data and transmits it to the buffer unit (8). Under the instruction of the main control unit (1), the data storage and transmission unit (5) performs operations such as reading, storing, and transmitting the image data in the cache unit (8); Under the instruction of the main control unit (1), the hyperspectral data processing unit (6) performs baseline correction, noise suppression, and uniformity normalization on the acquired data and outputs the preprocessed data. Reconstruct the spectrum and calculate the Mahalanobis distance or spectral angle between the feature vector of each pixel in the feature parameter matrix and the mean vector of the target features in the sample library; compare the calculated Mahalanobis distance with the defect judgment threshold, and mark pixels with Mahalanobis distance greater than the threshold as defective pixels, or compare the calculated spectral angle with the spectral matching threshold to complete spectral fingerprint recognition. Subsequently, the confidence level of the detection result is calculated, and the detection result is output based on the confidence level.
2. The monochromatic illumination hyperspectral camera system according to claim 1, characterized in that: The hyperspectral data processing unit (6) performs background noise removal processing on the preview image data, extracts the outline features of the foreground object using the edge detection algorithm, selects the region of interest, and calculates the average gray value and preliminary overall reflectance coefficient of the region.
3. The monochromatic illumination hyperspectral camera system according to claim 2, characterized in that: The hyperspectral data processing unit (6) calculates the gray value variance of each pre-illuminated band in the region of interest, forms a feature band set with bands whose variance is greater than a preset variance threshold, and uses the proportion of the variance of a single band to the total variance value as the basic weight coefficient of the corresponding band.
4. The monochromatic illumination hyperspectral camera system according to claim 3, characterized in that: The hyperspectral data processing unit (6) retrieves led The temperature spectral offset coefficient table calculates the baseline offset, and the pixel grayscale value is subtracted from the baseline offset to complete the temperature-related baseline drift correction.
5. The monochromatic illumination hyperspectral camera system according to claim 4, characterized in that: The hyperspectral data processing unit (6) defines the effective spectral range based on the center wavelength and half-peak width parameters of the characteristic band, performs sliding window averaging processing using the window length of 3 spectral channels, smooths random noise by mirror filling the window boundary, and sets the gray value of pixels outside the range to zero.
6. The monochromatic illumination hyperspectral camera system according to claim 5, characterized in that: The hyperspectral data processing unit (6) performs spatial gray-level statistics on the corrected spectral image to generate a spatial distribution matrix, and divides the pixel spectral gray-level value by the corresponding value of the matrix to complete the spatial spectral uniformity normalization.
7. The monochromatic illumination hyperspectral camera system according to claim 6, characterized in that: The hyperspectral data processing unit (6) calls the standard emission spectral power distribution function and the sensor spectral response function to construct a forward optical observation model, sets an optimization objective function containing data fidelity terms and spectral smoothing constraints, iteratively updates the reflectance guess value using the gradient descent method, and outputs the reconstructed continuous reflectance spectral data when the convergence condition is met.
8. The monochromatic illumination hyperspectral camera system according to claim 7, characterized in that: The hyperspectral data processing unit (6) extracts feature parameters and generates a feature parameter matrix according to the detection scene type, retrieves the target feature library of the sample library to calculate Mahalanobis distance or spectral angle to mark defective pixels, counts the proportion of defective pixels in the total pixels, and determines that the illumination target with a proportion exceeding the preset threshold is unqualified. The final detection confidence is calculated using a dual-weight fusion method, and the detection result level is divided according to the confidence level. The spectral angle is used to realize spectral fingerprint recognition, calculates the angle between the reconstructed continuous reflectance spectrum and the target spectrum of the sample library, and determines that the match is successful when the angle is less than the preset threshold. It is suitable for material authenticity identification and material classification identification scenarios.
9. A method for detecting hyperspectral images under monochromatic illumination, characterized in that, The application of the monochromatic illumination hyperspectral camera system according to any one of claims 1 to 8 includes the following steps: Step 1: The main control unit reads the detection scene type, matches the pre-illumination band, calculates the weights, and sets the driving parameters; Step 2: The light source driving unit illuminates the target according to the parameters and drives the monochromatic illumination unit to illuminate the target. The optical imaging unit takes pictures or videos of the target and converts the signals. The data acquisition unit acquires hyperspectral data and temporarily stores it in the buffer unit. Step 3: The hyperspectral data processing unit performs baseline correction, noise suppression, and uniformity normalization on the acquired data, and outputs the preprocessed data; Step 4: The hyperspectral data processing unit reconstructs the spectrum, extracts features and compares them with the target feature library of the sample library, determines defects and calculates confidence level, and outputs the detection results through the display unit.
10. The monochromatic illumination hyperspectral detection method according to claim 9, characterized in that, Step 4 specifically includes: The hyperspectral data processing unit constructs a forward optical observation model, combines data fidelity terms and spectral smoothing constraints to complete constrained spectral reconstruction and outputs continuous reflectance spectral data; extracts feature parameters based on the detection scene type and generates a feature parameter matrix; retrieves the target feature library from the sample library to calculate the Mahalanobis distance between the feature vector and the mean vector of the target features in the sample library, and marks pixels greater than the defect judgment threshold as defect pixels; calculates the proportion of defect pixels and uses a dual-weight fusion method of defect pixel proportion and feature deviation to calculate the final detection confidence level, and classifies and outputs the detection result level based on the confidence level.