Crop canopy light field spectrum data correction method and nutrient detection device

By constructing a weighted fusion strategy of a light field heterogeneity characterization parameter model and a dual regression model, the problems of spectral distortion and insufficient nutrient inversion accuracy of crop canopy hyperspectral images under non-uniform field illumination were solved, and adaptive correction of spectral data and accurate nutrient detection were achieved.

CN122265612APending Publication Date: 2026-06-23CHINA AGRI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA AGRI UNIV
Filing Date
2026-03-13
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Under non-uniform lighting conditions in the field, existing technologies cannot effectively handle the uneven lighting phenomenon in hyperspectral images, resulting in crop canopy data distortion and insufficient nutrient inversion accuracy. Traditional spectral correction methods ignore the differences between strong light areas and shadow areas, leading to loss of texture details or noise residue, and single regression models are difficult to adapt to dynamic light environments.

Method used

A model for characterizing the heterogeneity of the light field, including the red-edge modulation coefficient, is constructed. Strong and weak light regions are identified by clustering. A benchmark correction model is constructed and weighted fusion is performed using fusion weight coefficients. Nutrient content is calculated by combining a bi-regression model, thereby achieving adaptive correction and accurate inversion of the spectrum.

Benefits of technology

It improves the accuracy of crop canopy nutrient detection and the authenticity of spatial distribution maps, solves the problem of spectral distortion under uneven lighting conditions, achieves a smooth spectral transition from strong light areas to shaded areas, and ensures the spatial continuity and detection accuracy of the corrected spectral data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265612A_ABST
    Figure CN122265612A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of spectral detection, and discloses a crop canopy light field spectrum data correction method and a nutrient detection device. The method comprises the following steps: collecting crop canopy hyperspectral data, removing the background by using an optimized soil to adjust the vegetation index after radiation correction; constructing a light field heterogeneity parameter model combined with a red edge response factor, determining a red edge modulation coefficient through iterative optimization of a clustering evaluation index; calculating the Euclidean distance from a pixel to the clustering center of strong and weak light to generate a fusion weight coefficient; constructing a differentiated benchmark correction model, and performing linear weighted fusion twice on the spectral data and the nutrient content calculated by the double regression model by using the fusion weight. Through the construction of the light field heterogeneity representation parameter and the soft segmentation strategy based on the distance weight, the smooth transition of the strong and weak light regions is realized, the spectral distortion caused by uneven light is eliminated, and the accuracy and robustness of the crop nutrient detection under complex light field are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of spectroscopic detection technology, specifically to a method for correcting crop canopy light field spectrum data and a nutrient detection device. Background Technology

[0002] Hyperspectral imaging technology, as a non-destructive testing method that integrates spectral information, has been widely used in crop growth monitoring and nutrient diagnosis in precision agriculture. By acquiring continuous spectral information of the crop canopy, it is possible to analyze in depth the content of biochemical components inside the plant, such as key nutrient indicators like chlorophyll and nitrogen. Compared with traditional multispectral techniques, hyperspectral data has higher spectral resolution and can capture the differences in spectral response characteristics of crops at the microscale, providing important data support for variable-rate fertilization and precision management in the field.

[0003] In existing hyperspectral detection procedures for crop nutrients, data acquisition typically utilizes imaging equipment mounted on ground-based mobile platforms or drones, followed by radiometric correction using a standard whiteboard to obtain reflectance data. To extract effective crop information, current techniques often employ threshold segmentation based on vegetation indices to separate the soil background, followed by preprocessing algorithms such as standard normal variable transformation or multivariate scattering correction to denoise the entire spectrum. Building upon this foundation, researchers frequently employ machine learning algorithms such as partial least squares regression and support vector machines to establish a unified inversion model between the full-band or characteristic-band data and crop nutrient content, thereby achieving a quantitative assessment of crop nutrient status.

[0004] While existing technologies can achieve good detection results under uniform illumination conditions, in natural field environments, the acquired images often exhibit significant uneven illumination due to the influence of solar altitude angle, cloud cover, and the geometry of the crop canopy itself. This means that the images simultaneously contain areas of direct sunlight and areas of shadow. Current technologies often employ globally uniform spectral correction or rigid partitioning based on fixed thresholds when processing such data. This approach ignores the fundamental differences in signal-to-noise ratio and spectral response mechanisms between areas of strong light and shadow. This leads to overcorrection in areas of strong light, resulting in the loss of texture details, or insufficient signal enhancement in areas of shadow, leaving residual noise. Furthermore, simple rigid partitioning can create abrupt changes and discontinuities in spectral values ​​at the light-shadow boundary, disrupting the spatial continuity of the crop canopy data. Simultaneously, relying solely on a single regression model is insufficient to simultaneously fit the physicochemical parameter relationships under two light field environments with vastly different light intensities. This nonlinear drift in spectral characteristics ultimately leads to a significant decrease in the accuracy of crop nutrient spatial distribution map inversion, failing to accurately reflect the uniformity of crop growth in the field. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method for correcting crop canopy light field spectrum data and a nutrient detection device, which solves the problems of spectral distortion and insufficient nutrient inversion accuracy in crop canopy hyperspectral images under non-uniform field illumination conditions.

[0006] To achieve the above objectives, the present invention provides the following technical solution: The first aspect of this invention provides a method for correcting crop canopy light field spectral data, the method comprising the following steps: A computational model for optical field heterogeneity characterization parameters, including the red-edge modulation coefficient, is constructed. The optimal red-edge modulation coefficient is determined by traversal search, and an optical field heterogeneity characterization parameter map is generated. Based on the optical field heterogeneity characterization parameter map, clustering is used to determine the cluster centers of strong light and weak light regions, and the distance from the pixel to the two cluster centers is calculated to generate the fusion weight coefficient. A first benchmark correction model corresponding to strong light attribute and a second benchmark correction model corresponding to weak light attribute are constructed. The correction spectra output by the two models are weighted and fused using the fusion weight coefficients to obtain the final correction spectrum. The regression models corresponding to strong light and weak light benchmarks are called respectively to calculate the content of the nutrient to be selected, and the results are fused a second time based on the fusion weight coefficient to obtain the final nutrient content.

