Farmland area measurement method based on boundary judgment and semantic segmentation of G-Lap algorithm

Through the G-Lap algorithm and the improved Deeplab model, by enhancing the edge judgment and semantic segmentation of farmland boundaries, the problems of insufficient accuracy and universality in drone farmland area calculation are solved, and high-precision farmland area measurement is achieved.

CN120318303BActive Publication Date: 2025-09-19HANGZHOU DIANZI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510779943.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-19
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

Existing drone farmland area calculation methods rely on fixed flight altitudes and regular square pixel geometric approximation models, resulting in limited calculation accuracy and insufficient universality. Semantic segmentation models have limitations in balancing real-time performance and accuracy, and farmland boundaries are difficult to determine with high precision in complex situations, affecting labeling accuracy and model training effectiveness.

Method used

The G-Lap algorithm is used to enhance the farmland boundary, and the improved Deeplab model is combined for semantic segmentation. The G-Lap algorithm is used to enhance the farmland edge and construct a connected domain. The closed area is filled as the annotation area. The backbone network of Deeplab is improved using Swin Transformer and BiFPN network, and the aerial photography height information is combined to calculate the farmland area.

Benefits of technology

The accuracy of farmland boundary determination and the segmentation effect of the model are improved, and high-precision farmland area calculation is achieved. It has higher versatility and computational efficiency and meets lightweight requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318303B_ABST
    Figure CN120318303B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for determining farmland area based on boundary judgment and semantic segmentation of the G-Lap algorithm. The method uses drones to collect images of agricultural areas in multiple scenes, thereby constructing a multi-scene farmland image set. The G-Lap algorithm is used to further enhance the edges of farmland in the multi-scene farmland image set to construct a multi-scene farmland training image set. The multi-scene farmland training image set is then used to fully train the improved DeepLab model by freezing and thawing the backbone, training multiple rounds of convergence to obtain a final segmentation model. The trained segmentation model is used to segment and extract farmland area pixels in the test image set, and the image binarization method is used to count the number of pixels segmented by the segmentation model. Based on the number of pixels, the actual area corresponding to each pixel at different aerial photography heights is combined to obtain the farmland area. This method effectively solves technical problems such as the time-consuming and low-efficiency of traditional farmland area extraction methods and the lack of versatility of the calculation method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of farmland information science, and in particular to a farmland area measurement method based on improved feature-enhanced semantic segmentation. Background Art

[0002] With the rapid development of global science and technology, the production model of agricultural workers has undergone great changes, such as the emergence of smart agriculture. Smart agriculture uses remote sensing, the Internet of Things and other technologies to accurately monitor and analyze crop growth, soil fertility, pest and disease conditions and irrigation conditions in farmland information, thereby improving efficiency. For the calculation of farmland area, which is most needed for irrigation conditions, traditional satellite remote sensing and manual mapping have problems such as low efficiency, high cost and lag. Compared with satellite remote sensing and manual mapping, drones have shown their unique advantages in the calculation of farmland area in small and medium areas. Their centimeter-level image accuracy and ease of operation can not only reduce acquisition costs, but also realize high-frequency dynamic monitoring. Therefore, the present invention proposes a new method for automatically calculating farmland area based on drone aerial images.

[0003] Traditional drone area calculation methods rely primarily on image processing techniques and geometric formulas, while the extraction of the calculated area within the image relies primarily on manual extraction. For example, methods such as using drones to collect images and combining them with the Gaussian area formula to calculate farmland area are relatively simple in principle, but in complex situations, the calculation accuracy may be affected. To improve on traditional geometric methods, it is also possible to obtain and calculate the drone's focal length, detector size, pitch and roll angles, and the relative elevation angle between the aerial camera and the target point, thereby measuring multiple aspects of the target's size in a single drone optical image and improving accuracy. In addition to traditional image processing and geometric formulas, existing computer software such as Adobe Photoshop and ARCGIS processes, analyzes, and calculates the area of ​​drone images taken at a fixed flight altitude. These existing area calculation methods rely on a fixed flight altitude and employ a regular square pixel geometric approximation model, resulting in limited calculation accuracy and insufficient universality in practical applications. Further improvements are needed to these area calculation methods.

[0004] In recent years, deep learning methods within computer vision have surpassed traditional image segmentation methods in extracting high-dimensional features. They have been widely used to segment and extract corresponding regions in remote sensing images, effectively improving efficiency. Deep learning convolutional networks typically contain many convolutional layers, which can learn deep features from training data. Therefore, deep convolutional neural networks have been introduced to segmentation tasks and have achieved promising results. Methods for extracting target regions in remote sensing images using deep learning can be divided into two categories: semantic segmentation and instance segmentation. Semantic segmentation involves classifying each pixel in an image, and instance segmentation can be considered an extension of semantic segmentation. However, compared to semantic segmentation, instance segmentation requires a large number of training images, and complete farmland parcels in drone imagery do not have many adjacent farmland areas. Therefore, semantic segmentation can be used to extract pixels within the complete farmland parcel area in the image and calculate the farmland area.

