Crop category determination method, device, electronic device and storage medium
By integrating preset boundary data in satellite images, the plots and cells are determined, and the feature extraction particle size is determined based on the cell distribution. The convolutional neural network training model is used to solve the problem of inaccurate crop category identification caused by low satellite image resolution, and efficient and accurate crop category identification is achieved.
Patent Information
- Application Number
- CN202111650191.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2041-12-30
AI Technical Summary
Because the satellite image resolution obtained by remote sensing satellites is not high, it is difficult to accurately determine the boundaries of the plot, which affects the accuracy of crop categories identification. The prior art does not consider the distribution characteristics of the cells in the plot during feature extraction, resulting in inaccurate identification of crop categories.
By obtaining preset boundary data and combining satellite images, the plot and cells are determined, the feature extraction particle size is determined based on the cell distribution, different feature extraction particle sizes are used for classification feature extraction, and the preset classification model is trained using convolutional neural network to identify the crop category of the plot.
The accurate division of plots and accurate identification of crop categories are achieved, and the accuracy and efficiency of crop category identification are improved.
Smart Images

Figure CN114298229B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agricultural automation, and more particularly, to a method, device, electronic device, and storage medium for determining crop categories. Background Art
[0002] In recent years, remote sensing technology has developed rapidly, and its applications in many fields have become more and more extensive. The efficiency of obtaining ultra-high-resolution remote sensing images is getting higher and higher, and using remote sensing technology for crop identification and classification has also become a research hotspot.
[0003] With the development of work such as the construction of high-standard farmland, a large amount of basic farmland data has been accumulated in China. The plot boundary is the most basic farmland data and an important part of the high-precision farmland map infrastructure. Realizing plot classification is the basis for refined farmland management and accurate underwriting and claims settlement of agricultural insurance.
[0004] However, due to the low resolution of satellite images obtained by remote sensing satellites, the accurate identification of crop categories of plots is ultimately affected. Summary of the Invention
[0005] The embodiments of the present invention aim to provide a method, device, electronic device, and storage medium for determining crop categories to accurately identify the crop categories of plots.
[0006] To achieve the above object, the technical solutions adopted in the embodiments of the present invention are as follows:
[0007] In a first aspect, the embodiments of the present invention provide a method for determining crop categories, the method comprising:
[0008] Obtaining a satellite image of the area to be analyzed;
[0009] Determining the plots in the area to be analyzed and the pixels in the plots in the satellite image according to the preset boundary data of the area to be analyzed;
[0010] Processing the pixels to determine the feature extraction granularity;
[0011] Extracting the classification features of the plots from the satellite image according to the feature extraction granularity, and determining the crop categories of the plots according to the classification features.
[0012] Further, the satellite image includes a plurality of pixels, and the step of determining the plots in the area to be analyzed and the pixels in the plots in the satellite image according to the preset boundary data of the area to be analyzed includes:
[0013] Overlay the preset boundary data and the satellite image to obtain an overlaid image, where the overlaid image includes plots formed according to the preset boundary data.
[0014] For each pixel in the satellite image, determine the plot to which each pixel belongs according to the coordinates of each pixel, to obtain the pixels in the plot.
[0015] Further, the step of overlaying the preset boundary data and the satellite image to obtain an overlaid image includes:
[0016] Obtain the first coordinate system parameters of the preset boundary data and the second coordinate system parameters of the satellite image;
[0017] Align the satellite image with the preset boundary data according to the first coordinate system parameters and the second coordinate system parameters;
[0018] Perform registration on the aligned satellite image based on the preset boundary data according to the preset feature points in the preset boundary data and the reference feature points corresponding to the preset feature points in the satellite image;
[0019] Overlay the preset boundary data and the registered satellite image to obtain the overlaid image.
[0020] Further, the step of processing the pixels to determine the feature extraction granularity includes:
[0021] Perform a convolution operation on the pixels in the plot to obtain multiple convolution values of the plot;
[0022] Judge whether the plot meets the preset classification conditions according to multiple preset intervals and the multiple convolution values;
[0023] If the plot meets the preset classification conditions, determine the feature extraction granularity as the plot granularity;
[0024] If the plot does not meet the preset classification conditions, determine the feature extraction granularity as the pixel granularity.
[0025] Further, the step of judging whether the plot meets the preset classification conditions according to multiple preset intervals and the multiple convolution values includes:
[0026] Divide the multiple convolution values according to the multiple preset intervals, and judge whether there is a target interval in the multiple preset intervals, where the ratio of the number of convolution values in the target interval to the total number of convolution values exceeds a first preset value;
[0027] If the target interval exists, it is determined that the plot satisfies the preset classification condition;
[0028] If the target interval does not exist, it is determined that the plot does not satisfy the preset classification condition.
[0029] Further, there are multiple plots, and the step of determining whether the plots satisfy the preset classification condition according to multiple preset intervals and the multiple convolution values further includes:
[0030] If the ratio of the number of plots that satisfy the preset classification condition to the total number of plots exceeds a second preset value, it is determined that each plot satisfies the preset classification condition;
[0031] If the ratio of the number of plots that satisfy the preset classification condition to the total number of plots does not exceed the second preset value, it is determined that each plot does not satisfy the preset classification condition.
[0032] Further, the method further includes:
[0033] Obtain the drone image of the area to be analyzed;
[0034] Extract the vector boundary of the plot in the drone image, and use the vector boundary of the plot as the preset boundary data.
[0035] In a second aspect, an embodiment of the present invention further provides a crop category determination device, and the device includes:
[0036] An acquisition module, configured to acquire a satellite image of the area to be analyzed;
[0037] A determination module, configured to determine the plots in the area to be analyzed and the pixels in the plots in the satellite image according to the preset boundary data of the area to be analyzed;
[0038] The determination module is further configured to process the pixels to determine the feature extraction granularity;
[0039] A classification module, configured to extract the classification features of the plots from the satellite image according to the feature extraction granularity, and determine the crop categories of the plots according to the classification features.
[0040] In a third aspect, an embodiment of the present invention further provides an electronic device, and the electronic device includes:
[0041] One or more processors;
[0042] A memory, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the one or more processors to implement the crop category determination method in the first aspect above.
[0043] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the crop category determination method in the first aspect is implemented.
[0044] Compared with the prior art, an embodiment of the present invention provides a crop category determination method, apparatus, electronic device and storage medium. By accurately determining the plots in the satellite image, and determining the feature extraction granularity according to the pixels in the plots, classification features are extracted according to different feature extraction granularities, so as to accurately determine the crop category of the plots according to appropriate classification features. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and thus should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0046] Figure 1 FIG. shows a schematic flowchart of a crop category determination method provided by an embodiment of the present invention.
[0047] Figure 2 For Figure 1 FIG. shows a schematic flowchart of step S102 in the crop category determination method shown.
[0048] Figure 3 FIG. shows an example diagram of the overlay image provided by an embodiment of the present invention.
[0049] Figure 4 FIG. shows an example diagram of the corner points provided by an embodiment of the present invention.
[0050] Figure 5 FIG. shows an example diagram of the position of the pixel and the plot boundary provided by an embodiment of the present invention.
[0051] Figure 6 For Figure 1 FIG. shows a schematic flowchart of step S103 in the crop category determination method shown.
[0052] Figure 7 FIG. shows an example diagram of the mean filter convolution calculation provided by an embodiment of the present invention.
[0053] Figure 8 For Figure 6 FIG. shows a schematic flowchart of sub-step S1032 in the crop category determination method shown.
[0054] Figure 9It shows an example diagram of the distribution of convolution values provided by an embodiment of the present invention within a preset interval.
[0055] Figure 10 It is Figure 6 Another schematic flow diagram of sub-step S1032 in the crop category determination method shown.
[0056] Figure 11 It shows another schematic flow diagram of the crop category determination method provided by an embodiment of the present invention.
[0057] Figure 12 It shows an example diagram of a satellite image of the area to be analyzed provided by an embodiment of the present invention.
[0058] Figure 13 It shows the one provided by an embodiment of the present invention corresponding to Figure 12 The corresponding plot boundary vector map.
[0059] Figure 14 It shows an example diagram of the crop category determination result provided by an embodiment of the present invention.
[0060] Figure 15 It shows a block schematic diagram of the crop category determination device provided by an embodiment of the present application.
[0061] Figure 16 It shows a block schematic diagram of the electronic device provided by an embodiment of the present application.
[0062] Icons: 10 - Electronic device; 11 - Processor; 12 - Memory; 13 - Bus; 100 - Crop category determination device; 110 - Acquisition module; 120 - Determination module; 130 - Classification module; 140 - Extraction module. Detailed implementation manners
[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.
[0064] Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0065] It should be noted that like reference numerals and letters refer to like items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0066] In the description of the present invention, it should be noted that if terms such as "upper", "lower", "inner", "outer", etc. are used to indicate the orientation or positional relationship, it is based on the orientation or positional relationship shown in the figures, or the orientation or positional relationship in which the product of the invention is usually placed during use. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present invention.
[0067] In addition, if terms such as "first", "second", etc. are used only for distinguishing descriptions, they cannot be understood as indicating or implying relative importance.
[0068] It should be noted that, without conflict, the features in the embodiments of the present invention can be combined with each other.
[0069] In the field of agricultural automation, a closed planar area surrounded by the boundaries of features such as roads and ridges and the dividing lines of different crops is called a plot. Usually, there is only one type of crop in a plot. Therefore, the same or similar features exist within the same plot, while the features between different plots are quite different. In order to accurately determine the crop category in a preset area, the image in the preset area is usually segmented according to the features of the plots, that is, the image is cut into non-overlapping areas, and the areas with similar or the same features are taken as one area. One area corresponds to one plot. At this time, the image segmentation is also the plot division. The crop recognition is performed on each divided plot to obtain the crop category of each plot.
[0070] On the one hand, due to the low resolution of the satellite images obtained by remote sensing satellites, it is difficult to accurately determine the boundaries of the plots in the satellite images, which in turn affects the accuracy of crop recognition. On the other hand, when the existing technology determines the crop category of each plot, it usually extracts features according to a unified feature extraction granularity, and then identifies the crop category based on the extracted features, without considering the distribution characteristics of the pixels in each plot, so that the accuracy of the finally obtained crop category of the plot cannot meet the expectations.
[0071] In view of this, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for determining crop categories. First, according to the preset boundary data of the area to be analyzed, plots and pixels in the plots are determined in the satellite image, realizing accurate division of the plots. Secondly, the pixels of the plots are processed to determine the feature extraction granularity. Finally, the classification features of the plots are extracted from the satellite image according to the feature extraction granularity, and the crop categories of the plots are determined according to the classification features. By determining the feature extraction granularity that matches the pixel distribution of the plots through the pixels of the plots, accurate identification of the crop categories of the plots is ultimately achieved, and the following will describe it in detail.
[0072] Please refer to Figure 1 , Figure 1 FIG. shows a schematic flowchart of a method for determining crop categories provided by an embodiment of the present invention. This method for determining crop categories is applied to an electronic device and may include the following steps:
[0073] S101, Obtain the satellite image of the area to be analyzed.
[0074] In this embodiment, the area to be analyzed may be an administrative region. For example, the area of Province A or the two counties A1 and A2 in Province A is the area to be analyzed. It may also be a natural region. A natural region is a systematic research method that divides a certain range of area into a certain hierarchical system according to the differences and similarities in the spatial distribution of the natural geographical environment and its components. The full name is natural geographical regionalization. For example, the southern region of our country, that is, the area south of the 0° isotherm in January and the 800 mm isohyet.
[0075] In this embodiment, the satellite image is an image map mosaicked and spliced by multiple satellite remote sensing images according to their geographical coordinates. The most prominent advantage of the satellite image map is its rich information and intuitive image. Its geographical accuracy, that is, the relative positions between various natural elements, the spatial distribution pattern, and a certain positioning and measurement accuracy that satisfies geoscience analysis, is incomparable to other ordinary line-drawn maps. The satellite image can be obtained through some software or from the satellite image database of a specialized surveying and mapping agency. The satellite image can be a meter-level or sub-meter-level satellite image, and the satellite image includes but is not limited to Gaofen-1, Gaofen-2, Gaofen-6, Planet, Beijing-2, Gaojing-1, etc.
[0076] In this embodiment, in order to improve the accuracy of crop category recognition, the satellite image of a specific period in the crop growth cycle can be obtained so as to obtain a more accurate crop category recognition result according to the satellite image of this period.
[0077] S102, According to the preset boundary data of the area to be analyzed, determine the plots and the pixels in the plots in the satellite image.
[0078] In this embodiment, the preset boundary data can be a pre-acquired high-precision map of farmland, which can provide data for high-precision map services for farmland operation equipment such as plant protection UAVs and unmanned vehicles, including data such as farmland roads, plot boundaries, and obstacles (electric poles, windbreaks), or other existing plot boundary data, or relatively accurate plot boundaries extracted from high-precision images.
[0079] In this embodiment, the area to be analyzed may include one plot or multiple plots, and the pixels in the plot are the pixels in the satellite image that fall within the plot. A pixel, also known as a pixel point or pixel element, that is, a picture element, is the basic unit that makes up a satellite image.
[0080] S103. Process the pixels to determine the feature extraction granularity.
[0081] In this embodiment, the feature extraction granularity is used to characterize the basic unit during feature extraction. The feature extraction granularity depends on the distribution of the pixels in the plot. As a specific implementation, the pixels can be processed to obtain the distribution of the pixels, and then the feature extraction granularity can be determined according to the distribution of the pixels.
[0082] In this embodiment, the feature extraction granularity includes at least two types: plot granularity and pixel granularity. The plot granularity extracts features in units of plots, and the pixel granularity extracts features in units of pixels.
[0083] S104. Extract the classification features of the plot from the satellite image according to the feature extraction granularity, and determine the crop category of the plot according to the classification features.
[0084] In this embodiment, for different crop categories, the values of the corresponding classification features are also different. Different feature extraction granularities result in different classification features. For example, for pixel granularity, its classification features can be the spectral value, vegetation index, etc. of each pixel. For plot granularity, its classification features can be spectral mean, spectral standard deviation, mean vegetation index, plot area. The spectral mean and spectral standard deviation can be obtained from the spectral values of all the pixels in the plot, and the mean vegetation index can be obtained from the vegetation indices of all the pixels in the plot.
[0085] As a specific implementation, the spectral mean can be calculated by the formula where n represents the total number of pixels in the plot, σ Li represents the L-band spectral value corresponding to a certain pixel, represents the L-band spectral mean of the plot; the spectral standard deviation can be calculated by the formula where σ Lrepresents the spectral standard deviation of the plot, n represents the total number of pixels in the plot, and c Li represents the L-band spectral value corresponding to a certain pixel, represents the spectral mean of the L-band of the plot.
[0086] As a specific implementation, the mean vegetation index can be calculated by the formula where NDVI i is the normalized vegetation index value of pixel i in the plot, is the mean vegetation index. For the vegetation index of any pixel, the vegetation index needs to be normalized, and the formula can be used for normalization, where X norm is the normalized vegetation index, X min and X max are the minimum and maximum values of the vegetation index before normalization among all pixels.
[0087] The vegetation index can be calculated by the formula where NDVI represents the normalized vegetation index, NIR represents the near-infrared band value, and Red represents the red band value.
[0088] In this embodiment, for the classification features extracted with different feature extraction granularities, they can be input into different preset classification models to identify the crop categories of the plots, and each preset classification model is pre-trained according to the classification features extracted from the samples corresponding to its feature extraction granularity. For example, for the plot granularity, classification features are extracted from the samples according to the plot granularity and trained to obtain the preset classification model corresponding to the plot granularity. If the feature extraction granularity determined according to the pixel distribution of the plots in the current area to be analyzed is the plot granularity, the preset classification model corresponding to the plot granularity is used for identification.
[0089] In this embodiment, the preset classification model can be the convolutional neural network VGG (Visual Geometry Group, VGG). Adjust the convolutional layer, fully connected layer, loss function, etc. of VGG. In order to train the preset classification model, the sample dataset is divided into a training dataset and a validation dataset. The preset classification model is trained with the training dataset, and the accuracy of the trained preset classification model is verified with the validation dataset. When the verification accuracy is greater than the set accuracy threshold, the trained preset classification model is saved. The classification features of the plots in the area to be analyzed are input into the trained preset classification model to determine the crop categories of the plots. The accuracy threshold can be set as needed. For example, the accuracy threshold is 0.95.
[0090] In this embodiment, different classification features are obtained for different feature extraction granularities. Different preset classification models are trained based on different classification features, and the trained preset classification models are also different. For the plot granularity, the extracted classification features are for the plot, and the features for training the preset classification model are also the classification features for the plot. When identifying the crop category, the classification features for the plot in the area to be analyzed are also input into the preset classification model, and the crop category to which the plot belongs is obtained. For the pixel granularity, the extracted classification features are for the pixel, and the features for training the preset classification model are also the classification features for each pixel in the plot. When identifying the crop category, the classification features for each pixel in the plot in the area to be analyzed are also input into the preset classification model, and the crop category to which each pixel belongs is obtained. To obtain the crop category of the plot, the crop category ratios of all pixels in the plot are statistically analyzed, and the crop category of the plot is the category of the pixel with the largest number of crops. The crop category of each plot can be determined using the following formula:
[0091] C i =max(∑c i1 ,∑c i2 ,...∑c in ) (6)
[0092] Where C i represents the final crop category of the i-th plot, and ∑c in represents the total number of pixels in the i-th plot whose crop category is n.
[0093] The above method provided by the embodiment of the present invention determines the plots and pixels in the plots in the satellite image according to the preset boundary data of the area to be analyzed, realizes the accurate division of the plots, determines the feature extraction granularity matching the pixel distribution of the plots through the pixels of the plots, and finally realizes the accurate identification of the crop categories of the plots.
[0094] Based on Figure 1 , the embodiment of the present invention also provides a specific implementation method for determining the plots and pixels in the area to be analyzed. Please refer to Figure 2 , Figure 2 which is Figure 1 a schematic flowchart of a sub-step of step S102 in the crop category determination method shown. Step S102 includes the following sub-steps:
[0095] S1021, overlay the preset boundary data and the satellite image to obtain an overlay image, where the overlay image includes the plots formed according to the preset boundary data.
[0096] In this embodiment, the process of fitting the preset boundary data and the satellite image is the process of dividing the satellite image into plots according to the preset boundary data. This process may be as follows: First, align the preset boundary data and the satellite image, and then overlay the two to obtain a fitted image. Please refer to Figure 3 , Figure 3 which shows an example of the fitted image provided by the embodiment of the present invention. Figure 3 In Figure 3 , the black arrow shown points to a plot.
[0097] As a specific implementation manner, the process of obtaining the fitted image may be:
[0098] First, obtain the first coordinate system parameters of the preset boundary data and the second coordinate system parameters of the satellite image.
[0099] In this embodiment, the coordinate system parameters generally include ellipsoid parameters, datum plane parameters, projection parameters, etc. When the first coordinate system parameters and the second coordinate system parameters belong to different types of coordinate systems, it is necessary to convert the two into the same coordinate system with the same parameters here. When the first coordinate system parameters and the second coordinate system parameters belong to the same type of coordinate system, but the values of the first coordinate system parameters and the second coordinate system parameters are different, it is also necessary to first convert them to the same parameters before proceeding with the subsequent alignment steps. Otherwise, no conversion is required.
[0100] Second, align the satellite image with the preset boundary data according to the first coordinate system parameters and the second coordinate system parameters.
[0101] In this embodiment, the satellite image can be aligned with the preset boundary data according to the position information of specific features or areas with specific shapes in the satellite image. For example, waters with specific shapes and positions in the satellite image, or ridges with specific lengths and positions, etc.
[0102] Third, based on the preset feature points in the preset boundary data and the reference feature points corresponding to the preset feature points in the satellite image, perform registration on the aligned satellite image based on the preset boundary data.
[0103] In this embodiment, in order to further reduce the alignment error between the aligned satellite image and the preset boundary data, registration can also be performed on the aligned satellite image. The specific registration method is: determine the preset feature points in the preset boundary data, determine the reference feature points corresponding to the preset feature points in the satellite image, and perform registration on the aligned satellite image based on the preset boundary data through the preset feature points and the reference feature points.
[0104] In this embodiment, the preset feature points can be the corner points in the preset boundary data. The corner points are the points that have a greater impact on the boundary features of the plot. For example, for a roughly regular rectangular plot, the corner points can be the 4 vertices of the rectangular plot. For an irregular plot, the corner points can be the inflection points where the boundary changes significantly. Please refer to Figure 4 , Figure 4 FIG. Figure 4 shows an example diagram of the corner points provided by the embodiment of the present invention. Figure 4 In FIG. Figure 4 , plot 1 is a roughly regular rectangular plot, and its corner points are the 4 vertices of the rectangle, as shown by the circles in plot 1. Plot 2 is an irregular plot, and its corner points are shown by the circles in plot 2.
[0105] In this embodiment, first through coarse-grained alignment and then through fine-grained registration, the alignment error between the preset boundary data and the satellite image is reduced to the minimum, improving the accuracy of plot boundary division. Finally, based on the relatively accurate plot boundary, the crop categories of the plot can be accurately identified.
[0106] Finally, the preset boundary data and the registered satellite image are superimposed to obtain a superimposed image.
[0107] S1022. For each pixel in the satellite image, determine the plot to which each pixel belongs according to the coordinates of each pixel, and obtain the pixels in the plot.
[0108] In this embodiment, the satellite image includes a plurality of pixels. As a specific implementation, according to the position of the center point coordinates of each pixel relative to the plot boundary, it can be determined to which plot the pixel belongs, and then the pixels in the plot can be obtained.
[0109] It can be understood that not all pixels in the satellite image will necessarily belong to a plot. For some pixels, they may not belong to any plot. Please refer to Figure 5 , Figure 5 FIG. Figure 5 shows an example diagram of the position of the pixel and the plot boundary provided by the embodiment of the present invention. Figure 5 In FIG. Figure 5 , the center point coordinates of pixel X1 are located within plot A. Therefore, pixel X1 belongs to plot A. The center point coordinates of pixel X2 are neither within plot A nor within plot B. Then, pixel X2 belongs to neither plot A nor plot B.
[0110] The above method provided by the embodiment of the present invention can screen out the pixels that do not belong to the plot by determining the pixels in the plot, so as to process according to the pixels that truly belong to the plot, and the obtained feature extraction granularity is also more accurate. Finally, the identification of crop categories is also more accurate.
[0111] Based on Figure 1 , the embodiment of the present invention also provides a specific implementation manner for determining the feature extraction granularity. Please refer toFigure 6 , Figure 6 is Figure 1 a schematic flowchart of step S103 in the crop category determination method shown, and step S103 includes the following sub-steps:
[0112] S1031. Perform a convolution operation on the pixels in the plot to obtain multiple convolution values of the plot.
[0113] In this embodiment, when performing a convolution operation on the pixels in the plot, different filtering methods can be selected as needed. The filtering methods include, but are not limited to, median filtering, mean filtering, maximum and minimum value filtering, etc. In the embodiment of the present invention, mean filtering is taken as an example for illustration. Please refer to Figure 7 , Figure 7 which shows an example diagram of the mean filtering convolution calculation provided by the embodiment of the present invention. Figure 7 In, for the pixel with a gray background color, the convolution value obtained after 3*3 mean filtering convolution is 40, as shown in the position of Figure 7 . It can be understood that the mean filtering can be set according to actual needs. For example, the mean filtering can be set to 5*5 or 7*7, etc.
[0114] It should be noted that when there are multiple plots in the area to be analyzed, the convolution operation can be performed on the pixels in multiple plots at the same time. In the obtained convolution results, multiple convolution values of each plot are obtained, and according to the multiple convolution values of each plot, it is determined whether each plot meets the preset classification conditions.
[0115] S1032. According to multiple preset intervals and multiple convolution values, determine whether the plot meets the preset classification conditions.
[0116] In this embodiment, the preset intervals are determined in advance. According to the preset intervals, the distribution of multiple convolution values can be obtained. The more concentrated the convolution value results are in a preset interval, the greater the probability that the plot is a certain type of crop. Otherwise, the probability that the plot is a certain type of crop is smaller.
[0117] In this embodiment, the preset classification conditions are used to characterize the conditions under which the plot is suitable for feature extraction according to the plot granularity. When there is one plot, if the concentration degree of the convolution value results concentrated in a preset interval is greater than the preset concentration degree, it is determined that the plot meets the preset classification conditions. Otherwise, it is determined that the plot does not meet the preset classification conditions. When there are multiple plots, if the ratio of the number of plots that meet the preset classification conditions to the total number of plots is greater than the second preset value, it is determined that all multiple plots meet the preset classification conditions. Otherwise, it is determined that all multiple plots do not meet the preset classification conditions.
[0118] S1033. If the plot meets the preset classification conditions, determine that the feature extraction granularity is the plot granularity.
[0119] S1034. If the plot does not meet the preset classification conditions, determine that the feature extraction granularity is the pixel granularity.
[0120] Based on Figure 6 this, the embodiments of the present invention also provide a specific implementation method for determining whether a plot meets the preset classification conditions. Please refer to Figure 8 , Figure 8 For Figure 6 a schematic flowchart of a sub-step S1032 in the crop category determination method shown in
[0121] S10321. Divide multiple convolution values according to multiple preset intervals, and determine whether there is a target interval among the multiple preset intervals, where the ratio of the number of convolution values in the target interval to the total number of convolution values exceeds a first preset value.
[0122] In this embodiment, the first preset value is used to characterize that the concentration degree of the preset interval distribution of convolution values is greater than the preset concentration degree. The first preset value can be set as needed. For example, the first preset value is set to 60%. The target interval is a preset interval in which the convolution values are concentratedly distributed and the concentration degree is greater than the preset concentration degree. For example, perform a convolution operation on the pixels in the plot with a 5*5 mean convolution, and the value range of the convolution result is [0, 255]. There are 5 preset intervals, which are: [0, 51], [51, 102], [102, 153], [153, 204], [204, 255]. The first preset value is 60%. The distribution of convolution values in the preset interval is as Figure 9 shown in Figure 9 . Among them, the number of convolution values falling within the interval [0, 51] is 8, the number of convolution values falling within the interval [51, 102] is 34, and the number of convolution values falling within the interval [102, 153] is 223. The ratio to the total number of convolution values is 67%, exceeding the first preset value. Then the interval [102, 153] is the target interval.
[0123] S10322. If there is a target interval, determine that the plot meets the preset classification conditions.
[0124] S10323. If there is no target interval, determine that the plot does not meet the preset classification conditions.
[0125] The above sub-steps S10321 to S10323 are usually for the application scenario where there is only one plot in the preset area. Of course, when there are multiple plots, this method can also be used to determine whether each plot meets the preset classification conditions, and then extract the classification features of each plot according to the feature extraction granularity of each plot, and determine the crop category of each plot according to the classification features of each plot.
[0126] In this embodiment, if the number of plots is too large, extracting features for each plot with different feature extraction granularities will result in a huge amount of computation. To improve the computational efficiency and not overly affect the recognition accuracy, Figure 6 On this basis, the embodiment of the present invention further provides another method for determining whether a plot meets the preset classification conditions in the scenario where there are multiple plots. Please refer to Figure 10 , Figure 10 For Figure 6 Another schematic flowchart of sub-step S1032 in the crop category determination method shown. Sub-step S1032 further includes the following sub-steps:
[0127] S10324, if the ratio of the number of plots that meet the preset classification conditions to the total number of plots exceeds the second preset value, it is determined that each plot meets the preset classification conditions.
[0128] In this embodiment, the second preset value can be set according to actual needs. For example, the second preset value is set to 80%. When the requirement for computational efficiency is high under the acceptable recognition accuracy, the second preset value can be set smaller; when the requirement for computational efficiency is not high, the second preset value can be set larger to make the crop recognition result as accurate as possible.
[0129] S10325, if the ratio of the number of plots that meet the preset classification conditions to the total number of plots does not exceed the second preset value, it is determined that each plot does not meet the preset classification conditions.
[0130] In this embodiment, when each plot meets the preset classification conditions, the feature extraction granularity of each plot is the plot feature; when each plot does not meet the preset classification conditions, the feature extraction granularity of each plot is the pixel feature.
[0131] In the above method provided in this embodiment, multiple plots in the area to be analyzed are processed with a unified feature extraction granularity according to the second preset value, which simplifies the computational complexity and improves the recognition efficiency on the premise of meeting the recognition accuracy.
[0132] In this embodiment, as a specific implementation manner, when the preset boundary data is the plot vector boundary in the UAV image, the embodiment of the present invention further provides a specific implementation manner for obtaining the preset boundary data. Please refer to Figure 11 , Figure 11 Another schematic flowchart of the crop category determination method provided by the embodiment of the present invention is shown. This method can be applied to the same electronic device as the above method or a different electronic device. This method includes the following steps:
[0133] S201, Obtain the UAV images of the area to be analyzed.
[0134] In this embodiment, the resolution of the UAV images is usually between 0.05m and 0.3m, which is much higher than that of satellite images. Therefore, the vector boundaries of the plots extracted based on the UAV images are relatively accurate.
[0135] S202, Extract the vector boundaries of the plots in the UAV images, and use the vector boundaries of the plots as the preset boundary data.
[0136] In this embodiment, an image segmentation algorithm for plots can be used to segment the UAV images to extract the vector boundaries of the plots in the UAV images. For example, the image segmentation algorithm for plots is U-Net.
[0137] It should be noted that this method can be executed before the above step S102 (if S102 includes sub-steps, before its first sub-step), and then immediately execute S102 (if S102 includes sub-steps, immediately execute its sub-steps). Alternatively, this method can be executed in advance, and the obtained preset boundary data can be stored so that it can be directly obtained when it is necessary to execute step S102 or its sub-steps.
[0138] In this embodiment, to more intuitively reflect the effects achieved by the embodiments of the present invention, please refer to Figure 12 , Figure 12 which shows an example diagram of the satellite image of the area to be analyzed provided by the embodiments of the present invention, Figure 13 which shows the corresponding plot boundary vector diagram provided by the embodiments of the present invention, Figure 12 and Figure 14 which shows an example diagram of the crop category determination result provided by the embodiments of the present invention. Figure 14 In , areas with the same color belong to the same crop category.
[0139] To execute the corresponding steps in the above embodiments and all possible implementation manners, the following provides an implementation manner of a crop category determination device 100. Please refer to Figure 15 , Figure 15 which shows a block diagram of the crop category determination device 100 provided by the embodiments of the present invention. It should be noted that for the crop category determination device 100 provided in this embodiment, its basic principle and the technical effects generated are the same as those in the above embodiments. For the sake of brief description, they are not mentioned in this embodiment.
[0140] The crop category determination device 100 includes an acquisition module 110, a determination module 120, a classification module 130, and an extraction module 140.
[0141] The acquisition module 110 is configured to acquire the satellite image of the area to be analyzed.
[0142] A determination module 120, configured to determine plots in the area to be analyzed and pixels in the plots in the satellite image according to the preset boundary data of the area to be analyzed.
[0143] Optionally, the satellite image includes a plurality of pixels. The determination module 120 is specifically configured to: perform overlay of the preset boundary data and the satellite image to obtain an overlaid image, where the overlaid image includes plots formed according to the preset boundary data; for each pixel in the satellite image, determine the plot to which each pixel belongs according to the coordinates of each pixel to obtain the pixels in the plot.
[0144] Optionally, when the determination module 120 is specifically configured to perform overlay of the preset boundary data and the satellite image to obtain an overlaid image, it is specifically configured to: obtain first coordinate system parameters of the preset boundary data and second coordinate system parameters of the satellite image; align the satellite image with the preset boundary data according to the first coordinate system parameters and the second coordinate system parameters; perform registration on the aligned satellite image based on the preset boundary data according to preset feature points in the preset boundary data and reference feature points corresponding to the preset feature points in the satellite image; overlay the preset boundary data and the registered satellite image to obtain an overlaid image.
[0145] The determination module 120 is further configured to process the pixels to determine the feature extraction granularity.
[0146] Optionally, the determination module 120 is specifically further configured to: perform convolution operation on the pixels in the plot to obtain a plurality of convolution values of the plot; determine whether the plot meets the preset classification condition according to a plurality of preset intervals and the plurality of convolution values; if the plot meets the preset classification condition, determine the feature extraction granularity as the plot granularity; if the plot does not meet the preset classification condition, determine the feature extraction granularity as the pixel granularity.
[0147] Optionally, when the determination module 120 is used to determine whether the plot meets the preset classification condition according to a plurality of preset intervals and the plurality of convolution values, it is specifically further configured to: divide the plurality of convolution values according to the plurality of preset intervals, and determine whether there is a target interval in the plurality of preset intervals, where the ratio of the number of convolution values in the target interval to the total number of convolution values exceeds a first preset value; if there is a target interval, determine that the plot meets the preset classification condition; if there is no target interval, determine that the plot does not meet the preset classification condition.
[0148] Optionally, there are multiple plots. When the determination module 120 is used to determine whether the plots meet the preset classification conditions according to multiple preset intervals and the multiple convolution values, it is specifically further used for: if the ratio of the number of plots that meet the preset classification conditions to the total number of plots exceeds a second preset value, it is determined that each plot meets the preset classification conditions; if the ratio of the number of plots that meet the preset classification conditions to the total number of plots does not exceed the second preset value, it is determined that each plot does not meet the preset classification conditions.
[0149] The classification module 130 is configured to extract the classification features of the plots from the satellite image according to the feature extraction granularity, and determine the crop categories of the plots according to the classification features.
[0150] The extraction module 140 is configured to: obtain the drone image of the area to be analyzed; extract the vector boundary of the plot in the drone image, and use the vector boundary of the plot as the preset boundary data.
[0151] Please refer to Figure 16 , Figure 16 FIG. shows a block diagram of the electronic device 10 provided in the embodiment of the present application. The electronic device 10 may be a computer device, for example, any one of a smart phone, a tablet computer, a personal computer, a server, a ground station, a private cloud, a public cloud, etc. The above devices can be used to implement the crop category determination method provided in the above embodiments, which can be specifically determined according to the actual application scenario and will not be limited here. The electronic device 10 includes a processor 11, a memory 12, and a bus 13. The processor 11 is connected to the memory 12 through the bus 13.
[0152] The memory 12 is used to store programs, such as Figure 15 the crop category determination device 100 shown in FIG.. The crop category determination device 100 includes at least one software function module that can be stored in the memory 12 in the form of software or firmware. After receiving the execution instruction, the processor 11 executes the program to implement the crop category determination method disclosed in the above embodiments.
[0153] The memory 12 may include a high-speed random access memory (Random Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory, NVM).
[0154] The processor 11 may be an integrated circuit chip with the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 11 or the instructions in the form of software. The above-mentioned processor 11 may be a general-purpose processor, including a central processing unit (CPU), a microcontroller unit (MCU), a complex programmable logic device (CPLD), a field programmable gate array (FPGA), an embedded ARM and other chips.
[0155] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor 11, the crop category determination method disclosed in the above embodiment is implemented.
[0156] In summary, the embodiment of the present invention provides a crop category determination method, device, electronic device and storage medium. First, according to the preset boundary data of the area to be analyzed, the plots and the pixels in the plots are determined in the satellite image to achieve accurate division of the plots. Secondly, the pixels of the plots are processed to determine the feature extraction granularity. Finally, the classification features of the plots are extracted from the satellite image according to the feature extraction granularity, and the crop category of the plots is determined according to the classification features. The feature extraction granularity matching the pixel distribution of the plots is determined through the pixels of the plots, and finally the crop category of the plots is accurately identified.
[0157] As mentioned above, the above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for determining a crop category, characterized in that, The method includes: Obtaining satellite images of the area to be analyzed; Determining plots in the area to be analyzed and pixels in the plots in the satellite images according to the preset boundary data of the area to be analyzed; Processing the pixels to determine a feature extraction granularity, where the feature extraction granularity is used to represent the basic unit during feature extraction, and the feature extraction granularity is determined according to the distribution concentration degree of multiple convolution values of the plot obtained by performing convolution operations on the pixels; Extracting classification features of the plots from the satellite images according to the feature extraction granularity, and determining the crop categories of the plots according to the classification features.
2. The crop category determination method according to claim 1, wherein The satellite images include multiple pixels, and the step of determining plots in the area to be analyzed and pixels in the plots in the satellite images according to the preset boundary data of the area to be analyzed includes: Overlaying the preset boundary data and the satellite images to obtain an overlaid image, where the overlaid image includes plots formed according to the preset boundary data; For each pixel in the satellite images, determining the plot to which each pixel belongs according to the coordinates of each pixel, to obtain the pixels in the plots.
3. The crop category determination method according to claim 2, wherein The step of overlaying the preset boundary data and the satellite images to obtain an overlaid image includes: Obtaining first coordinate system parameters of the preset boundary data and second coordinate system parameters of the satellite images; Aligning the satellite images with the preset boundary data according to the first coordinate system parameters and the second coordinate system parameters; Performing registration on the aligned satellite images based on the preset boundary data according to preset feature points in the preset boundary data and reference feature points corresponding to the preset feature points in the satellite images; Overlaying the preset boundary data and the registered satellite images to obtain the overlaid image.
4. The crop category determination method according to claim 1, characterized in that The step of processing the pixels to determine a feature extraction granularity includes: Performing convolution operations on the pixels in the plots to obtain multiple convolution values of the plots; Judging whether the plots meet a preset classification condition according to multiple preset intervals and the multiple convolution values; If the plots meet the preset classification condition, determining the feature extraction granularity as plot granularity, where the plot granularity represents feature extraction with plots as the unit; If the plots do not meet the preset classification condition, determining the feature extraction granularity as pixel granularity, where the pixel granularity represents feature extraction with pixels as the unit.
5. The crop category determination method according to claim 4, wherein The step of judging whether the plots meet a preset classification condition according to multiple preset intervals and the multiple convolution values includes: Dividing the multiple convolution values according to the multiple preset intervals, and judging whether there is a target interval among the multiple preset intervals, where the ratio of the number of convolution values in the target interval to the total number of convolution values exceeds a first preset value; If there is the target interval, determining that the plots meet the preset classification condition; If there is no target interval, determining that the plots do not meet the preset classification condition.
6. The crop category determination method according to claim 5, wherein, There are multiple plots, and the step of determining whether the plots meet the preset classification conditions according to multiple preset intervals and the multiple convolution values further includes: If the ratio of the number of plots that meet the preset classification conditions to the total number of plots exceeds a second preset value, it is determined that each plot meets the preset classification conditions; If the ratio of the number of plots that meet the preset classification conditions to the total number of plots does not exceed the second preset value, it is determined that each plot does not meet the preset classification conditions.
7. The crop category determination method according to claim 1, characterized in that The method further includes: Obtaining the drone image of the area to be analyzed; Extracting the vector boundary of the plot in the drone image and using the vector boundary of the plot as the preset boundary data.
8. A crop category determination device, characterized in that, The device includes: An acquisition module for acquiring the satellite image of the area to be analyzed; A determination module for determining the plots in the area to be analyzed and the pixels in the plots in the satellite image according to the preset boundary data of the area to be analyzed; The determination module is further configured to process the pixels to determine the feature extraction granularity, where the feature extraction granularity is used to represent the basic unit during feature extraction, and the feature extraction granularity is determined according to the distribution concentration of multiple convolution values of the plot obtained by performing convolution operations on the pixels; A classification module for extracting the classification features of the plots from the satellite image according to the feature extraction granularity and determining the crop categories of the plots according to the classification features.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; A memory for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the crop category determination method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when executed by a processor, implements the crop category determination method according to any one of claims 1-7.
Citation Information
Patent Citations
Cultivated crop type extraction method and system, storage medium and electronic equipment
CN109840553A
Crop fine classification method and system based on multi-source remote sensing image
CN113033279A