[0007] Preferably, the background removal based on the optimized soil-adjusted vegetation index after radiometric correction specifically includes: converting the digital quantization values ​​of the original hyperspectral image data into spectral reflectance data using standard whiteboard data and dark current data; selecting near-infrared band reflectance values ​​and red band reflectance values ​​to calculate the optimized soil-adjusted vegetation index with soil adjustment factors; setting a background removal threshold; comparing the optimized soil-adjusted vegetation index with the background removal threshold pixel by pixel to generate a binary mask; using the binary mask to retain the spectral data determined to be crop canopy and remove background pixels determined to be soil or weeds.

[0008] Preferably, the construction of the optical field heterogeneity characterization parameter calculation model including the red-edge modulation coefficient specifically refers to: for each crop canopy pixel, calculating the sum of spectral reflectance values ​​in the visible light band as the visible light integrated intensity, and calculating the sum of spectral reflectance values ​​in the near-infrared band as the near-infrared integrated intensity; selecting two characteristic wavelengths in the red-edge region to calculate the ratio of the reflectance difference to the wavelength difference as the red-edge response factor; the optical field heterogeneity characterization parameter calculation model is defined as: multiplying the ratio of the visible light integrated intensity to the near-infrared integrated intensity by a correction term including the red-edge response factor and the red-edge modulation coefficient, wherein the red-edge modulation coefficient is used to adjust the contribution of red-edge information to optical field heterogeneity.

[0009] Preferably, the step of determining the optimal red-edge modulation coefficient through traversal search specifically includes: setting a numerical search interval and iteration step size for the red-edge modulation coefficient; sequentially selecting candidate values ​​for the red-edge modulation coefficient within the search interval; for each candidate value, calculating the distribution of light field heterogeneity characterization parameters of crop canopy pixels in the entire image; performing K-means clustering analysis on the distribution data and calculating the Davidson-Bourdin index; comparing the Davidson-Bourdin indices obtained from each iteration, and selecting the candidate value corresponding to the minimum Davidson-Bourdin index as the optimal red-edge modulation coefficient.

[0010] Preferably, the calculation of the distance from the pixel to the two cluster centers specifically includes: performing clustering operations on the light field heterogeneity characterization parameter map, extracting the centroid corresponding to the characteristics of the strong light direct environment as the strong light region cluster center, and extracting the centroid corresponding to the characteristics of the weak light shadow environment as the weak light region cluster center; calculating the absolute value of the difference between the light field heterogeneity characterization parameter value of the current pixel and the value of the strong light region cluster center as the first distance; and calculating the absolute value of the difference between the light field heterogeneity characterization parameter value of the current pixel and the value of the weak light region cluster center as the second distance.

[0011] Preferably, the generation of the fusion weight coefficient specifically refers to: defining the fusion weight coefficient as representing the degree to which a pixel is biased towards strong light attributes; calculating the proportion of the second distance in the sum of the first distance and the second distance, and determining the proportion value as the fusion weight coefficient, such that when the pixel feature is close to the cluster center of the strong light region, the fusion weight coefficient approaches a first preset extreme value, and when the pixel feature is close to the cluster center of the weak light region, the fusion weight coefficient approaches a second preset extreme value.

[0012] Preferably, the weighted fusion of the corrected spectra output by the two models using fusion weight coefficients specifically includes: constructing a first benchmark correction model, which outputs a first corrected spectrum by dividing the original spectral reflectance value by the sum of the near-infrared band integral intensity and a first smoothing constant to suppress structural differences; constructing a second benchmark correction model, which outputs a second corrected spectrum by dividing the original spectral reflectance value by the sum of the visible light band integral intensity and a second smoothing constant to compensate for the dynamic range of light intensity; using the fusion weight coefficients as the weights of the first corrected spectrum and using the difference between one and the fusion weight coefficients as the weights of the second corrected spectrum, performing a band-by-band linear weighted summation on the two to generate a final corrected spectrum that eliminates the jumps at the boundaries of the light field partitions.

[0013] Preferably, the step of calling the regression models corresponding to strong light and weak light benchmarks to calculate the content of candidate nutrients specifically includes: using a random frog-jumping algorithm to screen nutrient-related feature band data from the final corrected spectrum; obtaining the first regression model parameters pre-trained using strong light sample data corrected by the first benchmark, and the second regression model parameters pre-trained using weak light sample data corrected by the second benchmark; substituting the feature band data into the first regression model parameters and the second regression model parameters respectively, to calculate the content of the first candidate nutrient and the content of the second candidate nutrient respectively.

[0014] Preferably, the method further includes the step of generating a crop canopy nutrient spatial distribution map: constructing a two-dimensional spatial distribution matrix with the same spatial resolution as the original hyperspectral image, using a binary mask generated in the background removal stage as an index, filling the calculated final nutrient content into the corresponding crop canopy pixel position, and setting the background position to a preset background identifier value; statistically analyzing the nutrient content value distribution of effective crop pixels, determining the dynamic range of the values ​​using the percentile truncation method, mapping the values ​​to a pseudo-color image using a color lookup table, and adding color bars corresponding to the boundary values ​​of the dynamic range at the image edges.

[0015] A second aspect of the present invention also provides a nutrient detection device, comprising: The image acquisition module is used to control the hyperspectral imaging equipment to acquire data and perform radiometric correction and background removal; The parameter iteration construction module is used to construct a calculation model for optical field heterogeneity characterization parameters and determine the optimal red-edge modulation coefficient; The continuous partitioning parsing module is used to calculate cluster centers and the distance from a cell to a cluster center; The spectral fusion correction module is used to calculate the fusion weight coefficient and perform weighted fusion of spectra after different normalization processes based on the coefficient. The nutrient inversion detection module is used to calculate the content of candidate nutrients using a double regression model and perform a second weighted fusion. The visualization output module is used to generate spatial distribution maps of crop canopy nutrients; The nutrient detection device also includes a hyperspectral imaging acquisition module. A display screen is installed on the outside of the hyperspectral imaging acquisition module. From left to right, a charging interface, a USB interface, and an SD card slot are provided on the bottom of the display screen.