[0005] In terms of model selection, common semantic segmentation models include U-Net, DeepLab, SegFormer and its improved models. Studies have shown that adaptive reconnaissance strategies combined with edge computing can achieve accurate identification of rice lodging areas. For typical scenarios such as tobacco planting in plateau mountainous areas and film-mulched farmland, the U-Net series of models have shown significant advantages in small sample learning and complex object recognition. Combining UAV multi-temporal imagery with the optimized SegFormer model, a dynamic monitoring method is proposed to effectively realize the monitoring of cultivated land changes in mountainous areas and the extraction of farmland distribution. The above work shows that semantic segmentation models have made significant progress in UAV farmland image recognition and segmentation, but there are still some limitations, such as the trade-off between real-time and accuracy. Although lightweight models meet real-time requirements, their segmentation accuracy is lower than that of complex models.

[0006] When creating datasets for semantic segmentation models, manual identification and annotation of feature regions is required. For drone-photographed farmland images, complex farmland environments, varying lighting conditions, and varying shooting angles often result in unclear farmland boundaries, making high-precision boundary identification difficult. This issue impacts subsequent annotation accuracy, model training, and area calculation accuracy. However, existing research has not yet considered the impact of this issue or provided a technical solution. Summary of the Invention

[0007] The technical problem to be solved by the present invention is that, in view of the above-mentioned technical problems that the existing area calculation method relies on a fixed flight altitude and adopts a regular square pixel geometric approximation model, which leads to limited calculation accuracy and insufficient universality in practical applications; the semantic segmentation model has limitations in balancing real-time performance and accuracy; and in complex situations, the farmland boundaries in aerial images are not obvious and it is difficult to achieve high-precision boundary judgment, which leads to reduced labeling accuracy. A farmland area measurement method based on boundary judgment and semantic segmentation of the G-Lap algorithm is provided.

[0008] In order to achieve the above object, the technical solutions specifically adopted by the present invention are as follows:

[0009] The method for determining farmland area based on boundary determination and semantic segmentation of the G-Lap algorithm includes the following steps:

[0010] Step 1: Use drones to collect images of agricultural areas in multiple scenarios, and then construct a multi-scenario farmland image set;

[0011] Step 2: Using the G-Lap algorithm, the edges of the farmland in the multi-scene farmland image set in step 1 are further enhanced, and the farmland boundaries are determined, thereby achieving high-precision boundary determination and annotation of the farmland, and further constructing a multi-scene farmland training image set;

[0012] Step 3: Build and train a semantic segmentation model. The semantic segmentation model uses the Deeplab model as the base network. In the backbone network of the Deeplab model, the feature extraction network Swin Transformer is used to replace the original ResNet, and the Deeplab FPN network is replaced with the BiFPN network. The training image set is used to freeze the backbone network to obtain the initial model.

[0013] Step 4: Use a drone to collect drone farmland images of the farmland area to be tested, establish a test image set, and process the test image set using the multi-scale edge enhancement method of step 2, wherein the test image is embedded with aerial photography height information;

[0014] Step 5: Calculate the actual area corresponding to each pixel in the test image at different aerial photography heights by improving the drone area calculation method;

[0015] Step 6: Use the trained segmentation model to segment and extract the farmland area pixels in the test image set, and use the image binarization method to count the number of pixels segmented by the segmentation model. Based on the number of pixels and the actual area corresponding to each pixel at different aerial photography heights, the farmland area is obtained.

[0016] Preferably, in step 1, the multi-scene farmland image set constructed is farmland under rice, wheat, fallow and other farmland crop scenes, and the images have edge features of complete farmland packaging.

[0017] Preferably, in step 1, the collected image is a three-channel RGB image.

[0018] Preferably, in step 2, the method for determining the edge of the farmland by using the G-Lap algorithm is:

[0019] The Laplacian operator is used to enhance the boundaries of the complete farmland package for the multi-scene farmland image set in step 1. Then, the image enhanced by the Laplacian operator is used as the guide image, and the guided filtering method is used to further enhance the boundaries of the original farmland RGB image, while suppressing the crop texture noise at the same time. Based on the enhanced boundaries, a connected domain is constructed, and the closed area is filled as the annotation area, thereby achieving high-precision boundary judgment and annotation of the farmland.

[0020] Preferably, in step 2, the method of using the Laplacian operator to enhance the boundary of the complete farmland parcel is:

[0021] First, define the Laplacian operator of the two-dimensional image as a discrete convolution kernel:

[0022] ;

[0023] in, represents the Laplacian operator of the function, and Represents functions respectively exist and Second-order partial derivatives in direction;

[0024] The original image is processed using the 3×3 diagonal convolution kernel. Perform convolution operation to obtain edge response map ;

[0025] Then the edge response map With the original image Superimpose in proportion to enhance high-frequency edge information;

[0026] Finally, the output is normalized. Since the convolution result may be negative, the output image needs to be normalized. Normalize to a preset range.

[0027] Preferably, the guided filtering method is:

[0028] ;

[0029] ;

[0030] ;

[0031] Among them, i represents the pixel subscript, and It's a window The linear coefficient within the guide image is the image enhanced by the Laplacian operator, To guide the image in the window The mean within To guide the image in the window The variance within The original image is input in the window The mean within is the regularization parameter, preventing Too big.

[0032] Preferably, in step 2, the method for performing boundary determination on the original farmland RGB image by guided filtering is:

[0033] In the boundary area of ​​the guidance image, when , Increase, retain the high-frequency details of the input image, in the boundary area of ​​the guide image, when , Reduce, , suppress and smooth the noise of the input image; according to The distribution of determines the farmland boundary, that is , is the threshold, is the high value area at the farmland boundary, that is, the area at the farmland boundary, where the threshold is determined by the following formula:

[0034]

[0035] in, μ edge and They are The mean and standard deviation of the distribution.

[0036] Preferably, in step 2, the boundaries of the farmland are marked: based on the high-value areas of the farmland boundaries, a combination of morphological dilation and erosion operations is used to achieve effective connection of the boundaries to form closed areas, and the marked areas are obtained by filling the closed areas. The filled closed areas are used as the marked areas, thereby achieving the boundary marking of the farmland and further constructing a multi-scene farmland training image set.

[0037] Preferably, in step 3, a dilated spatial pyramid pool is introduced after the BiFPN network, and the expansion rate of the dilated convolution in the dilated spatial pyramid pool is optimized.

[0038] Preferably, the dilation rate optimization method of the dilated convolution is to dynamically design a dilation rate sequence according to the size of the feature map output by the dilated spatial pyramid pool, as shown in the formula:

[0039] ,

[0040] For 384×512 feature maps, the expansion rate is adjusted to [1, 6, 12, 24] combinations.

[0041] Preferably, two parallel network branches are introduced into the dilated spatial pyramid pool, and the two parallel network branches are a Transformer branch and a pooling layer branch.

[0042] Preferably, in step 5, the method for calculating the drone area is as follows:

[0043] ;

[0044] ;

[0045] in, is the total area, is the actual area corresponding to each pixel, 、 Images 、 The number of pixels in the direction, is the focal length, is the height of the camera from the ground, Half the width of the camera film.

[0046] The present invention also provides a farmland area measurement system based on boundary judgment and semantic segmentation of the G-Lap algorithm, comprising: a processor and a storage device; the processor loads and executes instructions and data in the storage device to implement a farmland area measurement method based on boundary judgment and semantic segmentation of the G-Lap algorithm.

[0047] The present invention has the following characteristics and beneficial effects:

[0048] In response to existing area calculation methods that rely on a fixed flight altitude and employ a geometric approximation model based on regular square pixels, an improved area calculation method based on camera imaging principles is proposed. Using a theoretical pixel dynamic adjustment model, an area calculation algorithm adapting to altitude variations is established. To further improve the accuracy of farmland boundary determination, the G-Lap algorithm is used to enhance farmland boundaries. Farmland boundaries are determined based on the distribution of ak. Connected domains are constructed based on this, and closed regions are filled as annotation regions. An improved DeepLab segmentation model is used, trained using a frozen training method. The improved DeepLab algorithm boasts a simple structure, minimal training set requirements, and significant segmentation performance. By integrating the embedded drone altitude data in the test images with the improved area calculation method, the actual area corresponding to each pixel in each test image is determined. After segmentation extraction using the improved DeepLab algorithm, the farmland pixels belonging to the calculated area in each drone farmland image are obtained. Finally, the area of ​​the farmland in each test image is determined by binarization and counting the number of pixels. The results obtained by this method are comparable in accuracy to those of traditional methods, while improving computational efficiency and versatility. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 This is a flow chart of the farmland area determination method based on boundary determination and semantic segmentation of the G-Lap algorithm of the present invention;

[0050] Figure 2 This is the schematic diagram of the improved area algorithm combined with the height of the drone;

[0051] Figure 3 It is a flow chart of the traditional image processing extraction method;

[0052] Figure 4 This is the schematic diagram of improving Deeplab;

