Farmland boundary automatic identification method of agricultural unmanned aerial vehicle
By constructing a density gradient distribution map of farmland areas and analyzing grayscale texture uniformity, the problem of insufficient accuracy in farmland boundary recognition in existing technologies is solved, and highly reliable automatic boundary extraction is achieved in complex terrain and diverse crop scenarios.
Patent Information
- Application Number
- CN202510833585.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-11-21
AI Technical Summary
现有农田边界识别技术在复杂地形和作物种类多样场景下识别精度不足,缺乏对作物密度信息的利用,难以在无监督或弱监督条件下实现高可靠性的边界自动提取。
By constructing a density gradient distribution map of crops in farmland areas, the density variation rate is extracted by sliding the density gradient map to determine the trend of continuous boundaries. Combined with grayscale texture uniformity, the region is divided and matched to generate a sequence of boundary segments and output the final boundary map.
It enables accurate identification of farmland boundaries under weak or unsupervised conditions, suppresses false boundary responses caused by noise and texture disturbances, and improves the continuity and reliability of boundary identification.
Smart Images

Figure CN120997552A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of boundary recognition technology, and in particular to an automatic farmland boundary recognition method for agricultural drones. Background Technology
[0002] With the continuous improvement of agricultural intelligence, the automated management of farmland using drones, remote sensing images, and artificial intelligence technologies has become an important development direction for modern agriculture. Accurate identification of farmland boundaries is fundamental to automated farmland mapping, plot management, precision seeding, and intelligent fertilization. Current technologies typically acquire farmland scene data through low-altitude imagery, satellite remote sensing, or hyperspectral images, and combine this with image segmentation, deep learning, or image edge detection techniques to achieve boundary identification. While these methods have a certain level of accuracy in plains areas, they still suffer from insufficient accuracy, poor boundary closure, and the need for manual intervention in scenarios with complex terrain, blurred boundaries, or diverse crop types. Furthermore, existing methods often focus on the overall verification of region segmentation results, lacking modeling of the intrinsic correlation between crop distribution density characteristics and boundary change trends in images, making it difficult to achieve highly reliable automatic boundary extraction in unsupervised or weakly supervised scenarios.
[0003] For example, CN113221740A discloses a method and system for farmland boundary recognition. It employs an improved UNet network for semantic image segmentation and utilizes inter-frame correlation algorithms and RANSAC linear fitting to extract boundary lines. While this method offers advantages in image segmentation accuracy, it still relies heavily on a large number of labeled training samples, resulting in high training costs and limited generalization ability. Especially in cases where field boundaries are nonlinear or locally blurred, the fitting method is prone to bias, leading to discontinuous boundary extraction. Furthermore, this scheme lacks explicit modeling of crop distribution patterns in farmland, failing to fully utilize spatial variation information such as crop growth density to enhance the reliability of boundary judgment.
[0004] CN117197686A proposes an automatic boundary identification method for high-standard farmland plots based on satellite imagery. It introduces a transformer attention mechanism and an LSD boundary closure detection algorithm, effectively enhancing the contextual awareness of boundary identification. However, this method relies on high-resolution satellite imagery and GIS tag data, resulting in high data acquisition costs and poor real-time performance. While the attention mechanism improves fine-grained boundary modeling, it lacks a linkage modeling mechanism with crop image density distribution, making it difficult to effectively capture abrupt boundary changes in low-altitude UAV images. Furthermore, the remote sensing tag creation process it relies on poses a certain obstacle to rapid deployment in real-world agricultural scenarios. Summary of the Invention
[0005] In view of the problems of insufficient utilization of crop density information and low reliability of boundary line segments in existing farmland boundary identification technologies, this invention is proposed.
[0006] Therefore, the problem to be solved by this invention is how to achieve efficient extraction of farmland boundaries under weak or unsupervised conditions.
[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0008] In a first aspect, the present invention provides an automatic farmland boundary identification method using an agricultural drone, comprising: constructing a density gradient distribution map of crops in a farmland area based on low-altitude multispectral images collected by the drone, wherein the density gradient is divided into pixel blocks and the density variation rate is labeled; extracting the density variation rate by sliding a window in the image based on the density gradient distribution map, determining whether there is a continuous boundary trend, and forming a candidate boundary line segment by collecting continuous structural abrupt change points; dividing the region according to the location of the candidate boundary line segment using the grayscale texture uniformity in the low-altitude multispectral image, setting an airspace reference area template, quickly matching the divided region, determining and marking the corresponding candidate boundary line segment as a first-level credible boundary; structurally connecting all candidate boundary line segments marked as first-level credible boundaries according to the continuity direction to generate a boundary segment sequence, and outputting the final boundary map.
[0009] As a preferred embodiment of the automatic farmland boundary identification method for agricultural drones described in this invention, the calculation of the density variation rate includes: extracting the mean and variance of the normalized vegetation index of each pixel in each pixel block to construct a density vector D. k The density vector difference between adjacent pixel blocks is normalized to obtain the density variation rate; the expression for normalizing the density vector difference between adjacent pixel blocks is: ΔD k =||D k -D k+1 ||2; where ΔD k D represents the variation in density structure between adjacent pixel blocks, ||·|2 is the L2 norm, and D k and D k+1 These are the density vectors extracted from adjacent pixel blocks, respectively.
[0010] As a preferred embodiment of the automatic farmland boundary recognition method for agricultural drones described in this invention, the step of extracting density variation rate based on window sliding in the image includes: setting multiple sliding windows of different scales based on the generated density gradient map, arranging the density variation rate extracted during the sliding process at each scale in a time sequence to form a trajectory map of density variation rate; using the ratio of the standard deviation to the average value of the density variation rate difference between adjacent point pairs within the trajectory as the trajectory perturbation factor; if the trajectory perturbation factor is higher than a preset critical ratio threshold, it is determined that the corresponding trajectory has a density clustering or abrupt change trend, and the involved pixels are marked as abrupt change candidate points.
[0011] As a preferred embodiment of the automatic farmland boundary identification method for agricultural drones described in this invention, the formation of candidate boundary segments includes: aggregating identified mutation candidate points according to their spatial location on a density gradient map; if the angle change between any consecutive n mutation response points does not exceed m degrees, and the change sequence of the trajectory perturbation factor has a unimodal characteristic, then the corresponding mutation response point chain constitutes a candidate boundary segment, where n and m are constants; pairing all candidate boundary segments in pairs, calculating the difference in distribution entropy of the corresponding trajectory perturbation factor; if the difference in distribution entropy of the trajectory perturbation factor between two candidate boundary segments is less than k% of the average perturbation entropy, and the included angle of the direction angle between the two candidate boundary segments is less than the angle threshold θ1, then they are merged into the same boundary segment group, where k is a constant.
[0012] As a preferred embodiment of the automatic farmland boundary recognition method for agricultural drones described in this invention, the method of dividing regions using grayscale texture uniformity in density gradient distribution maps includes: extracting the image grayscale matrix within a local density window range of H times on both sides of each candidate boundary line segment, constructing a two-sided texture distribution map with the candidate boundary line segment as the central axis, where H is a constant; calculating the local grayscale uniformity index and directional texture variance value for the two-sided texture distribution maps respectively, and obtaining the difference between the two sides to construct a boundary texture difference map, thereby determining the texture heterogeneity between regions.
[0013] As a preferred embodiment of the automatic farmland boundary recognition method for agricultural drones described in this invention, the method of quickly matching the divided areas includes: constructing a reference texture vector set based on a set open space reference area template, and performing similarity calculation with the textures on both sides of the boundary line segment.
[0014] As a preferred embodiment of the automatic farmland boundary identification method for agricultural drones described in this invention, the step of generating a boundary segment sequence by connecting structures according to continuous directions includes: constructing a direction vector sequence {V} based on candidate boundary segments marked as first-level reliable boundaries. k}, and with the current line segment v k Based on this, extract adjacent boundary line segments v k-1With v k+1 The included angle θ k-1 and θ k+1 ; Calculate the directional inertia control factor I k Determine if there is a path reversal or discontinuity response at the current line segment connection point. If I k Connections are allowed if the value is below the dynamic threshold γ1; based on the connection boundary segment v k With v k+1 The directional continuity, density variation rate, and texture inconsistency responses are used to calculate the structural connectivity confidence score through weighted calculation; when the structural connectivity confidence score is higher than the confidence threshold, the boundary segment v is... k With v k+1 Perform the connection and update the boundary segment sequence index; repeat the structural connection process until all first-level trusted boundaries are completed.
[0015] As a preferred embodiment of the automatic farmland boundary recognition method for agricultural drones described in this invention, wherein: the directional inertial control factor I k The calculation is as follows: I k =|θ k-1 -2θ k +θ k+1 |
[0016] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program instructions are executed by the processor, the steps of the method for automatic identification of farmland boundaries of agricultural drones as described in the first aspect of the present invention are implemented.
[0017] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program instructions are executed by a processor, the steps of the method for automatic identification of farmland boundaries of agricultural drones as described in the first aspect of the present invention are implemented.
[0018] The beneficial effects of this invention are as follows: This invention can accurately identify the location of farmland boundaries in images, achieving relatively stable boundary judgment even when different crops or plots are connected, or when local blurring exists. Through reliable boundary filtering and structural connection mechanisms, this invention effectively suppresses false boundary responses caused by image noise and local texture disturbances, improving the continuity and reliability of the final boundary map. In summary, this invention has significant technical advantages in terms of high automatic recognition accuracy, strong adaptability, and good boundary structure coherence. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A flowchart illustrating a method for automatic farmland boundary recognition using agricultural drones;
[0021] Figure 2 This is a flowchart illustrating the process of generating boundary segment sequences in an automatic farmland boundary identification method for agricultural drones. Detailed Implementation
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0025] As mentioned in the technical background above, existing technologies typically acquire farmland scene data through low-altitude imagery, satellite remote sensing, or hyperspectral images, and then combine image segmentation, deep learning, or image edge detection techniques to achieve boundary recognition. While these methods have a certain level of accuracy in plains areas, they still suffer from insufficient accuracy, poor boundary closure, and the need for manual intervention in scenarios with complex terrain, blurred boundaries, or diverse crop types. Furthermore, existing methods often focus on the overall verification of region segmentation results, lacking modeling of the intrinsic correlation between crop distribution density characteristics and boundary change trends in images, making it difficult to achieve highly reliable automatic boundary extraction in unsupervised or weakly supervised scenarios.
[0026] Figure 1 This is a flowchart of a method for automatic farmland boundary recognition using an agricultural drone according to an embodiment of the present invention. Figure 1 As shown, the automatic farmland boundary identification method for agricultural drones includes:
[0027] S1: Based on low-altitude multispectral images collected by UAVs, a density gradient map of farmland area is constructed, where the density gradient is divided into pixel blocks and the density variation rate is labeled.
[0028] To improve the distinction between crop areas and non-crop backgrounds in images, representative reflectance channels from low-altitude multispectral remote sensing images were first selected, and the data for each channel were normalized. Multispectral images contain multiple bands. Raw reflectance data is significantly affected by factors such as imaging environment and illumination intensity; direct use may lead to distortion in feature contrast between channels. Therefore, normalization was employed to adjust the values of all channels to a uniform scale. This invention prioritizes the use of a maximum-minimum normalization method to preserve pixel-level original contrast while reducing the interference of outliers on channel sensitivity assessment.
[0029] Specifically, after channel normalization, in order to measure the sensitivity of different channel combinations to changes in crop regions, this invention normalizes the reflectance data of each channel in low-altitude multispectral images and calculates the Normalized Difference Vegetation Index (NDI). m =(R i -R j ) / (R i +R j ), where R i R is the normalized reflectivity value of the i-th band channel. j is the normalized reflectivity value of the j-th band channel.
[0030] It should be noted that the above formula has a strong responsiveness to changes in crop cover, especially when a pair of complementary channels are selected, such as a high-reflectivity near-infrared channel and a low-reflectivity red channel. Changes in the ratio can clearly amplify the spectral differences between plants and the background. Compared to traditional NDVI, NDI... m It offers greater freedom and adaptability, allowing for flexible combination of channels based on image content, making it easy to adapt to different crop varieties or plot distribution differences.
[0031] The multispectral image is divided into pixel block units according to a fixed spatial scale, which serve as the basis for local density analysis, while maintaining spatial statistical consistency within each unit.
[0032] Extracting Inner Pixels (NDI) in Each Pixel Block m The mean and variance of the values form the density vector D. k This involves combining the mean and variance into a two-dimensional vector, which is used to uniformly describe the density difference relationship between different pixel blocks.
[0033] The density vector difference ΔD between adjacent pixel blocks k =||D k -Dk+1 ‖2 is normalized to obtain the density variation rate, forming a density gradient map; where ΔD k D represents the variation in density structure between adjacent pixel blocks, ||·|2 is the L2 norm, and D k and D k+1 These are the density vectors extracted from adjacent pixel blocks, respectively.
[0034] As can be seen, this invention effectively eliminates low-confidence boundaries by introducing a feature response distribution and boundary density modeling mechanism in the initial screening stage of candidate boundaries. It departs from the traditional strategy of using pixel gradient or edge intensity as the sole criterion, instead using regional response stability, boundary pixel concentration, and texture consistency as comprehensive indicators to evaluate from an overall structural level, thus improving the initial quality of the candidate boundary set.
[0035] S2: Based on the density gradient map, extract the density variation rate by sliding a fixed window in the image, determine whether there is a continuous boundary trend, and form a candidate boundary line segment by collecting the set of continuous structural abrupt change points.
[0036] S2.1: Based on the generated density gradient map, set multiple (three types are set in this embodiment, but the specific type can be set according to actual operation) different scales (such as 3×3, 5×5, 7×7) sliding windows, and arrange the density variation rate extracted during the sliding process at each scale in time order to form a trajectory map of density variation rate.
[0037] Generally, smaller scales (e.g., 3×3) are advantageous for capturing local edges or subtle density abrupt changes, while larger scales (e.g., 7×7) better reflect the overall trend of change in the region and are suitable for detecting larger crop patches or slowly changing areas. This invention, by setting three typical scales—3×3, 5×5, and 7×7—aims to improve the robustness and diversity of boundary extraction by integrating information from different resolution levels without sacrificing computational efficiency.
[0038] During the sliding process, the position of the window's center point moves pixel by pixel to the right or bottom of the image. With each movement, the density variation rate within the window's coverage area is extracted and arranged sequentially according to the current sliding order, forming a trajectory point sequence. Since this sequential arrangement resembles the construction of a time series, it can be viewed as a trajectory map of the density variation rate. The inherent changes reflect the continuity and abrupt changes in crop density distribution within the pixel space. For example, if there is a segment in the trajectory where the abrupt density rate rises sharply and then falls back quickly, it likely reflects the existence of a boundary structure between vegetation and bare land in that area.
[0039] Furthermore, if the trajectory perturbation factor is higher than a preset critical ratio threshold, the trajectory is determined to have a density clustering or abrupt change trend, and the involved pixels are marked as abrupt change candidate points. The trajectory perturbation factor is composed of the ratio of the standard deviation to the mean of the density variation rate difference between adjacent point pairs within the trajectory.
[0040] It should be emphasized that the calculation and determination of the trajectory disturbance factor is performed in a one-time forward process at this stage, and its role is limited to marking candidate points; the subsequent geometric consistency and disturbance trend analysis do not affect this initial candidate determination in reverse, thus ensuring that the overall process logic is clear and unidirectional.
[0041] It should be noted that a major advantage of this invention compared to traditional edge detection methods (such as Canny or Sobel) lies in its dynamic feature recognition capability. By analyzing trajectory perturbation factors rather than relying solely on first or second derivatives, this invention can effectively identify regions with certain spatial extension but not necessarily steep edges, making it particularly suitable for complex regions in multispectral images where the contrast between crops and background is blurred or the boundaries are unclear.
[0042] Furthermore, to avoid the interdependence between trajectory perturbation factor determination and trajectory formation, this embodiment introduces a preset density variation rate arrangement path standard in the trajectory construction stage. The density variation rate of consecutive pixels is arranged into the original trajectory sequence based on the window sliding direction (such as from the top left to the bottom right or from the top to the bottom). The trajectory perturbation factor is calculated on this basis, without relying on the reverse reconstruction of the trajectory from the mutation point, thereby ensuring the traceability and unidirectionality of the determination logic.
[0043] As can be seen, the calculation of the trajectory perturbation factor is entirely based on the aforementioned preset trajectory order, without relying on the spatial reverse mapping of candidate mutation points or performing posterior correction operations, thus exhibiting strong forward traceability. This makes the stability of this algorithm significantly higher than that of traditional methods in large-scale image processing, and it is particularly suitable for complex scenes with strong interference from illumination, noise, and crop textures in multi-view low-altitude images.
[0044] S2.2: Aggregate the identified mutation candidate points according to their spatial location in the density gradient map. If the angle change between any consecutive n mutation response points does not exceed m degrees, and the change sequence of the trajectory perturbation factor has a single-peak characteristic (i.e., the local perturbation value first rises and then falls), then the corresponding mutation response point chain will form a candidate boundary line segment.
[0045] In practice, all candidate mutation points are first clustered into mutation response point chains based on their spatial location. Then, an internal perturbation factor sequence is extracted from each mutation response point chain; this sequence originates from previously completed trajectory perturbation calculations. The unimodality of the perturbation sequence serves as a structural screening criterion for boundary line segments, without affecting the original mutation candidate point generation logic. Subsequently, a geometric orientation analysis is performed on each mutation response point chain, calculating the angle of change in the direction of the line connecting any mutation response points. If the angle change does not exceed a set threshold m (e.g., within 15°), the mutation response point chain is judged to exhibit directional consistency and may constitute line segments with consistent boundary orientations.
[0046] On the other hand, the changing trend of the trajectory perturbation factor is also used as one of the screening conditions. Specifically, if the perturbation factor in a certain mutation response point chain shows a single-peak pattern of first rising and then falling within a certain range, it indicates that the line segment has the property of local structural mutation, which meets the basic assumption that the boundary should have the most abrupt change in the center and gradually flatten out on both sides.
[0047] By constructing the chain of mutation response points that satisfy the above conditions of geometric consistency and perturbation unimodality as candidate boundary line segments, the structural reconstruction from points to lines can be completed.
[0048] S2.3: Pair all candidate boundary segments together and calculate the difference in distribution entropy of the corresponding trajectory perturbation factors. If the difference in distribution entropy of the trajectory perturbation factors between two candidate boundary segments is less than k% of the average perturbation entropy, and the angle between the directions of the two candidate boundary segments is less than the angle threshold θ1, then they are merged into the same boundary segment group, where k is a constant.
[0049] It should be noted that there may be breaks, misalignments, or discontinuities between candidate boundary segments, especially common in low-resolution images. To achieve automatic stitching and fusion of boundary segments, this invention uses statistical differences to measure the consistency between segments. The distribution entropy of the perturbation factor reflects the complexity of the overall perturbation state of the segment; a lower entropy value indicates a smoother trajectory and more concentrated changes. If the difference in perturbation entropy between two candidate boundary segments is less than k% of the average perturbation entropy (e.g., assuming k = 15%), they can be determined to have similar perturbation patterns.
[0050] Furthermore, the present invention requires that the angle between the direction angles of the two candidate boundary line segments also be lower than a certain threshold (such as 20°) to ensure the continuity and consistency of the physical boundary orientation.
[0051] Candidate boundary segments that meet the above dual conditions will be merged into the same boundary segment group.
[0052] This invention significantly improves the coherence and logical consistency of boundary recognition through a dual constraint mechanism of information entropy and orientation angle, and is applicable to boundary aggregation and line segment fusion in multi-scale crop boundary detection tasks.
[0053] In summary, this invention significantly improves the reliability assessment capability of boundary segments by employing a local confidence mapping mechanism for candidate boundary points, combined with evaluation methods for inter-point spatial location, texture response, and boundary continuity. Unlike traditional single-point feature or simple gradient thresholding methods, this step can more sensitively capture the structural coherence between segments and the consistency of boundary orientation. Simultaneously, based on an adaptive density alignment strategy, it effectively addresses the risk of boundary segments breaking or misclassifying under scale variations or texture perturbations, resulting in a more coherent boundary structure and a more natural curve transition. Furthermore, for irregular boundary regions, the confidence assessment method can suppress false positives in edge responses, thereby selecting first-level candidate boundaries with stable extensibility.
[0054] S3: Based on the location of the candidate boundary line segments, the region is divided using the grayscale texture uniformity in the low-altitude multispectral image, and an empty ground reference area template is set. The divided regions are quickly matched, and the corresponding candidate boundary line segments are judged and marked as first-level credible boundaries.
[0055] S3.1: Extract the image grayscale matrix within the range of H times the local density window on both sides of each candidate boundary line segment, and construct a two-sided texture distribution map with the candidate boundary line segment as the central axis. In this embodiment of the invention, H is 3, which is derived from the typical ground feature size of the UAV image. The specific value can be set according to the actual operation.
[0056] Specifically, in this embodiment of the invention, the candidate boundary line segment is used as the central axis, and symmetrical regions are expanded on both sides. The expansion scale is set to H times the window width of the vertical length of the candidate line segment. In the specific operation, the value of H can be determined according to the size characteristics of common ground features in typical remote sensing images or UAV low-altitude images. In this invention, H=3 is set, which can effectively cover the texture features of a sufficient area near the boundary. Within this area, the gray value matrix in the original image is extracted and divided into left and right parts according to the boundary normal direction, which are named the left gray-scale texture matrix and the right gray-scale texture matrix, respectively.
[0057] S3.2: Calculate the local gray-scale uniformity index and directional texture variance value for the two-sided texture distribution map respectively, and obtain the difference between the two sides to construct the boundary texture difference map ΔT(x,y) to determine the texture heterogeneity between regions.
[0058] Specifically, for the extracted left and right grayscale texture maps, this invention uses a combination of local mean and local standard deviation as indices to calculate grayscale uniformity. The expression for grayscale uniformity can be given as:
[0059] U(x,y)=1-σ(x,y) / μ(x,y)+∈
[0060] Where σ(x,y) is the standard deviation of gray level in the local region centered at (x,y), μ(x,y) is the mean gray level of the corresponding region, and ∈ is a small constant to prevent the denominator from being zero, ensuring computational stability.
[0061] Simultaneously, the degree of texture variation is measured by calculating the gray-level co-occurrence matrix (GLCM) in four directions: 0°, 45°, 90°, and 135° and statistically analyzing the texture variance. Uniformity and directional texture variance are calculated for the left and right maps, and then the difference is used to obtain a texture difference map. This texture difference map comprehensively describes the texture heterogeneity on both sides of the candidate boundary.
[0062] S3.3: Combining the set empty reference area template, select areas with low texture variance and high grayscale mean to construct a reference texture vector set, and use an asymmetric matching strategy to calculate the similarity between the reference texture vector set and the textures on both sides of the boundary line segment.
[0063] First, the empty ground reference area template is derived from typical texture features extracted from known unstructured areas (such as bare ground, grass, or squares) in the image. It has the characteristics of weak texture directionality, concentrated gray-level distribution, and little detail disturbance, thus possessing good texture background reference.
[0064] Furthermore, in constructing the reference texture vector, instead of relying directly on a fixed threshold, a sorting-filtering mechanism is employed. Specifically, multiple candidate regions are divided from the entire image, and the mean grayscale value and texture variance of each region are calculated. Among all candidate regions, a portion with a texture variance at the lowest 10th percentile (this is only a value set for this example; please set it according to actual conditions) and a local peak where the mean grayscale value is higher than the sample mean is selected as the reference region, forming a dynamically adapted set of reference textures. This set structurally reflects the most sparse and unstructured background representation in the image, effectively enhancing the discriminative power of subsequent texture matching.
[0065] During the boundary confidence assessment process, for each candidate boundary line segment, the grayscale texture information of the symmetrical window regions on the left and right sides is extracted. The grayscale vector of this region is then compared one by one with each vector in the reference texture set. The specific process is as follows:
[0066] First, calculate the texture difference between the region to the left of the boundary and all samples in the reference set (based on the mean square error of the vector difference), and take the smallest difference as the best matching score between that side and the reference texture.
[0067] Then, repeat the same process for the right-hand region;
[0068] Because an asymmetric matching strategy is used, the matching scores on both sides are not required to be the same. Only when the matching score on one side reaches or exceeds the median level of similarity within the reference set is it determined that the boundary line segment has an empty space attribute on at least one side and has a high degree of confidence in structural fracture.
[0069] This approach highlights the texture response characteristics of consistent background regions, avoiding false positives caused by high-frequency structural regions on both sides of the boundary. Furthermore, by combining optimal similarity matching with the median level of the reference set, it circumvents the inadequacy of traditional fixed thresholds, improving the algorithm's generalization ability to various terrains and textures.
[0070] S3.4: When the similarity between a region on one side and the reference texture set is in the high matching distribution range, and the texture difference map ΔT(x,y) at the corresponding position on the other side deviates significantly from the background difference distribution, the candidate boundary segment is labeled as a first-level credible boundary segment.
[0071] Specifically, when a region on one side of the boundary segment (e.g., the left side) is asymmetrically matched with the reference texture set, the best matching score is located in the upper quarter of the median of the matching results of the reference set, indicating that the region on that side has strong spatial consistency. At the same time, the texture difference map ΔT(x,y) at the corresponding position is extracted from the other side region (e.g., the right side). If the local texture difference ΔT(x,y) of this region is at the upper 10% quantile in the overall texture difference distribution, combined with the other side region being at the lower 25% quantile in the similarity matching error distribution, a set of consistent and standardized judgment mechanisms can be formed to ensure that the marked boundary simultaneously possesses high structural heterogeneity and high background consistency.
[0072] This two-sided combination judgment method, where one side has typical background consistency and the other side shows significant heterogeneity, can infer that the candidate boundary line segment is very likely to be a real structural boundary with high confidence, especially when distinguishing artificial structures from background empty space or natural texture turning points, has significant discriminative power.
[0073] Boundary segments that meet the above criteria will be designated as first-level reliable boundary segments.
[0074] In summary, this invention achieves in-depth screening of first-level reliable boundary segments by constructing an enhanced confidence assessment mechanism that integrates boundary morphology matching functions and texture consistency responses. This step departs from the traditional evaluation approach that relies on edge strength or gradient response, instead emphasizing the boundary's local morphological orientation, texture structure consistency, and the multi-scale matching relationships between them. This effectively avoids misjudgments or information loss caused by short-term noise, texture distortion, etc.
[0075] S4: For all candidate boundary segments marked as first-level reliable boundaries, perform structural connections according to the continuity direction to generate a boundary segment sequence and output the final boundary map.
[0076] In embodiments of the present invention, such as Figure 2 As shown, the following operation steps are included:
[0077] S4.1: Based on the candidate boundary segments marked as first-level reliable boundaries, construct the direction vector sequence {V}. k}, and with the current line segment v k Based on this, extract adjacent boundary line segments v k-1 With v k+1 The included angle θ k-1 and θ k+1 .
[0078] Specifically, for any candidate line segment v k By extracting the coordinates of the start and end points, the direction vector expression v in the image coordinate system can be calculated. k = (x2-x1,y2-y1), where (x1,y1) and (x2,y2) are the coordinates of the start and end points, respectively; then the unit direction vector is calculated to eliminate scale differences.
[0079] S4.2: Calculate the directional inertia control factor I k =|θ k-1 -2θ k +θ k+1 | is used to determine whether there is a path reversal or discontinuity response at the current line segment connection point. If I k Connections are allowed if the value is below the dynamic threshold γ1.
[0080] It should be noted that the directional inertia control factor I k It can identify problems such as sharp-angle reversals or abrupt changes in direction in local boundary paths. Essentially, it is equivalent to a second-order difference operation on the direction sequence, reflecting the smoothness of the rate of change of the current line segment's direction. When I... k Smaller, indicating v k The direction of I tends to the average direction between its two adjacent line segments, that is, it exhibits good directional inertia; conversely, if I k A larger value often means v k These are local mutation points, and may exhibit reversal, breakage, or noise interference.
[0081] Furthermore, to ensure adaptability and robustness, the dynamic threshold γ1 can be dynamically set according to the image resolution and the range of candidate boundary line segment lengths, for example, by weighting and adjusting it using the mean square error of the overall boundary density change of the image. Ultimately, only when I k When ≤γ1, the current boundary segment v kOnly then are they allowed to connect with the preceding and following line segments, ensuring that the connection path is geometrically coherent.
[0082] S4.3: Based on connecting boundary line segments v k With v k+1 The directional continuity, density variation rate, and texture inconsistency response are used to calculate the structural connectivity confidence through weighted calculation.
[0083] Among them, directional continuity is defined as cosine similarity, which is used to measure the degree of consistency in orientation between connecting segments.
[0084] S4.4: When the structural connectivity confidence level is higher than the confidence threshold, then the boundary segment v... k With v k+1 Perform the connection and update the boundary segment sequence index; repeat steps S4.1 to S4.4 until all first-level trusted boundaries have been processed.
[0085] The connection process is an iterative discrimination mechanism, starting from the current processed line segment v. k Starting from the beginning, proceed forward in sequence, checking the feasibility of connecting each pair of line segments one by one. If the connection is successful, merge the two line segments into a new boundary segment, update its direction vector to the synthesis direction, and continue moving forward; if the connection fails, skip the current node and process the next pair of line segments.
[0086] S4.5: Map the boundary segment sequence after structural connection back to the original image space to generate the final boundary map, and output it as a stage detection result for subsequent processing.
[0087] In summary, this invention effectively solves the connection error problems caused by path reversal, boundary breakage, or texture abrupt changes in traditional connection methods by using a directional inertia control mechanism and structural confidence during the boundary segment connection stage. Specifically, this invention establishes a comprehensive structural confidence by combining directional consistency, boundary density variation rate, and texture differences, achieving multiple judgments on the rationality of segment connections and enhancing robustness to boundary transitions and weak connection regions. This method maintains boundary continuity while reducing structural artifacts caused by pseudo-connections, resulting in a significant improvement in the coherence, completeness, and accuracy of the final boundary map.
[0088] This embodiment also provides a computer device applicable to the automatic farmland boundary identification method for agricultural drones, including a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to realize the automatic farmland boundary identification method for agricultural drones as proposed in the above embodiment.
[0089] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0090] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements the method for automatic identification of farmland boundaries for agricultural drones as proposed in the above embodiments.
[0091] In summary, this invention can accurately identify the location of farmland boundaries in images, achieving relatively stable boundary judgment even when different crops or plots are connected, or when local blurring exists. Through reliable boundary filtering and structural connection mechanisms, this invention effectively suppresses false boundary responses caused by image noise and local texture disturbances, improving the continuity and reliability of the final boundary map. Therefore, this invention possesses significant technical advantages, including high automatic recognition accuracy, strong adaptability, and good boundary structure coherence.
[0092] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for automatic identification of farmland boundaries using agricultural drones, characterized in that: include: Based on low-altitude multispectral images collected by UAVs, a density gradient distribution map of crops in farmland areas is constructed, wherein the density gradient is divided into pixel blocks and the density variation rate is labeled. Based on the density gradient distribution map, the density variation rate is extracted by sliding a window in the image to determine whether there is a continuous boundary trend, and the set of continuous structural abrupt points is formed into candidate boundary line segments. Based on the location of the candidate boundary line segments, the region is divided using the grayscale texture uniformity in the low-altitude multispectral image, and an empty ground reference area template is set. The divided regions are quickly matched, and the corresponding candidate boundary line segments are judged and marked as first-level credible boundaries. For all candidate boundary segments marked as first-level reliable boundaries, structural connections are made according to the continuity direction to generate a boundary segment sequence and output the final boundary map.
2. The method for automatic farmland boundary identification using agricultural drones as described in claim 1, characterized in that: The calculation of the density variation rate includes: Extract the mean and variance of the normalized vegetation index of each pixel in each pixel block to form a density vector D. k The density vector difference between adjacent pixel blocks is normalized to obtain the density variation rate. The expression for normalizing the density vector difference between adjacent pixel blocks is: ΔD k =||D k -D k+1 ||2; where ΔD k D represents the variation in density structure between adjacent pixel blocks, ||·|2 is the L2 norm, and D k and D k+1 These are the density vectors extracted from adjacent pixel blocks, respectively.
3. The method for automatic farmland boundary identification using agricultural drones as described in claim 1, characterized in that: The density variation rate extraction based on window sliding in the image includes: Based on the generated density gradient map, multiple sliding windows of different scales are set up, and the density variation rate extracted during the sliding process at each scale is arranged in time order to form a trajectory map of density variation rate. The ratio of the standard deviation to the mean of the density variation rate difference between adjacent point pairs within the trajectory is used as the trajectory perturbation factor. If the trajectory disturbance factor is higher than the preset critical ratio threshold, it is determined that the corresponding trajectory has a density clustering or abrupt change trend, and the involved pixels are marked as abrupt change candidate points.
4. The method for automatic farmland boundary recognition by agricultural drones as described in claim 3, characterized in that: The formation of the candidate boundary line segment includes: The identified mutation candidate points are aggregated according to their spatial location in the density gradient map. If the angle change between any n consecutive mutation response points does not exceed m degrees and the change sequence of the trajectory perturbation factor has a single-peak feature, then the corresponding mutation response point chain is used to form a candidate boundary line segment, where n and m are constants. All candidate boundary segments are paired up, and the difference in distribution entropy of the corresponding trajectory perturbation factor is calculated. If the difference in distribution entropy of the trajectory perturbation factor between two candidate boundary segments is less than k% of the average perturbation entropy, and the angle between the directions of the two candidate boundary segments is less than the angle threshold θ1, then they are merged into the same boundary segment group, where k is a constant.
5. The method for automatic farmland boundary identification using agricultural drones as described in claim 1, characterized in that: The method of dividing regions using the uniformity of grayscale texture in the density gradient distribution map includes: Extract the image grayscale matrix within the range of H times the local density window on both sides of each candidate boundary line segment, and construct a two-sided texture distribution map with the candidate boundary line segment as the central axis, where H is a constant; The local gray-scale uniformity index and directional texture variance value are calculated for the two-sided texture distribution map, and the difference between the two sides is obtained to construct the boundary texture difference map and determine the texture heterogeneity between regions.
6. The method for automatic farmland boundary recognition by agricultural drones as described in claim 5, characterized in that: The process of quickly matching the divided regions includes: constructing a reference texture vector set based on a set empty reference area template, and performing similarity calculations with the textures on both sides of the boundary line segment.
7. The method for automatic farmland boundary recognition by agricultural drones as described in claim 1, characterized in that: The step of connecting structures according to the continuity direction to generate a sequence of boundary segments includes: Based on the candidate boundary segments marked as first-level reliable boundaries, construct the direction vector sequence {V}. k }, and with the current line segment v k Based on this, extract adjacent boundary line segments v k-1 With v k+1 The included angle θ k-1 and θ k+1 ; Calculation of directional inertial control factor I k Determine if there is a path reversal or discontinuity response at the current line segment connection point. If I k Connections are allowed if the value is below the dynamic threshold γ1; Based on the connection boundary line segment v k With v k+1 The directional continuity, density variation rate, and texture inconsistency response are used to calculate the structural connectivity confidence through weighted calculation. When the structural connectivity confidence level is higher than the confidence threshold, then the boundary segment v is... k With v k+1 Perform the connection and update the boundary segment sequence index; repeat the structural connection process until all first-level trusted boundaries are completed.
8. The method for automatic farmland boundary identification using agricultural drones as described in claim 7, characterized in that: The directional inertial control factor I k The calculation is as follows: I k =|θ k-1 -2θ k +θ k+1 | 9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the automatic farmland boundary identification method for agricultural drones according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the automatic farmland boundary identification method for agricultural drones according to any one of claims 1 to 8.
Citation Information
Patent Citations
High-standard farmland plot boundary automatic identification method based on satellite image
CN117197686A
Cited By
Intelligent positioning method and system for plate cutting
CN121661134A