[0016] This invention provides a method for correcting crop canopy light field spectrum data and a nutrient detection device. It has the following beneficial effects: 1. This invention constructs a parameter model representing the heterogeneity of the light field, including red-edge modulation coefficients, and determines the optimal coefficients through iterative optimization. This scheme comprehensively utilizes visible light, near-infrared integrated intensity, and red-edge structure information to adaptively quantify the light field properties of different crop canopies under complex field lighting conditions. Compared to traditional single-band threshold segmentation, this method improves the accuracy of distinguishing between areas of strong direct sunlight and areas of weak shadow, providing a reliable data foundation for subsequent zoning correction.

[0017] 2. This invention proposes a continuous partitioning analysis and spectral weighted fusion mechanism based on cluster center distance. Fusion weights are generated by calculating the Euclidean distance from pixels to the strong and weak light cluster centers, and the spectra, after being normalized for near-infrared and visible light respectively, are linearly fused. This soft partitioning strategy avoids the boundary spectral value jump problem caused by traditional hard partitioning, achieving a smooth spectral transition from strong light areas to shadow areas and ensuring the spatial continuity of the corrected spectral data.

[0018] 3. This invention employs a dual-model regression and secondary fusion strategy based on light field attributes. Addressing the differentiated needs of strong light areas focusing on structure elimination and weak light areas focusing on light intensity compensation, different regression models are used to calculate nutrient content, and the results are then synthesized using fusion weights. This process overcomes the interference of non-uniform field illumination on spectral inversion, solves the problem of poor adaptability of a single model under dynamic light conditions, and improves the overall accuracy of crop canopy nutrient detection and the realism of spatial distribution maps. Attached Figure Description

[0019] Figure 1 This is a schematic flowchart of the crop canopy light field spectrum data correction method and nutrient detection device of the present invention; Figure 2 This is a schematic diagram of the crop canopy hyperspectral image acquisition and preprocessing process of the present invention; Figure 3 This is a schematic diagram of the process for constructing optical field heterogeneity characterization parameters based on iterative optimization according to the present invention; Figure 4 This is a schematic diagram of the light field continuous partitioning analysis process based on cluster center distance according to the present invention; Figure 5 This is a schematic diagram of the differential spectral correction process based on transition region weighted fusion of the present invention; Figure 6 This is a schematic diagram illustrating the construction and inversion process of the nutrient detection model based on adaptive light field constraints according to the present invention; Figure 7 This is a schematic diagram of the nutrient spatial distribution visualization generation process of the present invention; Figure 8 This is a schematic diagram of the entire process for detecting nitrogen content in the canopy of winter wheat in this embodiment; Figure 9 A simplified connection diagram of a nutrient detection device for adaptive characterization of crop canopy light field heterogeneity; Figure 10 A frontal stereoscopic view of a nutrient detection device for adaptive characterization of crop canopy light field heterogeneity.

[0020] The components include: 1. Hyperspectral imaging acquisition module; 2. Charging interface; 3. USB interface; 4. SD card slot; and 5. Display screen. Detailed Implementation

[0021] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] Please see Figure 1 This invention provides a method for correcting crop canopy light field spectral data, comprising the following steps: S1. Use a hyperspectral imaging device to collect raw hyperspectral image data of crop canopy, and perform radiometric correction on the raw hyperspectral image data in combination with whiteboard calibration data. Convert the digital quantization value of the raw image into spectral reflectance data. Calculate and optimize the soil vegetation index based on the spectral reflectance data. Compare the index with a preset background removal threshold to generate a binary mask. Use the binary mask to remove soil and weed background pixels and extract pure crop canopy pixel data.

[0023] S2. Construct a calculation model for optical field heterogeneity characterization parameters, including undetermined red-edge modulation coefficients. This model combines the integrated intensity of the visible light band, the integrated intensity of the near-infrared band, and the red-edge response factor. Set the numerical search interval and iteration step size for the red-edge modulation coefficients. Within the search interval, traverse the candidate values ​​of the red-edge modulation coefficients according to the step size. For each candidate value, calculate the distribution of optical field heterogeneity characterization parameters for crop canopy pixels in the entire map, and perform K-means clustering analysis on the distribution data. Calculate the Davidson-Bourdin index of the clustering results as an evaluation index, and select the candidate value that minimizes the Davidson-Bourdin index as the optimal red-edge modulation coefficient. The data calculated based on the optimal red-edge modulation coefficient is used as the final optical field heterogeneity characterization parameter map.

[0024] S3. Based on the final light field heterogeneity characterization parameter map, perform a secondary clustering operation to obtain the cluster centers of strong light regions representing strong light attributes and the cluster centers of weak light regions representing weak light attributes. For each crop canopy pixel (which refers to a valid image pixel in the hyperspectral image that, after background removal, is determined to belong to crop plants rather than soil, weeds, or shadow background), calculate the Euclidean distance between its light field heterogeneity characterization parameter value and the cluster center of the strong light region, denoted as the first distance; calculate the Euclidean distance between its light field heterogeneity characterization parameter value and the cluster center of the weak light region, denoted as the second distance; these two distance values ​​are used to quantify the relative position attribute of the pixel in the light field space.

[0025] S4. Calculate the fusion weight coefficient for each crop canopy pixel using the first and second distances. This coefficient characterizes the degree to which the pixel is biased towards strong light attributes. Construct a first benchmark correction model based on the integral intensity of the near-infrared band and a second benchmark correction model based on the integral intensity of the visible light band. Perform pixel-by-pixel linear weighted fusion of the first corrected spectrum output by the first benchmark correction model and the second corrected spectrum output by the second benchmark correction model using the fusion weight coefficient to obtain the final corrected spectrum that eliminates the jump at the light field partition boundary.