[0053] Figure 5 This is a flowchart of an example of calculating farmland area using drone images based on improved Deeplab;

[0054] Figure 6 This is a qualitative experimental comparison chart of various semantic segmentation algorithms;

[0055] Figure 7 This is a comparison chart of quantitative indicators of various semantic segmentation algorithms;

[0056] Figure 8 It is a comparison chart of the area calculated by the present invention, the traditional method and the true value; DETAILED DESCRIPTION

[0057] The present invention is described in detail below in conjunction with specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.

[0058] Example 1

[0059] This embodiment provides a method for determining farmland area based on boundary determination and semantic segmentation of the G-Lap algorithm. Figure 1 As shown, the following steps are included:

[0060] Step 1: Use a drone to collect images of the designated agricultural area. The collected images are three-channel RGB images.

[0061] Step 2: First, the collected images constructed in step 2 are selected to delete the images without complete farmland packages. Then, the farmland edges in the multi-scene farmland image set in step 1 are further enhanced by the G-Lap algorithm, and the images are further enhanced according to a k The distribution of the image data is used to determine the boundaries of farmland. Connected domains are constructed based on the enhanced boundaries, and closed regions are filled in as annotation areas. This enables high-precision boundary determination and annotation of farmland, further building a multi-scenario farmland training image set.

[0062] Specifically, the G-Lap algorithm uses the Laplacian operator to enhance the boundaries of the complete farmland package for the multi-scene farmland image set in step 1. Then, using the image enhanced by the Laplacian operator as the guide image, the guided filtering method is used to further enhance the boundaries of the original farmland RGB image while suppressing crop texture noise.

[0063] The Laplacian operator enhances the edge of the farmland parcel in the original image: The Laplacian operator of the two-dimensional image can be approximated by the following discrete convolution kernel:

[0064]

[0065] in, represents the Laplacian operator of the function, and Represent the second-order partial derivatives of the function f in the x and y directions respectively. The original image O(x,y) is convolved with the 3×3 extended diagonal convolution kernel to obtain the edge response map L(x,y):

[0066]

[0067] Where * represents the convolution operation, Represents the Laplacian extended diagonal convolution kernel. Then the edge response map With the original image Proportional stacking to enhance high-frequency edge information:

[0068]

[0069] The parameters : Control edge enhancement strength, usually Finally, the output is normalized. Since the convolution result may be negative, the output image needs to be normalized. Normalize to a reasonable range (such as 0~255):

[0070]

[0071] The process of guided filtering is to take an input image as , by guiding the image , after filtering, the output image is obtained ,in and are all inputs to the algorithm. Guided filtering defines a linear filtering process as shown below, assuming that the output image With guided images In the local window There is a linear relationship within:

[0072]

[0073] Among them, i represents the pixel subscript, and It's a window The linear coefficient within the guide image is the image enhanced by the Laplacian operator.

[0074] for, and Solved by the least squares method:

[0075]

[0076]

[0077] in To guide the image in the window The mean within To guide the image in the window The variance within The original image is input in the window The mean within is the regularization parameter, preventing Too large (to suppress noise amplification).

[0078] In the boundary area of ​​the guidance image, when , Increase, retain the high-frequency details of the input image, in the boundary area of ​​the guide image, when , Reduce, , suppress and smooth the noise of the input image; according to The distribution of determines the farmland boundary, that is , is the threshold, is the high value area at the farmland boundary, that is, the area at the farmland boundary, where the threshold is determined by the following formula:

[0079]

[0080] in μ edge and They are The mean and standard deviation of the distribution.

[0081] Furthermore, based on enhancing the boundaries and determining the farmland boundaries, a combination of morphological dilation and erosion operations is used to effectively connect the boundaries and form closed regions. Subsequently, the closed regions are filled to obtain labeled regions. The filled closed regions serve as the labeled regions. This allows for the determination and annotation of farmland boundaries. In this embodiment, a multi-scenario farmland training image set is further constructed.

[0082] Specifically, suppose a predefined shape set (such as rectangle, circle), there are edge points in high-value areas ,spacing , the expansion operation is Expand the boundary and connect the breaks; the corrosion operation is Connectivity is preserved and noise is removed. Subsequently, the closed region is filled to obtain the labeled region. The filled closed region serves as the labeled region, enabling the boundary determination and annotation of farmland, further constructing a multi-scenario farmland training image set.

[0083] It is understandable that the edge of the high-value area is not actually an ideal line, but is composed of pixel points.

[0084] It should be noted that, unlike the publicly available datasets used in previous studies, the datasets used in this study are all high-resolution drone images captured manually by experimenters in real farmland. These datasets contain clear and relatively complete farmland outlines. The multi-scenario farmland images constructed include farmland with rice, wheat, fallow, and other crop scenarios, and the images contain complete edge features encapsulating the farmland.

