Method, system, medium and equipment for predicting yield of corn with different nitrogen gradients
By generating field visual images of GDNVI vegetation index and performing binary processing, the OTSU algorithm is used to separate the foreground and background, and the white pixel ratio is calculated for one-variable linear regression analysis, solving the complexity of multi-spectral drone data processing, and achieving fast and efficient corn yield prediction.
Patent Information
- Application Number
- CN202510672800.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-29
AI Technical Summary
The existing multispectral drone data processing requires complex software and high technical thresholds, which consumes time and makes it difficult to quickly and accurately predict corn yields.
By generating field visual images of GDNVI vegetation index, pre-processing and binarization, the OTSU algorithm is used to separate the foreground and background, calculate the white pixel ratio for one-variable linear regression analysis, and directly predict corn yield.
The analysis process is simplified, the analysis efficiency is improved, the technical threshold is reduced, and the prediction accuracy is 90.6%.
Smart Images

Figure CN120564043A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of crop yield prediction, and in particular to a method, system, medium and equipment for predicting corn yields with different nitrogen gradients using a multispectral unmanned aerial vehicle. Background Art
[0002] Crops have spectral characteristics, absorbing, reflecting, and radiating different light spectrums. Various sensors used in agricultural drone remote sensing technology can detect these spectral characteristics of plants. Different wavelengths of light have different effects on crop growth. Sensors mounted on drones can collect crop images in different wavelength bands and extract different characteristics.
[0003] Typically, multispectral drone data is used to calculate vegetation indices such as NDVI (Naturalized Differential Vegetation Index), GNDVI (Green Naturalized Vegetation Index), RVI, and DVI. Crop yield estimation models based on these vegetation indices have achieved a certain level of accuracy. However, most drone multispectral data processing requires software such as GIS, ENV, and MATLAB, and requires segmentation based on ROIs. This process is costly, technically challenging, and time-consuming. Summary of the Invention
[0004] In response to the above problems, the purpose of the present invention is to provide a method, system, medium and equipment for predicting corn yield with different nitrogen gradients, which can improve analysis efficiency, lower the analysis threshold and have high prediction accuracy.
[0005] To achieve the above-mentioned objectives, in the first aspect, the technical solution adopted by the present invention is: a method for predicting corn yield with different nitrogen gradients, which comprises: obtaining aerial images of corn experimental fields with different nitrogen gradients, generating field visualization images of the GDNVI vegetation index, and preprocessing the field visualization images to divide the field visualization images into multiple sub-images; generating grayscale images for all sub-images, binarizing them, merging the channels of all sub-images to generate a complete binarized image, and optimizing the complete binarized image to effectively separate the foreground and background; obtaining the number of white pixels in the binarized image, and calculating its ratio to the total pixels, performing univariate linear regression analysis on the ratio to obtain the predicted yield.
[0006] Furthermore, aerial images of corn experimental fields with different nitrogen gradients were obtained to generate field visualization images of the GDNVI vegetation index, including: Aerial images of corn fields with different nitrogen gradients were obtained using drones; The aerial image data is mosaicked to generate a field visualization image of the GDNVI vegetation index.
[0007] Furthermore, the field visualization image is preprocessed to divide the field visualization image into multiple sub-images, including: The field visualization image is evenly segmented according to a regular grid to divide the large-size field visualization image into multiple sub-images of sub-regions, each sub-region having the same size.
[0008] Furthermore, all sub-images are converted into grayscale images and binarized, including: Traverse all sub-images, extract the pixel values of the three channels of blue B, green G, and red R, and calculate based on the vegetation index formula; The calculation results are mapped to the range of 0 to 255 through normalization processing to generate an eight-bit grayscale image to enhance the contrast of the vegetation area; According to the histogram distribution of the grayscale image, the threshold is adjusted, all sub-images are initially binarized, and according to the grayscale distribution, a fixed threshold is set to distinguish the target area from the background.
[0009] Furthermore, the complete binary image is optimized to effectively separate the foreground and background, including: The OTSU algorithm is used to perform secondary optimization on the binary image; OTSU traverses all possible thresholds, calculates the inter-class variance, and adaptively determines the optimal threshold to effectively separate the foreground from the background.
[0010] Furthermore, the number of white pixels in the binary image is obtained, and its ratio to the total pixels is calculated as follows: Red percentage = (number of white pixels / total number of pixels in the image) × 100%.
[0011] Furthermore, the predicted output is: Forecasted Output = × Red percentage+
[0012] In the formula, the unit of predicted yield is kg / hectare; is the regression coefficient, is the intercept, in kg / hectare.
[0013] In the second aspect, the technical solution adopted by the present invention is: a corn yield prediction system with different nitrogen gradients, which includes: an image processing module, which obtains aerial images of corn experimental fields with different nitrogen gradients, generates field visualization images of the GDNVI vegetation index, and preprocesses the field visualization images to divide the field visualization images into multiple sub-images; a binarization module, which generates grayscale images of all sub-images, performs binarization processing, merges the channels of all sub-images to generate a complete binarized image, and optimizes the complete binarized image to effectively separate the foreground and background; a yield prediction module, which obtains the number of white pixels in the binarized image, calculates its ratio to the total pixels, performs univariate linear regression analysis on the ratio, and obtains the predicted yield.
[0014] In a third aspect, the technical solution adopted by the present invention is: a computer-readable storage medium storing one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by a computing device, the computing device executes any one of the above methods.
[0015] In a fourth aspect, the technical solution adopted by the present invention is: a computing device, comprising: one or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the above methods.
[0016] The present invention has the following advantages due to the adoption of the above technical solution: Compared with the existing technology, the present invention is simple and fast; the present invention skips the process of analyzing multispectral data and can directly analyze the vegetation index map, effectively improving the analysis efficiency, lowering the analysis threshold, and ensuring the accuracy of yield prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flow chart of a method for predicting corn yield at different nitrogen gradients according to an embodiment of the present invention; Figure 2 is a schematic diagram of dividing an original image into multiple sub-images in an embodiment of the present invention; Figure 3 The binarized image is obtained after the GNDVI image of the cell in the embodiment of the present invention is binarized; Figure 4 1 is a comparison chart of the predicted output and the actual output in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the described embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of the present invention.
[0019] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0020] In one embodiment of the present invention, a method for predicting corn yield at different nitrogen gradients is provided. In this embodiment, Figure 1 As shown, the method includes the following steps: 1) Obtain aerial images of corn experimental fields with different nitrogen gradients, generate field visualization images of the GDNVI vegetation index, and preprocess the field visualization images to divide them into multiple sub-images; 2) Generate grayscale images of all sub-images, perform binarization, merge the channels of all sub-images to generate a complete binary image, and optimize the complete binary image to effectively separate the foreground and background; 3) Obtain the number of white pixels in the binary image and calculate its ratio to the total pixels. Perform a univariate linear regression analysis on the ratio to obtain the predicted yield.
[0021] In this embodiment, corn is used as an example for illustration. Corn was sown in a test field with different nitrogen gradients, with four nitrogen fertilizer gradients of 0 kg nitrogen / hectare, 120 kg nitrogen / hectare, 200 kg nitrogen / hectare, and 280 kg nitrogen / hectare, three corn materials, three replicates, and each replicate was 12 square meters.
[0022] In step 1) above, obtaining aerial images of the corn experimental fields with different nitrogen gradients and generating field visualization images of the GDNVI vegetation index include the following steps: 1.1) Use drones to obtain aerial images of the corn field with different nitrogen gradients; 1.2) Patch the aerial image data to generate a field visualization image of the GDNVI vegetation index.
[0023] In this example, aerial photography of the experimental field was performed during the filling period using a DJI Phantom 4 Multispectral UAV. The flight path was planned using DJI GS PRO software, with an altitude of 50 meters, an 80% overlap, and a ground resolution of 2.4 cm / px. The aerial data was then mapped using DJI Zhitu software to generate a field visualization of the GDNVI vegetation index.
[0024] In the above step 1), the field visualization image is preprocessed to divide the field visualization image into multiple sub-images. Specifically, the field visualization image is evenly divided according to a regular grid to divide the large-size field visualization image into multiple sub-images of sub-regions, and each sub-region has the same size.
[0025] In this embodiment, the original image is evenly divided into regular grids using Photoshop's slicing tool (e.g., Figure 2 The purpose of this method is to divide a large image into multiple sub-regions for subsequent block-by-block processing. When dividing the sub-regions, ensure that each sub-region is of the same size to avoid statistical deviations caused by uneven sizes in edge areas.
[0026] In the above step 2), all sub-images are converted into grayscale images and binarized, which includes the following steps: 2.1) Traverse all sub-images, extract the pixel values of the blue B, green G, and red R channels, and calculate based on the vegetation index formula; 2.2) Map the calculated results to the range of 0 to 255 through normalization processing to generate an eight-bit grayscale image to enhance the contrast of the vegetation area and provide a basis for binarization; 2.3) According to the histogram distribution of the grayscale image, adjust the threshold and perform preliminary binarization of all sub-images (e.g. Figure 3 As shown in FIG, and according to the grayscale distribution, a fixed threshold value (eg, 160) is set to distinguish the target area from the background. In this embodiment, the threshold value is adjusted manually.
[0027] In step 2) above, after obtaining multiple sub-images, the channels of all sub-images are merged to generate a complete binary image. The complete binary image is optimized to effectively separate the foreground and background, including the following steps: 2.4) Use OTSU algorithm to perform secondary optimization on the binary image; 2.5) OTSU traverses all possible thresholds, calculates the inter-class variance, and adaptively determines the optimal threshold to effectively separate the foreground (target area color) from the background.
[0028] Among them, the optimal threshold for:
[0029] Where, 、 The proportion of foreground and background pixels respectively; is the average gray value of the foreground, is the average gray value of the background.
[0030] In the above step 3), in this embodiment, white pixels are used to represent the target area, the number of white pixels in the binary image is obtained, and the ratio of white pixels to the total pixels is calculated as: Red percentage = (number of white pixels / total number of pixels in the image) × 100%.
[0031] In this embodiment, the ratio of the number of white pixels to the total pixels is written into a CSV file according to fields such as sub-image number and ratio value, which can facilitate subsequent analysis.
[0032] In this embodiment, the predicted output is: Predicted yield (kg / hectare) = × Red percentage (%) +
[0033] Where, is the regression coefficient, is the intercept, and the unit is kg / hectare. In this embodiment, after fitting a large amount of data, we can get: =11506, =2113.4.
[0034] In the above embodiment, after step 3), a verification step is further included: obtaining the standard moisture yield of corn in the experimental field, comparing the predicted yield with the actual yield, and determining the prediction accuracy of the predicted yield.
[0035] Specifically, after harvesting the clusters in the plot, thresh the grains, weigh the grains, measure the grain moisture, and calculate the yield under standard moisture. The steps are as follows: (1) The sowing model verification test was conducted with two nitrogen fertilizer gradients of 0 kg nitrogen / ha and 200 kg nitrogen / ha, 40 corn materials, 2 replicates, and 12 square meters per replicate.
[0036] (2) The model validation test used multispectral drones to take aerial photos during the grouting period, and the red percentage of each plot was obtained according to the method of the present invention.
[0037] (3) The predicted output is calculated using the predicted output formula.
[0038] (4) Verification test: After harvest, thresh the grains, weigh the grains, measure the grain moisture, and calculate the yield under standard moisture.
[0039] (5) The accuracy of the predicted and actual yields in the verification test is 90.6%, R=0.905. Figure 4 shown.
[0040] In summary, this invention uses a multispectral drone to predict corn yields across different nitrogen gradients. Aerial photography is highly efficient, with a single flight (half an hour) capturing 100 mu (approximately 100 mu). Image analysis is highly efficient, with analysis of 300 plots taking only one minute. Image analysis is easy to implement, and each step can be packaged as an executable program, making it accessible even to beginners. Prediction accuracy is high, reaching 90.6%. The method is simple, practical, easy to use, and highly accurate, making it suitable for both non-professionals and frontline agricultural workers, facilitating widespread adoption.
[0041] In one embodiment of the present invention, a system for predicting corn yields under different nitrogen gradients is provided, comprising: An image processing module acquires aerial images of the corn field with different nitrogen gradients, generates a field visualization image of the GDNVI vegetation index, and preprocesses the field visualization image to divide the field visualization image into multiple sub-images; The binarization module generates grayscale images for all sub-images. After binarization, it merges the channels of all sub-images to generate a complete binarized image. The complete binarized image is then optimized to effectively separate the foreground and background. The yield prediction module obtains the number of white pixels in the binary image and calculates its ratio to the total pixels. The ratio is subjected to a univariate linear regression analysis to obtain the predicted yield.
[0042] In the above embodiment, obtaining aerial images of corn experimental fields with different nitrogen gradients and generating field visualization images of the GDNVI vegetation index include: Aerial images of corn fields with different nitrogen gradients were obtained using drones; The aerial image data is mosaicked to generate a field visualization image of the GDNVI vegetation index.
[0043] In the above embodiment, the field visualization image is preprocessed to divide the field visualization image into a plurality of sub-images, including: The field visualization image is evenly segmented according to a regular grid to divide the large-size field visualization image into multiple sub-images of sub-regions, each sub-region having the same size.
[0044] In the above embodiment, all sub-images are converted into grayscale images and binarized, including: Traverse all sub-images, extract the pixel values of the three channels of blue B, green G, and red R, and calculate based on the vegetation index formula; The calculation results are mapped to the range of 0 to 255 through normalization processing to generate an eight-bit grayscale image to enhance the contrast of the vegetation area; According to the histogram distribution of the grayscale image, the threshold is adjusted, all sub-images are initially binarized, and according to the grayscale distribution, a fixed threshold is set to distinguish the target area from the background.
[0045] In the above embodiment, the complete binary image is optimized to effectively separate the foreground and background, including: The OTSU algorithm is used to perform secondary optimization on the binary image; OTSU traverses all possible thresholds, calculates the inter-class variance, and adaptively determines the optimal threshold to effectively separate the foreground from the background.
[0046] In the above embodiment, the number of white pixels in the binary image is obtained, and the ratio of white pixels to the total pixels is calculated as: Red percentage = (number of white pixels / total number of pixels in the image) × 100%.
[0047] In the above embodiment, the predicted output is: Predicted yield kg / hectare = × Red percentage +
[0048] Where, is the regression coefficient, is the intercept, in kg / hectare.
[0049] The system provided in this embodiment is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for specific processes and detailed contents, which will not be repeated here.
[0050] In one embodiment of the present invention, a computing device is provided. The computing device may be a terminal and may include: a processor, a communications interface, a memory, a display screen, and an input device. The processor, communications interface, and memory communicate with each other via a communications bus. The processor is configured to provide computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and a computer program. When executed by the processor, the computer program implements the methods described in the above embodiments. The internal memory provides an environment for the operating system and computer program in the non-volatile storage medium to run. The communications interface is configured to communicate with an external terminal via wired or wireless communication. The wireless communication may be achieved via Wi-Fi, a network management service provider, NFC (near field communication), or other technologies. The display screen may be a liquid crystal display or an electronic ink display. The input device may be a touchscreen layer covering the display screen, or may be buttons, a trackball, or a touchpad provided on the computing device housing, or may be an external keyboard, touchpad, or mouse. The processor may invoke logic instructions stored in the memory.
[0051] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0052] In one embodiment of the present invention, a computer program product is provided, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments.
[0053] In one embodiment of the present invention, a non-transitory computer-readable storage medium is provided. The non-transitory computer-readable storage medium stores server instructions. The computer instructions enable a computer to execute the methods provided in the above embodiments.
[0054] The above embodiment provides a computer-readable storage medium, whose implementation principle and technical effects are similar to those of the above method embodiment, and will not be repeated here.
[0055] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0056] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0057] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0058] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for predicting corn yield under different nitrogen gradients, characterized in that: include: Acquire aerial images of corn experimental fields with different nitrogen gradients, generate field visualization images of the GDNVI vegetation index, and preprocess the field visualization images to divide them into multiple sub-images; Generate grayscale images for all sub-images, perform binarization, merge the channels of all sub-images to generate a complete binarized image, and optimize the complete binarized image to effectively separate the foreground and background; The number of white pixels in the binary image is obtained, and its ratio to the total pixels is calculated. The ratio is subjected to a univariate linear regression analysis to obtain the predicted yield.
2. The method for predicting corn yield at different nitrogen gradients according to claim 1, wherein: Acquire aerial images of corn fields with different nitrogen gradients and generate field visualization images of the GDNVI vegetation index, including: Aerial images of corn fields with different nitrogen gradients were obtained using drones; The aerial image data is mosaicked to generate a field visualization image of the GDNVI vegetation index.
3. The method for predicting corn yield at different nitrogen gradients according to claim 1, wherein: The field visualization image is preprocessed to divide the field visualization image into multiple sub-images, including: The field visualization image is evenly segmented according to a regular grid to divide the large-size field visualization image into multiple sub-images of sub-regions, each sub-region having the same size.
4. The method for predicting corn yield at different nitrogen gradients according to claim 1, wherein: Generate grayscale images for all sub-images and perform binarization processing, including: Traverse all sub-images, extract the pixel values of the three channels of blue B, green G, and red R, and calculate based on the vegetation index formula; The calculation results are mapped to the range of 0 to 255 through normalization processing to generate an eight-bit grayscale image to enhance the contrast of the vegetation area; According to the histogram distribution of the grayscale image, the threshold is adjusted, all sub-images are initially binarized, and according to the grayscale distribution, a fixed threshold is set to distinguish the target area from the background.
5. The method for predicting corn yield at different nitrogen gradients according to claim 1, wherein: Optimize the complete binary image to effectively separate the foreground and background, including: The OTSU algorithm is used to perform secondary optimization on the binary image; OTSU traverses all possible thresholds, calculates the inter-class variance, and adaptively determines the optimal threshold to effectively separate the foreground from the background.
6. The method for predicting corn yield at different nitrogen gradients according to claim 1, wherein: Get the number of white pixels in the binary image and calculate its ratio to the total pixels: Red percentage = (number of white pixels / total number of pixels in the image) × 100%.
7. The method for predicting corn yield at different nitrogen gradients according to claim 1, wherein: The forecast output is: Forecasted Output = × Red percentage+ In the formula, the unit of predicted yield is kg / hectare; is the regression coefficient, is the intercept, in kg / hectare.
8. A corn yield prediction system with different nitrogen gradients, characterized in that: include: An image processing module acquires aerial images of the corn field with different nitrogen gradients, generates a field visualization image of the GDNVI vegetation index, and preprocesses the field visualization image to divide the field visualization image into multiple sub-images; The binarization module generates grayscale images for all sub-images. After binarization, it merges the channels of all sub-images to generate a complete binarized image. The complete binarized image is then optimized to effectively separate the foreground and background. The yield prediction module obtains the number of white pixels in the binary image and calculates its ratio to the total pixels. The ratio is subjected to a univariate linear regression analysis to obtain the predicted yield.
9. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any one of the methods of claims 1 to 7 .
10. A computing device, characterized in that include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any one of the methods according to claims 1 to 7.