[0026] S5. Use the random frog-jumping algorithm to filter nutrient-related feature band data from the final corrected spectrum; call the pre-trained first regression model parameters (corresponding to the strong light correction benchmark) to calculate the feature band data to obtain the first candidate nutrient content; call the pre-trained second regression model parameters (corresponding to the weak light correction benchmark) to calculate the feature band data to obtain the second candidate nutrient content; use the fusion weight coefficient to perform linear weighted fusion of the first candidate nutrient content and the second candidate nutrient content to obtain the final nutrient content.

[0027] S6. Based on the spatial coordinates of crop canopy pixels in the original hyperspectral image, the calculated final nutrient content values ​​are mapped back into the two-dimensional matrix one by one to reconstruct the pixel-by-pixel final nutrient content data with spatial topological relationships. Then, the pixel-by-pixel data is mapped into a pseudo-color image to generate a crop canopy nutrient spatial distribution map that reflects the true growth status of the crop.

[0028] Please see Figure 1 The present invention also provides a crop canopy nutrient detection device, comprising: Image acquisition module 101 is used to control the hyperspectral imaging device to acquire raw hyperspectral image data of crop canopy, perform radiometric correction and background removal processing, and output pure crop canopy image data. The parameter iteration construction module 102 is used to construct a calculation model for optical field heterogeneity characterization parameters. The optimal red-edge modulation coefficient is determined by traversal search and cluster evaluation index calculation, and an optical field heterogeneity characterization parameter map is generated to characterize the optical field properties. The continuous partitioning analysis module 103 is used to receive the light field heterogeneity characterization parameter map and calculate the Euclidean distances from the light field heterogeneity characterization parameter values ​​of crop canopy pixels to the cluster centers of strong light regions and weak light regions, respectively. The spectral fusion correction module 104 is used to calculate the fusion weight coefficient based on the Euclidean distance, and to perform weighted fusion on the spectral data after near-infrared normalization and visible light normalization based on the coefficient. The nutrient inversion detection module 105 is used to calculate the content of the candidate nutrients using regression models based on the corresponding strong light and weak light benchmarks, and to perform secondary fusion of the results based on the fusion weight coefficient to calculate the final crop nutrient content value. The visualization output module 106 is used to convert nutrient content values ​​into visualization images, generate and display a spatial distribution map of crop canopy nutrients; The nutrient detection device also includes a hyperspectral imaging acquisition module 1. A display screen 5 is installed on the outside of the hyperspectral imaging acquisition module 1. From left to right, the bottom of the display screen 5 has a charging interface 2, a USB interface 3, and an SD card slot 4. The installation of the display screen 5 facilitates the use of the device by the staff. The opening of various interfaces allows the hyperspectral imaging acquisition module 1 to be connected to various components.

[0029] Please see the appendix Figure 2 In a preferred embodiment of the present invention, step S101 involves acquiring raw hyperspectral image data of the crop canopy using a hyperspectral imaging device. The hyperspectral imaging device has a spectral response range covering the visible to near-infrared band, specifically 500 nm to 900 nm, with a spectral resolution better than 5 nm. During data acquisition, the hyperspectral imaging device is mounted on a mobile monitoring platform, with the lens positioned vertically downwards to capture spatial spectral cube data containing the crop canopy and its growing environment. The specific focusing, exposure time settings, and push-broom imaging control logic of the hyperspectral imaging device are conventional techniques used by those skilled in the art and will not be elaborated upon here.

[0030] Step S102: Perform radiometric correction on the acquired raw hyperspectral image data, converting the raw digital quantization values ​​into physically meaningful spectral reflectance data. This step requires standard white board data acquired under the same illumination conditions and dark current data acquired under shading conditions. The specific correction logic is as follows: calculate the difference between the raw digital quantization value and the sensor dark current noise value, divide it by the difference between the standard white board calibration value and the sensor dark current noise value, and thus obtain the corrected spectral reflectance data. Through this step, a full-band reflectance image matrix is ​​obtained, serving as the basic data source for subsequent processing.

[0031] ; Step S103: Perform background removal processing based on spectral reflectance data. A binary mask is constructed to separate soil, weeds, and non-canopy background pixels from the image. In this embodiment, the optimized soil-adjusted vegetation index is selected as the background segmentation feature. This index introduces a soil adjustment factor, which can effectively suppress soil background noise. The calculation process selects reflectance values ​​in the near-infrared band. Reflectivity values ​​in the red band The calculation formula is as follows: After calculation, a background removal threshold is set (e.g., 0.2). The optimized soil vegetation index value of each pixel is compared with the background removal threshold one by one to generate a binary mask matrix with the same spatial size as the original image. When the index value of a pixel is greater than the background removal threshold, the pixel is determined to belong to the crop canopy and marked as retained in the binary mask matrix; otherwise, the pixel is determined to belong to the background and marked as removed. Finally, logical operations are performed using this binary mask matrix and the corrected spectral reflectance image, retaining only the spectral data marked as crop canopy for subsequent calculations.

[0032] Please see the appendix Figure 3 , Figure Three This is a schematic diagram of the construction process for constructing optical field heterogeneity characterization parameters based on iterative optimization according to an embodiment of the present invention. In a preferred embodiment of the present invention, step S201: Feature integral calculation is performed on the crop canopy spectral reflectance data after background removal to extract the reference spectral features reflecting light intensity and structural information. For each crop canopy pixel, the sum of its spectral reflectance values ​​in each band within the visible light band is calculated to obtain the visible light integrated intensity; the sum of its spectral reflectance values ​​in each band within the near-infrared band is calculated to obtain the near-infrared integrated intensity. Simultaneously, two characteristic wavelengths within the red-edge region are selected, and the ratio of the reflectance difference between the two wavelengths to the wavelength difference is calculated to obtain the red-edge response factor.