[0085] Step 3. Construct a semantic segmentation model. Specifically, use the Deeplab algorithm to improve it, and use the multi-scene farmland training image set in step 2 to train the frozen backbone to obtain an initial model. For the improvement of the Deeplab model, this embodiment improves the backbone network (Backbone) of Deeplab, and uses a more powerful feature extraction network SwinTransformer to replace the original ResNet to improve the representation ability of the model. Replace Deeplab's FPN network with a BiFPN network to achieve the fusion of features at different levels, improve the receptive field of the model, and improve the recognition of image details. Deepen the Deeplab network structure, introduce the atrous spatial pyramid pooling (ASPP) structure after the encoder, and optimize the dilation rates of the atrous convolution in the ASPP module to improve the capture of multi-scale information and the model's ability to mine data features. Finally, integrate the Transformer module in the ASPP module, add a Transformer branch in the parallel branch of ASPP, and fuse it with the convolutional features, as shown in the attached figure. Figure 4 As shown in the figure, the initial model is obtained by freezing the backbone network of the model and then fully training the initial model with the backbone unfrozen. After multiple rounds of training and convergence, the final segmentation model is obtained.

[0086] Step 4: Use a drone to collect drone farmland images of the farmland area to be tested, establish a test image set, and process the test image set using the multi-scale edge enhancement method of step 2, wherein the test image is embedded with aerial photography height information;

[0087] Step 5: Calculate the actual area corresponding to each pixel in the test image at different aerial photography heights by improving the drone area calculation method.

[0088] Step 6: Use the trained segmentation model to segment and extract the farmland area pixels in the test image set, and use the image binarization method to count the number of pixels segmented by the segmentation model. Based on the number of pixels and the actual area corresponding to each pixel at different aerial photography heights, the farmland area is obtained.

[0089] Specifically, the calculation process of the improved Deeplab algorithm in step 3 is as follows:

[0090] Step 1. Image input and preprocessing: Input a 3000×4000 pixel RGB farmland image, optimize the size, and scale it to 1536×2048 while maintaining the aspect ratio.

[0091] Step 2, Swin Transformer backbone network:

[0092] 1. Patch partitioning: Cut the image into 4×4 windows, outputting a tensor of [1×48×384×512].

[0093] 2. Hierarchical Feature Extraction: Stage 1: 4 Swin Transformer Blocks, Windowed Multi-scale Attention (W-MSA): 7×7 local window, output resolution: 384×512 → 192×256. Stage 2: 6 Swin Transformer Blocks, window expanded to 14×14, output resolution: 192×256 → 96×128. Stage 3: 18 Swin Transformer Blocks, shifted window (SW-MSA) introduced, output resolution: 96×128 → 48×64. Stage 4: 6 Swin Transformer Blocks, global attention mechanism, output resolution maintained at 48×64.

[0094] 3. Feature pyramid construction: Output 4-level feature maps: C1: [1×96×384×512] (shallow edge features), C2: [1×192×256] (mid-level semantic features), C3: [1×384×96×128] (high-level semantic features), C4: [1×768×48×64] (global context features).

[0095] Step 3. BiFPN feature fusion: bidirectional cross-scale connection:

[0096] 1. Top-down path: Upsample C4 (48×64) by 2 times and fuse it with C3 (96×128), and use depthwise separable convolution to reduce the amount of computation.

[0097] 2. Bottom-up path: The fused features are downsampled and fused again with C2 (192×256), introducing learnable feature weights (implemented through 1×1 convolution).

[0098] 3. Multiple iterations: Repeat bidirectional fusion five times (the deep design of BiFPN) to output a feature map with a resolution of 384×512 (the same size as the original image).

[0099] Step 4. Improved Atrous Spatial Pyramid Pooling (ASPP module):

[0100] 1. Parallel multi-branch processing: Stage 1, dilated convolution branch: Branch, 1×1 convolution (dilation rate 1) → capture local details. Branch 2, 3×3 dilated convolution (dilation rate 6) → medium receptive field. Branch 3, 3×3 dilated convolution (dilation rate 12) → wide context. Branch 4, 3×3 dilated convolution (dilation rate 18) → global association. Stage 2, Transformer branch: Split the feature map into a 16×16 token sequence and introduce 8-head self-attention calculation (each head dimension 96). Finally, the position encoding uses a learnable relative position encoding. Stage 3, global pooling branch: Global average pooling → 1×1×768 → bilinear interpolation to restore the size;

[0101] 2. Feature Fusion: Use the channel attention mechanism (SE Block) to dynamically assign weights: CNN branch weight: 0.42 (local details dominate), Transformer branch weight: 0.38 (global relationship supplement), pooling branch weight: 0.20 (background information assists). The final output feature map size is: [1×256×256×512];