[0033] Step S202: Construct a calculation model for the optical field heterogeneity characterization parameters, including the undetermined red-edge modulation coefficient. This model defines the optical field heterogeneity characterization parameter as the ratio of the visible light integrated intensity to the near-infrared integrated intensity, multiplied by a correction term including the red-edge response factor and the red-edge modulation coefficient. The calculation formula is as follows: ; In the formula, This indicates that, given the red-edge modulation coefficient The pixels calculated below The optical field heterogeneity characterization parameter values, The integral intensity of visible light. The near-infrared integrated intensity, Red-edge response factor The positive real red-edge modulation coefficient is to be determined.

[0034] Step S203: Determine the optimal red-edge modulation coefficient using an iterative optimization algorithm. Set the numerical search interval and iteration step size for the red-edge modulation coefficient. Within the search interval, sequentially select candidate values ​​for the red-edge modulation coefficient according to the iteration step size, and perform the following iterative operation: For the current candidate value, substitute it into the model from step S202 to calculate the distribution of light field heterogeneity characterization parameters for all crop canopy pixels in the entire image. Use the K-means clustering algorithm to divide this distribution data into two clusters. Calculate the Davidson-Bourdin index of the clustering results as an evaluation index. The smaller the index value, the denser the clusters and the higher the separation between clusters. After traversing all candidate values, compare the Davidson-Bourdin indices calculated in each iteration, and select the candidate value that minimizes the Davidson-Bourdin index as the optimal red-edge modulation coefficient.

[0035] Step S204: Based on the determined optimal red-edge modulation coefficients, substitute them into the calculation model from step S202 to recalculate the parameter values ​​of all crop canopy pixels, generating the final light field heterogeneity characterization parameter map. The pixel values ​​in this map are denoted as follows: The numerical distribution characteristics in this parameter graph can reflect the differences in the physical properties of the crop canopy under different light conditions, serving as input data for subsequent continuous field partitioning.

[0036] Please see the appendix Figure 4 , Figure 4This is a schematic diagram of the continuous partitioning analysis process of the light field based on the distance between cluster centers according to an embodiment of the present invention. In a preferred embodiment of the present invention, step S301: Obtain the light field heterogeneity characterization parameter map generated by the previous steps, and perform a secondary clustering operation on it to determine the light field reference point. The K-means clustering algorithm is used to process the values ​​of all valid pixels in the light field heterogeneity characterization parameter map, and the number of clusters is set to 2. After the clustering iteration converges, the centroid values ​​of the two clusters are extracted. Based on the physical characteristics of the light field heterogeneity characterization parameters, the centroid corresponding to the characteristics of the strong light direct irradiation environment is marked as the cluster center of the strong light region. The centroids corresponding to the characteristics of low-light / shade environments are marked as cluster centers for low-light regions. .

[0037] Step S302: Construct a light field attribute measurement mechanism based on Euclidean distance. For each pixel in the light field heterogeneity characterization parameter map, calculate the distance from its parameter value to the two cluster centers determined in step S301. The specific calculation logic is as follows: calculate the absolute value of the difference between the light field heterogeneity characterization parameter value of the pixel and the value of the cluster center in the strong light region, and define this absolute value as the first distance; calculate the absolute value of the difference between the light field heterogeneity characterization parameter value of the pixel and the value of the cluster center in the weak light region, and define this absolute value as the second distance. The calculation formula is as follows: ; ; In the formula, For cell index, For pixels The optical field heterogeneity characterization parameter values, The values ​​represent the cluster centers of areas with strong light. The values ​​represent the cluster centers in low-light regions. The first distance, This is the second distance.

[0038] Step S303: Based on the first and second distances, generate a distance metric matrix describing the light field distribution state of the entire image. This step transforms the problem of pixel classification into a continuous quantitative description of the degree of deviation from the cluster centers. Subsequent steps will use this distance metric matrix to calculate the spectral fusion weights.

[0039] Please see the appendix Figure 5 , Figure 5This is a schematic diagram of a differential spectral correction process based on transition zone weighted fusion according to an embodiment of the present invention. In a preferred embodiment of the present invention, step S401: Construct a first benchmark correction model for strong light attributes. Under direct strong light conditions, the crop canopy spectrum is mainly affected by specular reflection and canopy structure angle effects. This embodiment uses the near-infrared band integrated intensity to normalize the original spectrum to suppress structural differences. The specific calculation logic is as follows: For any pixel, take its original spectral reflectance value, divide it by the sum of the near-infrared band integrated intensity of that pixel and the first smoothing constant, and the calculated result is recorded as the first corrected spectrum. .

[0040] Step S402: Construct a second baseline correction model for low-light properties. Under shadow or low-light conditions, the spectral signal is dominated by scattered light, and the illumination energy is relatively insufficient. In this embodiment, the original spectrum is normalized using the integrated intensity of the visible light band to compensate for the dynamic range of light intensity. The specific calculation logic is as follows: For any pixel, its original spectral reflectance value is taken and divided by the sum of the integrated intensity of the visible light band of that pixel and the second smoothing constant. The calculated result is recorded as the second corrected spectrum. .

[0041] Step S403: Using the first and second distances calculated in the previous steps, calculate the fusion weight coefficient for each crop canopy pixel. This coefficient quantifies the degree to which the pixel's light field attributes are biased towards the strong light region. The fusion weight coefficient is defined as the proportion of the second distance in the sum of the first and second distances, and the weights are allocated using the inverse distance weighting principle. The calculation formula is as follows: ; In the formula, For pixels The fusion weight coefficient. According to this formula, when the pixel feature is close to the cluster center of the strong light region ( When the pixel features are close to the cluster center of the weak light region, the fusion weight coefficient approaches 1; conversely, when the pixel features are close to the cluster center of the weak light region, the fusion weight coefficient approaches 0.

[0042] Step S404: Based on the fusion weighting coefficients, the first and second corrected spectra are linearly weighted and fused to generate the final corrected spectrum. This step reconstructs the smooth transition characteristics of the light field from the bright area to the shadow area in the spectral dimension through pixel-by-pixel weighted calculation. The formula for calculating the final corrected spectrum is as follows: ; In the formula, For pixels At wavelength The final corrected spectral reflectance at the location. Through this step, the obtained full-image spectral data eliminates spectral numerical jumps at the boundaries of the light field partitions.

[0043] Please see the appendix Figure 6 , Figure 6 This is a schematic diagram of the construction and inversion process of a nutrient detection model based on adaptive light field constraints according to an embodiment of the present invention. In a preferred embodiment of the present invention, step S501: Feature band screening is performed on the final corrected spectrum. Given the large amount of data across all bands and the existence of information redundancy, this embodiment uses a random frog-jumping algorithm to select variables in the final corrected spectrum. This algorithm ranks the importance of bands based on their selection probability, and determines bands with selection probabilities higher than a preset screening threshold as feature bands highly correlated with crop nutrient content. Through this step, data from several key feature wavelength points are extracted.

[0044] Step S502: Establish a differentiated regression model library based on light field partitioning. During the offline training phase, crop sample data under strong light irradiation conditions and crop sample data under weak light shading conditions are collected respectively. Specifically, for the collected strong light sample data, the same first baseline correction processing as in step S401 is performed, i.e., divided by the near-infrared integrated intensity, and the processed spectral data is used to train the first regression model; for the collected weak light sample data, the same second baseline correction processing as in step S402 is performed, i.e., divided by the visible light integrated intensity, and the processed spectral data is used to train the second regression model. This embodiment uses the partial least squares regression algorithm to train the above two models, extracting the parameters (coefficient vector) of the first regression model suitable for strong light environments. and intercept ) and the parameters (coefficient vector) of the second regression model applicable to low-light environments. and intercept ).

[0045] Step S503: Perform dual-model prediction calculations for each crop canopy pixel. Obtain the final corrected spectral data vector for that pixel in the characteristic bands. The content of the first candidate nutrient was calculated using the parameters of the first regression model: ; The content of the second candidate nutrient was calculated using the parameters of the second regression model: ; Step S504: Perform linear fusion of the inversion results based on the fusion weighting coefficients. To ensure the spatial continuity of the nutrient distribution map, the fusion weighting coefficients calculated in step S403 are used. The final nutrient content is obtained by weighting the contents of the two candidate nutrient solutions. The calculation formula is as follows: ; This soft fusion strategy ensures that the detection results can transition smoothly in the light and shadow transition area, avoiding numerical discontinuities caused by hard model switching.

[0046] Please see the appendix Figure 7 , Figure 7 This is a schematic diagram of the nutrient spatial distribution visualization generation process according to an embodiment of the present invention. In a preferred embodiment of the present invention, step S601: Construct a two-dimensional spatial distribution matrix of crop nutrient content. The binary mask matrix generated in step S103 is used as a spatial index reference. A zero matrix or an empty matrix with the same spatial resolution as the original hyperspectral image is created. Each pixel position in the binary mask matrix is ​​traversed. If the position is marked as crop canopy, the corresponding value is extracted from the crop nutrient content result sequence calculated in step S504 and filled into the spatial position; if the position is marked as background, the value of the spatial position is set as a preset background identifier value.

[0047] Step S602: Perform pseudo-color mapping processing based on numerical dynamic range. To convert single-channel nutrient content values ​​into a color image recognizable by the human eye, this embodiment employs color lookup table technology for rendering. First, the nutrient content values ​​of all valid crop pixels in the two-dimensional spatial distribution matrix are statistically analyzed. To avoid outliers affecting the display effect, a percentile truncation method is used to determine the dynamic range of the displayed values. A linear stretching algorithm is then used to normalize the nutrient content values ​​within this range to a preset color index interval. Subsequently, according to a preset color gradient scheme, such as a gradient from blue representing low content to red representing high content, the normalized index values ​​are mapped to the corresponding RGB three-channel color components. For background indicator values, they are directly mapped to black or white.

[0048] Step S603: Generate and output a nutrient distribution map with a quantized scale. Combine the mapped RGB three-channel data to generate a digital image file. Add color bars to the edge regions of the image; these color bars correspond to the dynamic range boundary values ​​determined in step S602, indicating the quantitative correspondence between color and specific nutrient concentrations. This nutrient distribution map accurately reflects the growth differences of crops in the field at the pixel-level, providing direct data support for the generation of variable fertilizer prescription maps.

[0049] Application Examples: This embodiment selects a winter wheat field at the jointing stage from an agricultural experimental base in the North China Plain as the test object. The main objective is to detect the nitrogen content in the canopy leaves of winter wheat to guide subsequent topdressing operations.

[0050] 1. Data Acquisition and Preprocessing The image was captured using a DJI M600 Pro drone equipped with a GaiaField-Pro pushbroom hyperspectral imager. The data acquisition time was set at 11:30 AM, with a solar altitude angle of approximately 55 degrees, and the canopy exhibited obvious self-shading and structural texture.

[0051] Spectral range: 400-1000 nm, resampled to 176 bands.

[0052] Radiometric correction: Reflectance inversion was performed using a 50% grayscale target deployed on the ground.

[0053] Background Removal: The soil adjusted vegetation index was calculated, with 670nm selected for the red light band and 800nm ​​for the near-infrared band. A threshold of 0.25 was set, and the generated binary mask effectively removed the background between soil rows.

[0054] Construction of light field heterogeneity characterization parameters Execute the algorithm in the MATLAB R2025a environment.

[0055] Integral calculation: The integration range is set to 450-680nm. The integration range is set to 750-950nm.

[0056] Red-edge response factor: The normalized difference between 705nm and 750nm was calculated.