[0102] Step 5: Decoder reconstruction:

[0103] 1. Feature upsampling: Use transposed convolution to gradually upsample (×2 → ×4 → ×8) and add element-by-element to the shallow features output by BiFPN.

[0104] 2. Detail restoration: Skip connections are introduced at the 256×512 resolution layer, and 3×3 convolution is used to eliminate artifacts caused by splicing.

[0105] 3. Final prediction: 1×1 convolution compresses the number of channels to the number of categories, and bilinear interpolation is used to upsample the image to a resolution of 1536×2048.

[0106] Step 6: Post-processing and output: Scale the image back to the original 3000×4000 pixel RGB farmland image and generate a semantic segmentation mask for visualization output.

[0107] Specifically, the altitude information embedded in the drone aerial image in step 4 is obtained by the airborne GPS.

[0108] Specifically, the improved drone area calculation method in step 5 is implemented as follows:

[0109] , , ,

[0110] As attached Figure 2 As shown, is the focal length, is the height of the camera from the ground, Half the width of the camera film, is 1 / 2 of the width of the image plane and object plane, For Camera 1 / 2 of the field of view in the direction. 、 Images 、 The number of pixels in the direction, Pixels The corresponding size in the direction, Pixels The corresponding size in the direction, The actual area at the corresponding height for each pixel.

[0111] The above formula is based on the idealized assumption that pixels are in a standard square structure. However, according to the formula:

[0112]

[0113] The rectangular pixel characteristics that are common in actual imaging systems ( ).