[0057] Parameter optimization: Setting the red-edge modulation coefficient The search interval is [0.1, 3.0], with a step size of 0.1. The program automatically iterates and calculates, when... When, K-means clustering ( The Davidson-Bourdon Index (DBI) reached its minimum value of 0.84 after this. At this point, the generated parameter map can clearly distinguish between the illuminated and shaded sides of the canopy.

[0058] Continuous partitioning and spectral fusion Cluster center: based on The parameter diagram was used to obtain the center of the strong light. and dim light center .

[0059] Weight calculation: Calculate the Euclidean distance and fusion weight coefficients for all image pixels. At the top of the canopy where light is received, The values ​​range from 0.85 to 0.98; in the deeper regions where leaves overlap, Values ​​range from 0.15 to 0.30; light and shadow transition area The value changes linearly.

[0060] Nutrient Inversion Model Feature bands: Twelve feature bands related to nitrogen content were selected using the random frog jumping algorithm (mainly concentrated in the red edge 710-740nm and near the near infrared 850nm).

[0061] Dual-model regression: Model A (Strong Light Library): Trained based on samples from the sunlit side, with 6 principal components in the partial least squares regression (PLSR).

[0062] Model B (Low Light Library): Trained based on occluded surface samples, with 8 principal components in the PLSR.

[0063] Results: Output a nitrogen content distribution map of winter wheat with a spatial resolution of 5cm. The color transitions are natural, and there are no "spot-like" data gaps or abrupt edge changes as seen in traditional shadow removal algorithms. Baseline Correction: The strong light model employs NIR integral intensity normalization to suppress specular highlights. The weak light model employs VIS integral intensity normalization to improve the signal-to-noise ratio in dark areas. The final corrected spectrum is a weighted synthesis of the two, eliminating spectral distortions in the original image caused by different illumination angles on the same wheat plant.

[0064] Nutrient inversion model: Feature bands: Twelve feature bands related to nitrogen content were selected using the random frog jumping algorithm (mainly concentrated in the red edge 710-740nm and near the near infrared 850nm).

[0065] Dual-model regression: Model A (Strong Light Library): Trained based on samples from the sunlit side, with 6 principal components in the partial least squares regression (PLSR).

[0066] Model B (Low Light Library): Trained based on occluded surface samples, with 8 principal components in the PLSR.

[0067] Results generated: Output a distribution map of nitrogen content in winter wheat with a spatial resolution of 5cm. The color transition is natural and there are no "spot-like" data gaps or edge mutations caused by traditional shadow removal algorithms.

[0068] To verify the effectiveness of this scheme, the following comparative experiment was set up: Method 1 (Traditional Global Model): Only standard radiometric correction is performed, and a single PLSR model is used to invert the entire map.

[0069] Method 2 (Hard Threshold Partitioning): Based on the light intensity, a fixed threshold is set to divide the image into two parts: bright and dark. Model inversion is built for each part, and no processing is done at the boundary.

[0070] The method of this invention adopts a continuous optical field partitioning and weighted fusion strategy based on iterative optimization of the red-edge modulation coefficient.

[0071] Sixty ground sampling points (including 20 areas with sufficient sunlight, 20 areas with severe shading, and 20 areas with penumbra transition) were selected in the experimental field for destructive sampling. The true value of leaf nitrogen content was determined (Kjeldahl method), and compared with the inversion values ​​of the three methods.

[0072] Experimental data: Comparison of accuracy of winter wheat canopy nitrogen content inversion under different treatment strategies From the table above, we can see that: Method 1 performs reasonably well in areas with strong direct sunlight (e.g., Sample_01, error only 2.46%), but exhibits a significant tendency to underestimate in shaded areas (e.g., Sample_09, Sample_33), with relative errors generally exceeding 20% ​​in absolute value, reaching a maximum of 32.5696. This indicates that the spectral reflectance without optical field correction is distorted in the shaded area, causing the single regression model to fail. This invention effectively quantifies the differences in lighting environment by constructing optical field heterogeneity characterization parameters that include the optimal red-edge modulation coefficient, which is the physical basis for achieving high-precision detection.

[0073] Observing samples in the penumbra transition region (such as Sample_15 and Sample_41), Method 2 (hard threshold partitioning) exhibits significant instability. In Sample_15, due to the discontinuity of the threshold partitioning, the sample point may be misclassified or experience a jump due to model switching, resulting in a positive error of 12.29%. In contrast, this invention employs a linear weighted fusion mechanism based on cluster center distance, reducing the error of Sample_15 to -1.66%. This is achieved through the fusion weight coefficients. This achieves a smooth transition from the strong light model to the weak light model, eliminating the numerical discontinuity caused by hard classification.

[0074] In regions with complex structures (such as Sample_22 and Sample_45), the canopy geometry leads to extremely uneven illumination. This invention constructs benchmark correction models based on near-infrared and visible light integrals for both strong and weak light, and combines them with a bi-regression model for inversion. Data shows that the relative error of this invention is controlled within 2% across all illumination attribute samples. The accuracy reached 0.94, significantly better than 0.58 of Method 1 and 0.81 of Method 2. In summary, this invention, through iterative optimization to determine the light field heterogeneity characterization parameters, combined with a distance-weighted spectral and model dual fusion mechanism, effectively solves the technical problems of low nutrient detection accuracy and discontinuous spatial distribution caused by canopy geometry and uneven illumination in near-ground hyperspectral imaging, achieving high-precision quantitative inversion of crop nutrients across all weather conditions and the entire canopy.

[0075] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for correcting crop canopy light field spectral data, characterized in that, The method includes the following steps: A computational model for optical field heterogeneity characterization parameters, including the red-edge modulation coefficient, is constructed. The optimal red-edge modulation coefficient is determined by traversal search, and an optical field heterogeneity characterization parameter map is generated. Based on the optical field heterogeneity characterization parameter map, clustering is used to determine the cluster centers of strong light and weak light regions, and the distance from the pixel to the two cluster centers is calculated to generate the fusion weight coefficient. A first benchmark correction model corresponding to strong light attribute and a second benchmark correction model corresponding to weak light attribute are constructed. The correction spectra output by the two models are weighted and fused using the fusion weight coefficients to obtain the final correction spectrum. The regression models corresponding to strong light and weak light benchmarks are called respectively to calculate the content of the nutrient to be selected, and the results are fused a second time based on the fusion weight coefficient to obtain the final nutrient content.

2. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The background removal based on the optimized soil-adjusted vegetation index after radiometric correction specifically includes: converting the digital quantization values ​​of the original hyperspectral image data into spectral reflectance data using standard whiteboard data and dark current data; selecting near-infrared band reflectance values ​​and red band reflectance values ​​to calculate the optimized soil-adjusted vegetation index, which incorporates soil adjustment factors; setting a background removal threshold; comparing the optimized soil-adjusted vegetation index with the background removal threshold pixel by pixel to generate a binary mask; using the binary mask to retain the spectral data determined to be crop canopy and remove background pixels determined to be soil or weeds.

3. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The construction of the optical field heterogeneity characterization parameter calculation model including the red-edge modulation coefficient specifically refers to: for each crop canopy pixel, calculating the sum of spectral reflectance values ​​in the visible light band as the visible light integrated intensity, and calculating the sum of spectral reflectance values ​​in the near-infrared band as the near-infrared integrated intensity; selecting two characteristic wavelengths in the red-edge region to calculate the ratio of the reflectance difference to the wavelength difference as the red-edge response factor; the optical field heterogeneity characterization parameter calculation model is defined as: multiplying the ratio of the visible light integrated intensity to the near-infrared integrated intensity by a correction term including the red-edge response factor and the red-edge modulation coefficient, wherein the red-edge modulation coefficient is used to adjust the contribution of red-edge information to optical field heterogeneity.

4. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The step of determining the optimal red-edge modulation coefficient through traversal search specifically includes: setting a numerical search interval and iteration step size for the red-edge modulation coefficient; sequentially selecting candidate values ​​for the red-edge modulation coefficient within the search interval; for each candidate value, calculating the distribution of light field heterogeneity characterization parameters for all crop canopy pixels in the image; performing K-means clustering analysis on the distribution data and calculating the Davidson-Bourdin index; comparing the Davidson-Bourdin indices obtained from each iteration, and selecting the candidate value that minimizes the Davidson-Bourdin index as the optimal red-edge modulation coefficient.

5. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The calculation of the distance from the pixel to the two cluster centers specifically includes: performing clustering operations on the light field heterogeneity characterization parameter map, extracting the centroid corresponding to the characteristics of the strong light direct environment as the strong light region cluster center, and extracting the centroid corresponding to the characteristics of the weak light shadow environment as the weak light region cluster center; calculating the absolute value of the difference between the light field heterogeneity characterization parameter value of the current pixel and the value of the strong light region cluster center as the first distance; and calculating the absolute value of the difference between the light field heterogeneity characterization parameter value of the current pixel and the value of the weak light region cluster center as the second distance.

6. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The generation of the fusion weight coefficient specifically refers to: defining the fusion weight coefficient as the degree to which a pixel is biased towards strong light attributes; calculating the proportion of the second distance in the sum of the first distance and the second distance, and determining the proportion value as the fusion weight coefficient, such that when the pixel feature is close to the cluster center of the strong light region, the fusion weight coefficient approaches a first preset extreme value, and when the pixel feature is close to the cluster center of the weak light region, the fusion weight coefficient approaches a second preset extreme value.

7. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The weighted fusion of the corrected spectra output by the two models using fusion weight coefficients specifically includes: constructing a first benchmark correction model, which outputs a first corrected spectrum by dividing the original spectral reflectance value by the sum of the near-infrared band integral intensity and a first smoothing constant to suppress structural differences; constructing a second benchmark correction model, which outputs a second corrected spectrum by dividing the original spectral reflectance value by the sum of the visible light band integral intensity and a second smoothing constant to compensate for the dynamic range of light intensity; using the fusion weight coefficients as the weights of the first corrected spectrum and the difference between the first and second corrected spectra as the weights of the second corrected spectrum, performing a band-by-band linear weighted summation on the two to generate a final corrected spectrum that eliminates the abrupt changes at the light field partition boundaries.

8. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The step of calculating the content of candidate nutrients by calling the regression models corresponding to strong light and weak light benchmarks respectively includes: using a random frog-jumping algorithm to screen nutrient-related feature band data from the final corrected spectrum; obtaining the first regression model parameters pre-trained using strong light sample data after first benchmark correction, and the second regression model parameters pre-trained using weak light sample data after second benchmark correction; substituting the feature band data into the first regression model parameters and the second regression model parameters respectively to calculate the content of the first candidate nutrient and the content of the second candidate nutrient respectively.

9. The method for correcting crop canopy light field spectrum data according to claim 1, characterized in that, The method further includes the step of generating a spatial distribution map of crop canopy nutrients: constructing a two-dimensional spatial distribution matrix with the same spatial resolution as the original hyperspectral image; using a binary mask generated in the background removal stage as an index; filling the calculated final nutrient content into the corresponding crop canopy pixel position; setting the background position to a preset background identifier value; statistically analyzing the nutrient content distribution of effective crop pixels; determining the dynamic range of the values ​​using the percentile truncation method; mapping the values ​​to a pseudo-color image using a color lookup table; and adding color bars corresponding to the boundary values ​​of the dynamic range at the image edges.

10. A nutrient detection device, characterized in that, The crop canopy light field spectral data correction method according to any one of claims 1-9 includes: The image acquisition module is used to control the hyperspectral imaging equipment to acquire data and perform radiometric correction and background removal; The parameter iteration construction module is used to construct a calculation model for optical field heterogeneity characterization parameters and determine the optimal red-edge modulation coefficient; The continuous partitioning parsing module is used to calculate cluster centers and the distance from a cell to a cluster center; The spectral fusion correction module is used to calculate the fusion weight coefficient and perform weighted fusion of spectra after different normalization processes based on the coefficient. The nutrient inversion detection module is used to calculate the content of candidate nutrients using a double regression model and perform a second weighted fusion. The visualization output module is used to generate spatial distribution maps of crop canopy nutrients; The nutrient detection device also includes a hyperspectral imaging acquisition module (1), on the outside of which a display screen (5) is installed. The bottom of the display screen (5) is provided with a charging interface (2), a USB interface (3) and an SD card slot (4) from left to right.