[0114] This will produce a deformation error, and it will also change dynamically according to the manufacturing error of the sensor, where PAR is the pixel aspect ratio, is the length of the camera film, Pixels Physical dimensions in direction, Pixels By analyzing the influence mechanism of pixel aspect ratio on deformation error, a dynamic adjustment model is established for ideal pixels, which is then converted into Dynamic adjustment and parameter compensation, such as formula As shown, After dynamic adjustment , is a dynamic adjustment factor, set in the model The unit length is 1. Considering that different resolutions will affect the imaging, the aspect ratio ( ) to set the dynamic adjustment interval of k [1, On this basis, the endpoint average formula Among them Indicates the The calculated value of the secondary endpoint average method is , come on Dynamic adjustment is performed to achieve parameter compensation of ideal pixel deformation error. Expressed as Therefore, the improved formula is as follows,

[0115] ,

[0116] in The actual area corresponding to each dynamically adjusted pixel.

[0117] Finally, the area can be obtained by counting the pixels in the image belonging to the measured area. The area calculation formula is as follows: ,in is the area, is the number of pixels in the measured area in the image.

[0118] Traditional drone-based area calculation methods rely primarily on image processing techniques and geometric formulas, and the extraction of the calculated area within the image primarily relies on manual extraction. Improvements to geometric methods, such as the introduction of drone parameters and the application of other imaging software, can further improve the accuracy of area calculation. Furthermore, to overcome the limitations of drone imagery in farmland area calculation, researchers have recently proposed methods that integrate drone imagery with deep learning to improve the efficiency of farmland plot extraction and segmentation accuracy. Currently, mainstream semantic segmentation models include FCN, U-Net, PSPNet, and DeepLab, with DeepLab demonstrating promising results in image segmentation tasks. Researchers have also developed DeepLabv3+, building on DeepLab. DeepLabv3+ is a deep learning model for semantic segmentation developed by Google AI. It primarily improves the performance of the DeepLab series, aiming to more efficiently extract multi-scale features and accurately recover spatial information. Its core innovation lies in combining atrous convolution with an encoder-decoder framework. The encoder consists of a backbone network and atrous spatial pyramid pooling (ASPP). The backbone network used for feature extraction is typically ResNet or Xception. The dataset creation process for the semantic segmentation model requires manual identification and annotation of feature regions. For drone-photographed farmland images, the complex farmland environment, varying lighting conditions, and varying shooting angles can make the boundaries of the farmland unclear, making high-precision boundary identification difficult. However, existing research has not yet considered the impact of this issue or the technical solutions to address it.

[0119] In this task, based on camera imaging principles, a theoretical pixel dynamic adjustment model was used to establish an area calculation algorithm that adapts to height variations. Regarding farmland boundary detection, annotation, and dataset construction, the G-Lap algorithm was used to further enhance farmland boundaries. Farmland boundaries were determined based on the distribution of ak. Connected domains were constructed based on this, and closed regions were filled in as annotation regions. For the improved DeepLab model and training method, a frozen training approach was used to train the FCN, U-Net, PSPNet, and improved DeepLab models. For the improved DeepLab, the DeepLab backbone network was improved, replacing the original ResNet with a more powerful feature extraction network, the Swin Transformer, to enhance the model's representation capabilities. The DeepLab FPN network was replaced with a BiFPN network to integrate features at different levels, increase the model's receptive field, and improve the recognition of image details. The DeepLab network architecture was further refined by introducing the Atrous Spatial Pyramid Pooling (ASPP) structure after the encoder. The dilation rates of the atrous convolutions in the ASPP module were optimized to improve the capture of multi-scale information and the model's ability to mine data features. Finally, the Transformer module is integrated into the ASPP module, and a Transformer branch is added to the parallel branch of ASPP to fuse with the convolutional features. In our task, DeepLab is improved to extract the boundary area of ​​the complete farmland.

[0120] The process of combining examples is as follows Figure 5 As shown in the figure, qualitative experiments of various semantic segmentation algorithms are shown in the figure. Figure 6 As shown, the first column is the original image, the second column is the label image, the third column is the segmentation result of the method of the present invention, the fourth column is the segmentation result of PSP-Net, the fifth column is the segmentation result of U-Net, and the sixth column is the segmentation result of FCN. The quantitative indicators of the above algorithms are compared as follows: Figure 7 shown.

[0121] like Figure 8 The figure shows a comparison between the method of the present invention, traditional image-based methods, and the ground truth. We used a drone to capture 23 images of farmland with aerial height information, and compared the area calculated using the method with the traditional image-based methods and the ground truth.

[0122] In summary, this paper addresses existing area calculation methods that rely on a fixed flight altitude and employ a regular square pixel geometric approximation model. By implementing a theoretical pixel dynamic adjustment model, an improved area calculation method based on camera imaging principles is proposed. To further improve the accuracy of farmland boundary determination, the G-Lap algorithm is used to enhance farmland boundaries. Farmland boundaries are determined based on the distribution of ak. Connected domains are constructed based on this, and closed regions are filled in as annotated regions. An improved DeepLab segmentation model is used, trained using a frozen training method. After segmentation and extraction using the improved DeepLab algorithm, farmland pixels belonging to the calculated region are obtained in each UAV farmland image. Finally, the number of pixels is binarized and counted to determine the area of ​​the farmland in each test image. On the test set of this method, the improved DeepLab model achieved 95.7% mean Intersection Over Union (MIoU) and maintained an inference speed of 17.3 FPS (on a 1080Ti). This method achieves lightweight performance while maintaining high accuracy and demonstrates good segmentation performance for various farmland scenarios. The results obtained by this method are comparable in accuracy to traditional methods, while improving computational efficiency and versatility.

[0123] Example 2

[0124] This embodiment also provides a farmland area measurement system based on boundary judgment and semantic segmentation of the G-Lap algorithm, including: a processor and a storage device; the processor loads and executes instructions and data in the storage device to implement a farmland area measurement method based on boundary judgment and semantic segmentation of the G-Lap algorithm disclosed in Example 1.

[0125] The above shows and describes the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and improvements may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and improvements fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for determining farmland area based on boundary determination and semantic segmentation of the G-Lap algorithm, characterized in that: The steps include: Step 1: Use drones to collect images of agricultural areas in multiple scenarios, and then construct a multi-scenario farmland image set; Step 2: Using the G-Lap algorithm, the edges of the farmland in the multi-scene farmland image set in step 1 are further enhanced, and the farmland boundaries are determined, thereby achieving high-precision boundary determination and annotation of the farmland, and further constructing a multi-scene farmland training image set; The method for determining the edge of farmland using the G-Lap algorithm is as follows: The Laplacian operator is used to enhance the boundaries of the complete farmland parcels in the multi-scene farmland image set in step 1. The image enhanced by the Laplacian operator is then used as the guide image I. The guided filtering method is then used to further enhance the boundaries of the original farmland RGB image and perform boundary judgment. The guided filtering method is: Among them, i represents the pixel subscript, a k and b k is the window w k The linear coefficients within The boundary determination method is: According to a k The distribution of the farmland boundary is determined by a k >τ, τ is the threshold, which is the high-value area at the edge of the farmland, that is, the area at the edge of the farmland. The threshold is determined by the following formula: τ=μ edge -2s edge where μ edge and σ edge A k The mean and standard deviation of the distribution; Step 3: Build and train a semantic segmentation model. The semantic segmentation model uses the Deeplab model as the base network. In the backbone network of the Deeplab model, the feature extraction network Swin Transformer is used to replace the original ResNet, and the Deeplab FPN network is replaced by the BiFPN network. The training image set is used to freeze the backbone network to obtain an initial model. Subsequently, the initial model is fully trained with the unfrozen backbone. After multiple rounds of training, convergence is achieved to obtain the final segmentation model. Step 4: Use a drone to collect drone farmland images of the farmland area to be tested, establish a test image set, and process the test image set using the multi-scale edge enhancement method of step 2, wherein the test image is embedded with aerial photography height information; Step 5: Calculate the actual area corresponding to each pixel in the test image at different aerial photography heights by improving the drone area calculation method; Step 6: Use the trained segmentation model to segment and extract the farmland area pixels in the test image set, and use the image binarization method to count the number of pixels segmented by the segmentation model. Based on the number of pixels and the actual area corresponding to each pixel at different aerial photography heights, the farmland area is obtained.

2. The method according to claim 1, characterized in that In step 1, the multi-scene farmland image set constructed is farmland in rice, wheat, fallow and other farmland crop scenes, and the images have edge features of complete farmland packaging.

3. The method according to claim 1, characterized in that In step 1, the collected image is a three-channel RGB image.

4. The method according to claim 1, wherein In step 2, the guided filtering method is used to further enhance the boundaries of the original farmland RGB image and suppress crop texture noise at the same time. A connected domain is constructed based on the enhanced boundaries, and closed areas are filled as annotation areas, thereby achieving high-precision boundary determination and annotation of the farmland.

5. The method according to claim 4, characterized in that In step 2, the method of using the Laplacian operator to enhance the boundary of the complete farmland parcel is: First, define the Laplacian operator of the two-dimensional image as a discrete convolution kernel: Among them, 2 f(x,y) represents the Laplacian operator of the function, and Represent the second-order partial derivatives of function f in the x and y directions respectively; The original image 0(x,y) is convolved with the 3×3 extended diagonal convolution kernel to obtain the edge response map L(x,y); The edge response map L(x,y) is then proportionally superimposed with the original image 0(x,y) to enhance the high-frequency edge information; Finally, the output is normalized. Since the convolution result may be negative, the output image L enhanced Normalize (x,y) to the preset range.

6. The method according to claim 5, characterized in that The method for obtaining the linear coefficient is: Among them, the guide image I is the image enhanced by the Laplacian operator, μ k To guide the image in the window w k The mean within To guide the image in the window w k The variance within The original image is input in the window w k The mean within, ε is the regularization parameter, to prevent a k Too big.

7. The method according to claim 6, characterized in that In step 2, the method for performing boundary determination on the original farmland RGB image by guided filtering is: In the boundary area of ​​the guidance image, when a k Increase, retain the high-frequency details of the input image, in the boundary area of ​​the guide image, when a k Reduce, Suppress and smooth the noise of the input image.

8. The method according to claim 7, characterized in that In step 2, the method for labeling the boundaries of the farmland is as follows: based on the high-value areas of the farmland boundaries, a combination of morphological dilation and erosion operations is used to achieve effective connection of the boundaries to form closed areas, and the labeled areas are obtained by filling the closed areas. The filled closed areas are used as the labeled areas, thereby achieving the labeling of the farmland boundaries and further constructing a multi-scene farmland training image set.

9. The method according to claim 1, characterized in that In step 3, a dilated spatial pyramid pool is introduced after the BiFPN network, and the expansion rate of the dilated convolution in the dilated spatial pyramid pool is optimized.

10. The method according to claim 9, characterized in that The dilation rate optimization method of the dilated convolution is to dynamically design the dilation rate sequence according to the feature map size output by the dilated spatial pyramid pool. The formula is as follows: d j =base×rate j , Among them, base = 2, rate = 1.5, for the 384×512 feature map, the expansion rate is adjusted to the [1, 6, 12, 24] combination.

11. The method according to claim 10, characterized in that Two parallel network branches are introduced into the dilated spatial pyramid pool, and the two parallel network branches are the Transformer branch and the global pooling branch.

12. The method according to claim 1, characterized in that In step 5, the method for calculating the drone area is as follows: Where S is the total area, S ci The actual area corresponding to each pixel, S x 、S y are the number of pixels in the X and Y directions of the image, f = OE is the focal length, h = OC is the height of the camera from the ground, and t = EF is half the width of the camera film.

13. A farmland area measurement system based on boundary determination and semantic segmentation of the G-Lap algorithm, characterized in that: include: A processor and a storage device; the processor loads and executes instructions and data in the storage device to implement a method for determining farmland area based on boundary determination and semantic segmentation of a G-Lap algorithm as described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Measuring and calculating method, device and equipment for farmland area of aerial image, and medium

    CN111080526A

  • Lightweight remote sensing image semantic segmentation method based on improved Deeplabv3 +

    CN115984850A

  • Multi-layer fluorescence image fusion and signal point accurate extraction and counting method based on guided filtering and gradient enhancement and application of multi-layer fluorescence image fusion and signal point accurate extraction and counting method

    CN118071621A