Remote sensing image cultivated land plot drawing method and system, medium and product

By optimizing the extraction of farmland plots from remote sensing images using shape classification indicators and contour simplification parameters, the problem of inconsistent plot quality was solved, resulting in vector maps of farmland plots with regular shapes, accurate boundaries, and no topological errors, thus improving the quality of farmland plot maps.

CN121921389APending Publication Date: 2026-04-24TWENTY FIRST CENTURY AEROSPACE TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TWENTY FIRST CENTURY AEROSPACE TECH CO LTD
Filing Date
2026-01-09
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies for extracting farmland plots from remote sensing images produce patch quality that is inconsistent, with fragmented shapes and jagged edges. This fails to meet the strict specifications for regularity of patch shape, straightness of edges, and rationality of node distribution in mapping operations, resulting in significant deviations between the final results and the actual field morphology.

Method used

By acquiring grayscale extraction results of cultivated land plots and range auxiliary data, the range of raster cultivated land is determined. Map patches are extracted using mask constraints, and shape classification indicators are calculated for classification. Morphological regularization and pixel filling are performed, and vector boundaries are optimized by combining inner and outer contour simplification parameters to achieve differentiated processing.

Benefits of technology

It improves the quality of farmland plot mapping, reduces plot fragmentation, enhances the integrity and boundary smoothness of plots, and ensures the shape regularity and topological correctness of vector results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921389A_ABST
    Figure CN121921389A_ABST
Patent Text Reader

Abstract

The invention provides a remote sensing image cultivated land plot drawing method and system, a medium and a product. In the method, a server determines a grid cultivated land range based on a cultivated land block gray level extraction result map or cultivated land range auxiliary data. Then, the server masks the cultivated land block gray level extraction result by using the cultivated land range to obtain cultivated land block pattern spots, and the pattern spots with the large shape abnormal degree are recognized and removed according to the geometric morphology of the cultivated land block pattern spots and are converted into areas to be filled; and meanwhile, pattern spots with relatively small form abnormal degree are subjected to form regularity optimization, and the regularity is improved. And then, the server fills the to-be-filled area by using the regularized pattern spots to reduce the crushing degree of the land parcels. And finally, the server not only ensures the leakproofness between the plots, but also improves the smoothness of the outer boundary of the plot by distinguishing the inner contour from the outer contour and applying differentiated simplified parameters, thereby generating a farmland plot vector result graph which is regular in shape, accurate in boundary and free of topological errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of geographic information engineering technology, and in particular to a method, system, medium and product for mapping farmland plots using remote sensing images. Background Technology

[0002] With the rapid development of high-resolution remote sensing technology and geographic information systems, the refined management and monitoring of arable land resources has become an important aspect of agricultural modernization. As the basic unit of agricultural production, the accurate acquisition of information on the spatial distribution, shape characteristics, and boundaries of arable land plots is crucial for arable land protection, land rights registration, and the distribution of agricultural subsidies.

[0003] In related technologies, the extraction of farmland plots from remote sensing imagery mainly focuses on improving the accuracy of plot edge recognition. A common approach is to obtain grayscale extraction results of farmland plots through image segmentation and edge detection, and then process the grayscale results using basic operations such as morphological dilation and erosion to improve the continuity of plot boundaries. After generating vector polygons, the number of nodes in the polygons is reduced using the Douglas-Peucker algorithm or similar vertex thinning methods, resulting in smoother vector boundaries, reduced data redundancy, and thus better farmland plot mapping results.

[0004] However, the quality of the patches produced by the above method varies greatly in practical applications. All grayscale patches, regardless of their regularity, are directly converted into vector polygons, resulting in a large number of low-quality patches with broken shapes and jagged edges in the final result. This fails to meet the strict specifications for patch shape regularity, edge straightness, and node distribution in cartography, and the final output of cultivated land vector data still has a significant deviation from the actual field morphology on the ground. Summary of the Invention

[0005] This application provides a method, system, medium, and product for mapping farmland plots from remote sensing images, which alleviates the technical problem of large deviations between the generated farmland plot maps and the actual field shapes, and improves the drawing quality of farmland plot maps.

[0006] Firstly, this application provides a method for mapping cultivated land parcels from remote sensing imagery, applied to a server of a mapping system. The method includes: acquiring grayscale extraction result images of cultivated land parcels to be processed and auxiliary data of cultivated land boundaries; determining the raster cultivated land boundary based on the grayscale extraction result images or the auxiliary data of cultivated land boundaries; applying a mask constraint to the grayscale extraction result images of cultivated land parcels using the raster cultivated land boundaries to obtain cultivated land parcel patches, wherein the mask constraint represents retaining the pixel values ​​of the grayscale extraction result images of cultivated land parcels located within the raster cultivated land boundaries; calculating the shape classification index of each cultivated land parcel patch; classifying the cultivated land parcel patches based on the shape classification index to obtain classification results, and determining the areas in the classification results where patches can be removed as areas to be filled. The classification results include retained patches, optimizable patches, and removable patches. Morphological normalization is performed on the retained and optimizable patches to obtain optimized patches. Based on these optimized patches, a patch filling algorithm is used to fill the areas to be filled with pixels, resulting in an optimized grayscale image of the cultivated land plot. The optimized grayscale image of the cultivated land plot is then rasterized to obtain vector elements of the cultivated land plot. These vector elements represent closed geometric polygons that describe the spatial boundary of the cultivated land plot, enclosed by sequentially connected coordinate nodes. The inner and outer contours of the vector elements are identified, and simplified based on corresponding contour simplification parameters to obtain the final vector image of the cultivated land plot.

[0007] By adopting the above technical solution, the server first determines the raster farmland range based on the grayscale extraction result image of farmland plots or auxiliary data of farmland area, and uses the raster farmland range to apply mask constraints to the grayscale extraction result of farmland plots, ensuring the spatial accuracy of farmland plot patches. Then, the server classifies farmland plot patches by calculating shape classification indicators, removing patches with significant shape anomalies and converting them into areas to be filled, while regularizing patches with minor shape anomalies. This differentiated processing avoids low-quality patches directly entering the final result. Next, the server uses the optimized patches to fill the areas to be filled pixel by pixel, reducing the fragmentation of plots and improving the integrity of the patches. Finally, the server identifies the inner and outer contours and applies differentiated simplification parameters, improving the smoothness of the outer boundaries of plots while ensuring the tightness between plots, resulting in a vector image of farmland plots with regular shapes, accurate boundaries, and no topological errors. This method alleviates the technical problem of large deviations between the generated farmland plot map and the actual field shape, improving the rendering quality of farmland plot maps.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, the raster farmland range is determined based on the grayscale extraction result image of farmland plots or auxiliary data of farmland range. Specifically, this includes: when using the grayscale extraction result image of farmland plots, performing binarization processing on the grayscale extraction result image of farmland plots to obtain an initial raster farmland range; performing morphological processing and edge regularization processing on the initial raster farmland range to obtain a regular raster farmland range; when using auxiliary data of farmland range, performing vector rasterization processing and binarization processing on the auxiliary data of farmland range to obtain the raster farmland range, wherein the binarization processing includes direct binarization or grayscale conversion followed by binarization.

[0009] By adopting the above technical solution, the server first selects the appropriate processing path based on different data sources. When using the grayscale extraction result image of cultivated land plots, binarization processing is used to convert the grayscale information into a binary image, clearly defining the boundary between cultivated and non-cultivated land. Then, the server performs morphological processing and edge regularization processing on the initial raster cultivated land range, eliminating edge irregularities and obtaining a regular raster cultivated land range. When using auxiliary data for cultivated land ranges, the server converts vector data into raster form through vector rasterization processing, ensuring data format consistency with the grayscale extraction result image. Then, the server obtains the raster cultivated land range through binarization processing. This method achieves unified processing for different data sources, improving the flexibility and accuracy of raster cultivated land range determination.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, the grayscale extraction result image of cultivated land plots is masked and constrained using the grid cultivated land range to obtain cultivated land plot patches. Specifically, this includes: traversing the grid cultivated land range, identifying connected regions within the grid cultivated land range, and calculating the area of ​​each connected region; using connected regions whose area reaches a preset area threshold as target cultivated land range patches; constructing an outer rectangular window for the target cultivated land range patches; using the outer rectangular window to determine a sampling area in the grayscale extraction result image of cultivated land plots, and reading pixel values ​​from the sampling area; using the target cultivated land range patches as a mask to extract pixel values ​​located within the coverage area of ​​the target cultivated land range patches to obtain cultivated land plot patches.

[0011] By employing the above technical solution, the server first traverses the raster farmland area and identifies connected regions. It then calculates the area of ​​each connected region to filter out target farmland patches, discarding areas with excessively small areas. Next, the server constructs an outer rectangular window for the target farmland patches to determine efficient sampling regions, avoiding the computational overhead of processing the entire image. Finally, the server uses the outer rectangular window to read pixel values ​​from the grayscale extraction result image of the farmland plots and uses the target farmland patches as a mask to accurately extract pixel values ​​within the farmland area, obtaining the farmland plot patches. This method achieves precise extraction of farmland plots, improving the accuracy and efficiency of subsequent processing.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, cultivated land parcels are classified based on shape classification indicators to obtain classification results. Specifically, this includes: classifying cultivated land parcels according to shape classification indicators and a parcel classification formula to obtain classification results. The parcel classification formula is as follows:

[0013] In the classification formula for land parcels, O represents cultivated land parcels; C0 represents the classification result of cultivated land parcels, which includes retained parcels, parcels that can be optimized, and parcels that can be removed; O S O represents the area of ​​cultivated land parcels. C R represents the perimeter of the cultivated land parcel; R represents the minimum bounding rectangle of the cultivated land parcel; R S R represents the area of ​​the smallest bounding rectangle; C R represents the perimeter of the smallest bounding rectangle; L R represents the length of the longest side of the smallest bounding rectangle. W R represents the length of the shorter side of the smallest bounding rectangle; L / R W O represents the aspect ratio of the smallest bounding rectangle. C / O S O represents the ratio of the perimeter to the area of ​​the smallest bounding rectangle. S / R S T1 represents the rectangularization index of the smallest bounding rectangle; T2 represents the aspect ratio threshold; T3 represents the perimeter-area ratio threshold; and T4 represents the rectangularization index threshold.

[0014] By employing the aforementioned technical solution, the server first calculates the area, perimeter, and minimum bounding rectangle parameters of cultivated land parcels, constructing quantitative indicators to describe the shape characteristics of the parcels. Then, the server determines the elongation or narrowness of the parcels based on their aspect ratio, assesses the complexity of the parcel boundaries based on the perimeter-to-area ratio, and measures the similarity between the parcels and regular rectangles based on the rectangularity index. These three indicators characterize the shape features of the parcels from different dimensions. Next, the server classifies cultivated land parcels into three categories based on a parcel classification formula: retained parcels, optimizable parcels, and removable parcels, achieving accurate identification of parcels of different quality. Finally, the server identifies the areas of removable parcels as the areas to be filled. This method achieves automatic parcel classification based on shape features, laying the foundation for differentiated processing.

[0015] In conjunction with some embodiments of the first aspect, in some embodiments, morphological regularization processing is performed on the retained and optimizable patches to obtain optimized patches. Specifically, this includes: setting corresponding erosion coefficients for the retained and optimizable patches respectively, where the erosion coefficient is the ratio of the area after erosion to the area before erosion; obtaining the original areas of the retained and optimizable patches; iteratively eroding the retained and optimizable patches using a filter kernel of a preset size, and calculating the area ratio of the current area after erosion to the original area after each erosion; stopping erosion when the area ratio is less than the erosion coefficient, and recording the total number of erosions; dilating the eroded patches using a filter kernel of a preset size to obtain optimized patches with regular edges, where the number of dilations is equal to the total number of erosions; and adding the eroded pixel areas to the area to be filled to obtain the updated area to be filled.

[0016] By employing the above technical solution, the server first sets different erosion coefficients for retained and optimizable patches, achieving differentiated processing intensity control. Then, the server iteratively eliminates irregular protrusions at the patch edges through erosion, controlling the erosion degree by comparing the area ratio with the erosion coefficient, thus preventing patch disappearance due to over-erosion. Next, the server restores the original size of the patch using a dilation operation equal to the number of erosion operations, achieving edge regularization while maintaining a relatively constant patch area. Finally, the server adds the eroded pixel areas to the area to be filled, ensuring no holes are generated during processing. This method achieves adaptive optimization of patch shape, improving patch regularity and boundary smoothness.

[0017] In conjunction with some embodiments of the first aspect, in some embodiments, based on the optimized patch, a patch filling algorithm is used to fill pixels in the area to be filled to obtain an optimized grayscale result image of the cultivated land plot. Specifically, this includes: obtaining the outermost contour pixels of the updated area to be filled, and traversing the contour in a clockwise direction to obtain a traversal sequence; in the traversal sequence, determining the direction from the current pixel to the next pixel as the target direction; determining the four neighboring pixels that form a 90-degree counterclockwise angle with the target direction, and identifying the patch category to which the four neighboring pixels belong; if the four neighboring pixels belong to the optimized patch, then filling the pixel value of the current pixel with the pixel value of the optimized patch; when all pixels in the area to be filled are filled, the iterative filling of the updated area to be filled is ended, and an optimized grayscale result image of the cultivated land plot is obtained.

[0018] By employing the above technical solution, the server first obtains the outermost contour pixels of the updated area to be filled and traverses them clockwise to establish an ordered processing sequence. Then, the server determines the target direction of the current pixel and identifies the four neighboring pixels at a 90-degree counter-clockwise angle to the target direction. This directional determination ensures the spatial continuity of the filling. Next, the server fills the pixel values ​​according to the patch category of the four neighboring pixels, allowing the area to be filled to inherit the attributes of adjacent optimized patches. Finally, the filling is iteratively completed until all pixels are filled, resulting in the optimized grayscale image of the farmland plot. This method achieves filling based on spatial adjacency, reducing plot fragmentation and improving the integrity of farmland plots.

[0019] In conjunction with some embodiments of the first aspect, in some embodiments, the inner contour and outer contour are simplified based on corresponding contour simplification parameters to obtain the final vector result map of cultivated land parcels. Specifically, this includes: traversing vector features to obtain deduplicated feature nodes, where a feature node is a feature point that simultaneously belongs to at least two vector features and has at least three non-overlapping adjacent points; using feature nodes to decompose the boundaries of vector features into multiple independent line segments; based on the shared edge attribute of multiple independent line segments, determining the line segments shared by adjacent vector features as the inner contour and the non-shared line segments as the outer contour; applying inner contour simplification parameters to the inner contour and outer contour simplification parameters to the outer contour, and thinning and simplifying multiple independent line segments through a line segment simplification algorithm, where the inner contour simplification parameters and outer contour simplification parameters are determined according to the land cover type to which the vector features belong; and recombining the thinned and simplified line segments into closed geometric polygons to obtain the final vector result map of cultivated land parcels.

[0020] By employing the above technical solution, the server first traverses the vector features to obtain deduplicated feature nodes, and then uses these nodes to decompose the boundaries of the vector features into multiple independent line segments, achieving a structured representation of complex boundaries. Next, the server distinguishes between inner and outer contours based on the shared edge attribute of the line segments. The inner contour represents the shared boundary of adjacent plots, while the outer contour represents the external boundary of the plot. Then, the server applies smaller simplification parameters to the inner contour to maintain the tightness between plots, and larger simplification parameters to the outer contour to improve boundary smoothness. This differentiated processing balances topological correctness and visual effect. Finally, the server recombines the simplified line segments into closed geometric polygons to obtain the final vector map of the cultivated land plots. This method achieves intelligent simplification of vector boundaries, improving the smoothness and regularity of plot boundaries while ensuring seamless splicing between plots.

[0021] In a second aspect, this application provides a server for a mapping system, the server comprising: one or more processors and a memory; the memory being coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors calling the computer instructions to cause the server of the mapping system to perform the method as described in the first aspect and any possible implementation thereof.

[0022] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on a server of a cartographic system, cause the server of the cartographic system to perform the method described in the first aspect and any possible implementation thereof.

[0023] Fourthly, this application provides a computer program product, including a computer program / instruction that, when run on a server of a mapping system, causes the server of the mapping system to perform the method described in the first aspect and any possible implementation thereof.

[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. By adopting a differential processing method for patch based on shape classification index and using the technique of pixel filling of the area to be filled by optimized patches, the technical problem of directly converting all grayscale patches into vector polygons regardless of their shape regularity is effectively alleviated, resulting in a large number of low-quality patches with broken shapes and obvious jagged edges in the final result. This achieves the technical effect of reducing the fragmentation of land parcels and improving the integrity and spatial continuity of cultivated land parcels.

[0025] 2. By adopting a differentiated processing method that sets different corrosion coefficients for retained and optimizable patches, and by using symmetrical operations of iterative corrosion and equal-number expansion to keep the patch area basically unchanged, the technical problems of irregular protrusions and low shape regularity at the patch edges are effectively alleviated, thereby achieving the technical effects of adaptive optimization of patch shape and improved boundary smoothness.

[0026] 3. By adopting a topology-preserving technique that simplifies the inner and outer contours based on the corresponding contour simplification parameters and then recombines them into vector plots, the technical problems of holes and topological errors that are prone to occur after processing by traditional simplification algorithms are effectively alleviated. This achieves the technical effect of generating vector result maps of cultivated land plots with regular shapes, accurate boundaries, and no topological errors. Attached Figure Description

[0027] Figure 1This is a flowchart illustrating a method for mapping farmland plots using remote sensing imagery, as described in this application. Figure 2 This is a schematic diagram of the grayscale extraction result of cultivated land plots in an embodiment of this application; Figure 3 This is a schematic diagram of auxiliary data for cultivated land area in an embodiment of this application; Figure 4 This is a schematic diagram of the optimized grayscale result of cultivated land plots in an embodiment of this application; Figure 5 This is a schematic diagram of a vector result map of cultivated land plots in an embodiment of this application; Figure 6 This is another flowchart illustrating the method for mapping farmland plots using remote sensing imagery in the embodiments of this application; Figure 7 This is a schematic diagram of the hardware structure of the server of the mapping system in this application embodiment. Detailed Implementation

[0028] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0029] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0030] For ease of understanding, the method provided in this implementation is described in process below. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating a method for mapping farmland plots using remote sensing images in an embodiment of this application.

[0031] 101. Obtain the grayscale extraction result map of the cultivated land plots to be processed and the auxiliary data of the cultivated land range. Based on the grayscale extraction result map of the cultivated land plots or the auxiliary data of the cultivated land range, determine the raster cultivated land range.

[0032] Please see Figure 2 This is a schematic diagram of the grayscale extraction result of cultivated land plots in an embodiment of this application; please refer to... Figure 3This is a schematic diagram of auxiliary data for cultivated land area in an embodiment of this application.

[0033] The grayscale extraction result map of cultivated land plots refers to the grayscale image generated after extracting cultivated land plots through remote sensing image processing technology. Different grayscale values ​​in this grayscale image represent the distribution of different cultivated land plots. Auxiliary data for cultivated land range is used to represent the spatial range information of cultivated land distribution, including existing cultivated land vector boundary data, land classification and utilization status maps, or auxiliary reference data such as crop planting statistics. Raster cultivated land range represents the spatial distribution area of ​​cultivated land stored in raster form, where cultivated land areas and non-cultivated land areas are distinguished by different pixel values. The initial raster cultivated land range refers to the preliminary rasterized result obtained by directly binarizing the grayscale extraction result map of cultivated land plots. Vector rasterization processing refers to the process of converting vector format spatial data into raster format.

[0034] Specifically, the mapping system's server obtains the grayscale extraction results of the cultivated land plots and auxiliary data of the cultivated land area from the data storage module or external data interface. When the grayscale extraction results of the cultivated land plots are selected as input, the server performs binarization processing on the grayscale extraction results. By setting an appropriate threshold (e.g., grayscale value 127), the grayscale image is converted into a binary image, where pixels greater than the threshold are set to 255 (representing cultivated land areas), and pixels less than or equal to the threshold are set to 0 (representing non-cultivated land areas), thus obtaining the initial raster cultivated land area. Subsequently, the server performs morphological processing on the initial raster cultivated land area. First, it uses 3×3 or 5×5 structuring elements to perform a closing operation to fill internal holes, then performs an opening operation to remove small noise points, and then performs edge regularization processing. Boundary pixels are identified through edge detection algorithms, and the boundaries are smoothed using polynomial fitting or spline curve fitting methods, finally obtaining a regular raster cultivated land area. When using auxiliary data for cultivated land extent as input, if the auxiliary data is in vector format (such as shapefile format), the server performs vector rasterization on the auxiliary data based on the pixel size and projection information of the grayscale extraction result image of the cultivated land plots to be processed, resulting in a rasterized cultivated land extent. For vector reference maps with large or densely distributed reference vector patches (such as land classification data maps), the server adopts a grayscale-then-binarization process. That is, the vector elements in the auxiliary data are rasterized into grayscale patches of 1-255, and then the non-zero value areas in the rasterized cultivated land extent are binarized starting from pixel value 1 until all grayscale values ​​are processed. This ensures that the resulting cultivated land extent patches are not too large, or avoids the formation of large areas of cultivated land after binarization. If the rasterized result is already a binary image, the server can directly use this binary image as the rasterized cultivated land extent.

[0035] 102. Apply mask constraints to the grayscale extraction results of cultivated land plots using the grid cultivated land range to obtain cultivated land plot patches. Mask constraints mean retaining the pixel values ​​of the grayscale extraction results of cultivated land plots located within the grid cultivated land range.

[0036] Mask constraint refers to the process of using the grid farmland range as a mask template, retaining only the pixel values ​​within the mask coverage area, and setting the pixel values ​​outside the mask as background values; farmland plots represent independent farmland plot areas obtained after mask constraint processing, and each farmland plot represents a farmland plot unit.

[0037] Specifically, the server first traverses the entire raster farmland image, using a connected component analysis algorithm (such as a connected component labeling algorithm based on disjoint-set data structure) to identify all connected regions within the raster farmland area, assigning a unique identifier to each connected region. The server then traverses each labeled connected region, counting the number of pixels it contains as its area value. If the image contains geographic coordinate information, the server converts the pixel count into the actual geographic area. The server compares the calculated connected region area with a preset area threshold, for example, a threshold of 100 pixels or 0.5 hectares. Connected regions with areas smaller than this threshold are removed, retaining only those reaching the preset area threshold as target farmland patches. For each target farmland patch, the server traverses all pixel coordinates of the patch, finding the minimum row number, maximum row number, minimum column number, and maximum column number, and constructs an outer rectangular window for the target farmland patch using these four boundary values. Based on the coordinate range of the outer rectangular window, the server locates the corresponding sampling area in the farmland plot grayscale extraction result image and reads the grayscale values ​​of all pixels from this sampling area into a memory buffer. The server creates a result matrix of the same size as the sampling area. It iterates through each pixel position in the sampling area and checks whether the corresponding position in the target cultivated land area patch is a cultivated land pixel (pixel value is 255 or 1). If it is, the pixel value of the corresponding position in the cultivated land patch grayscale extraction result image is copied to the result matrix. If not, the corresponding position in the result matrix is ​​set to the background value (usually 0). Through this pixel-by-pixel masking operation, the cultivated land patch that only contains the effective pixel values ​​within the area covered by the target cultivated land area patch is finally obtained.

[0038] 103. Calculate the shape classification index of each cultivated land plot.

[0039] Shape classification indexes refer to a set of quantitative parameters used to classify the morphological characteristics of cultivated land plots.

[0040] Specifically, the server first traverses each individual farmland plot, using a connected component analysis algorithm to ensure that each farmland plot is an independent connected region. For each farmland plot, the server counts the total number of pixels contained in that plot as the plot area (O). S If the image contains geographic coordinate information, the number of pixels is multiplied by the actual area of ​​a single pixel to obtain the actual geographic area in square meters or hectares. The server calls the contour lookup function in the computer vision processing library (specifically, the cv2.findContours function in the OpenCV library) to obtain the contour information of each farmland plot. Based on the contour information, the server obtains the perimeter (O) of the farmland plot. C Simultaneously, the server obtains the minimum bounding rectangle of the cultivated land plot based on the outline information, and calculates the area (R) of the minimum bounding rectangle. S ), perimeter (R) C ), length of the longer side (R) L ) and the length of the shorter side (R) W The server calculates the ratio of the longer side length to the shorter side length to obtain the aspect ratio (R) of the minimum bounding rectangle. L / R W This index reflects the elongation of cultivated land parcels; a higher ratio indicates a longer and narrower parcel. The server calculates the ratio of the parcel's perimeter to its area, obtaining the perimeter-to-area ratio (O). C / O S This index reflects the complexity of farmland plot boundaries. For plots of the same area, the more tortuous and complex the boundaries, the larger this ratio. The server calculates the ratio of the plot area to the area of ​​the smallest bounding rectangle, obtaining the rectangularization index (O). S / R S This index reflects the similarity between the shape of cultivated land parcels and rectangles, with a value range of (0, 1]. The closer the value is to 1, the closer the shape of the parcel is to a regular rectangle. Finally, the server uses the calculated aspect ratio of the minimum bounding rectangle, the perimeter-area ratio, and the rectangularization index as the shape classification index for the cultivated land parcel.

[0041] 104. Classify cultivated land parcels based on shape classification indicators, obtain classification results, and determine the areas in the classification results where parcels can be removed as areas to be filled. The classification results include retained parcels, parcels that can be optimized, and parcels that can be removed.

[0042] The classification result refers to the classification result of cultivated land parcels into different quality levels according to the shape classification index; retained parcels represent cultivated land parcels with regular shapes; optimizable parcels are used to represent cultivated land parcels with certain shape defects but which can be improved through morphological regularization; removable parcels refer to low-quality cultivated land parcels with severely irregular shapes, high fragmentation, and need to be removed; the area to be filled represents the blank area left after the removable parcels are removed.

[0043] Specifically, the server first loads a pre-defined set of classification thresholds (e.g., aspect ratio threshold T1, perimeter-to-area ratio threshold T2, and rectangularization index threshold T3). Then, for each farmland plot O, the server compares its calculated indicators with the corresponding thresholds. The definitions are as follows: For the cultivated land parcel O, its area is O. S The perimeter is O C The smallest bounding rectangle is R, and its area is R. S The perimeter is R C The length of the longer side is R. L The shorter side is R. W The aspect ratio of the smallest bounding rectangle is R. L / R W The ratio of perimeter to area is O C / O S The rectangularization index is O S / R S Its category C0 is obtained using the following formula:

[0044] T1, T2, and T3 are preset thresholds, which can be adjusted according to specific application scenarios and data characteristics. T1 is the minimum bounding rectangle aspect ratio threshold, ranging from [1, ∞); T2 is the perimeter-to-area ratio threshold, ranging from (0, ∞); and T3 is the rectangularization index threshold, ranging from (0, 1). The rectangularization index characterizes the degree to which a patch fills its minimum bounding rectangle. The closer the value is to 1, the closer the shape of the farmland plot is to a regular rectangle, conforming to the characteristics of standard farmland; the smaller the value, the more elongated, curved, or fragmented the patch shape is. For example, a set of selectable thresholds is: T1=5, T2=10, T3=0.8. That is, the minimum bounding rectangle aspect ratio T1 is set to 5, the perimeter-to-area ratio threshold T2 is set to 10, and the rectangularization index threshold T3 is set to 0.8.

[0045] Finally, the server iterates through all classification results and marks the areas that are classified as removable patches. The pixel values ​​of these areas are set to specific background values ​​(such as 0), forming areas to be filled. These areas will be filled in subsequent steps using neighboring high-quality patches to reduce the fragmentation of the plots and improve the overall mapping quality.

[0046] 105. Morphological normalization is performed on the retained and optimizable patches to obtain optimized patches. Based on the optimized patches, the patch filling algorithm is used to fill the area to be filled with pixels to obtain the optimized grayscale result image of the cultivated land plot.

[0047] Please see Figure 4 This is a schematic diagram of the optimized grayscale result of cultivated land plots in an embodiment of this application.

[0048] Morphological normalization refers to the process of improving the edge shape of a patch through erosion and dilation operations in mathematical morphology; the optimized patch refers to a cultivated land patch with more regular edges; the patch filling algorithm is an algorithm that assigns appropriate pixel values ​​to the pixels in the area to be filled based on the four-neighbor relationship; the grayscale result image of the optimized cultivated land patch represents the raster image after morphological normalization and pixel filling.

[0049] Specifically, the server first sets corresponding erosion coefficients for the retained and optimizable patches respectively. For example, the erosion coefficient for the retained patches is set to 0.95 (light processing), and the erosion coefficient for the optimizable patches is set to 0.85 (stronger processing). The setting of the erosion coefficient reflects the processing intensity of patches of different quality. Then, the server obtains the original area of ​​each retained and optimizable patch, that is, the number of pixels contained in the patch is counted as an initial reference value. Then, it uses a filter kernel of a preset size (such as a 3×3 all-one matrix) to iteratively erode the retained and optimizable patches. Each erosion operation removes pixels from the edge of the patch, causing the patch to gradually shrink. After each erosion, the server calculates the area ratio of the current area after erosion to the original area. When the area ratio is less than the set erosion coefficient, the server stops the erosion operation and records the total number of erosions. For example, if the original area of ​​an optimizable patch is 1000 pixels, after 5 erosions, the area becomes 840 pixels. The area ratio 0.84 is less than the erosion coefficient 0.85, so the erosion stops and the number of erosions is recorded as 5. Next, the server uses the same preset-size filter kernel to perform a dilation operation on the eroded patch. The number of dilation operations equals the total number of recorded erosion operations. Through the same number of dilation operations, the patch is basically restored to its original size, but the edges become more regular, resulting in an optimized patch. The server marks the pixel regions removed during the erosion process and adds these pixel regions to the original unfilled region, forming an updated unfilled region. Next, the server obtains the outermost contour pixels of the updated unfilled region and uses a boundary tracking algorithm to traverse the contour in a clockwise direction, generating an ordered traversal sequence. In the traversal sequence, for each contour pixel, the server determines the direction from the current pixel to the next pixel as the target direction. For example, if the next pixel is to the right of the current pixel, the target direction is to the right. The server determines the positions of the four neighboring pixels at a 90-degree counterclockwise angle to the target direction. For example, if the target direction is to the right, the 90-degree counterclockwise direction is upward, and the corresponding four neighboring pixels are the pixels above the current pixel. The server identifies the patch category to which the four neighboring pixels belong. If the four neighboring pixels belong to the optimized patch, the pixel value of the current outline pixel is filled with the pixel value of the optimized patch. In this way, the pixels in the area to be filled are filled according to their neighboring optimized patches. Finally, the server repeats the filling process, advancing layer by layer inward. When all pixels in the updated area to be filled have been filled, the iterative filling process ends, and the final grayscale result image of the optimized farmland plot is obtained.

[0050] 106. Perform raster vectorization on the optimized grayscale result map of cultivated land plots to obtain vector elements of cultivated land plots. Vector elements represent closed geometric polygons that describe the spatial boundaries of cultivated land plots, which are enclosed by sequentially connected coordinate nodes arranged in an orderly manner.

[0051] Raster vectorization refers to the process of converting raster image data into vector geometric features; vector features are used to represent geospatial features stored in vector form, containing geometric and attribute information; the spatial boundary of cultivated land parcels refers to the outer contour line of cultivated land parcels in geographic space.

[0052] Specifically, the server performs raster vectorization processing on the optimized grayscale image of the farmland plots. This process mainly includes identifying connected regions with the same pixel values ​​in the image, determining the boundary pixels of each connected region, and using Moore-Neighbor Tracing or Freeman Chain Code to start from the initial boundary point and always move along the outer boundary of the connected region, using the 8-neighbor direction (clockwise or counterclockwise) to find the next boundary pixel. This results in a closed geometric polygon consisting of a sequence of coordinate nodes enclosing the connected regions. Through this processing, a set of vector features for the farmland plots is obtained, which can be stored in a standard vector data format (such as Shapefile format).

[0053] 107. Identify the inner and outer contours of the vector elements, and simplify the inner and outer contours based on the corresponding contour simplification parameters to obtain the final vector result map of the cultivated land plot.

[0054] Please see Figure 5 This is a schematic diagram of the vector result map of cultivated land plots in an embodiment of this application.

[0055] The inner contour refers to the boundary line segment shared between adjacent vector features, representing the dividing line between cultivated land plots; the outer contour is used to represent the boundary line segment that vector features do not share with other features, usually the outermost boundary of the cultivated land area; the contour simplification parameter refers to the set of parameters used to control the degree of contour simplification; the cultivated land plot vector result map represents the final vectorized result after optimization and simplification.

[0056] Specifically, the server first traverses the vector features, identifying feature nodes—those that belong to at least two vector features simultaneously. These nodes are typically located at the intersection of multiple farmland plots. For each candidate feature node, the server checks its number of adjacent points; only nodes with at least three unique adjacent points are confirmed as feature nodes. For example, a T-shaped intersection has three adjacent points, and a cross-shaped intersection has four. Next, the server uses the identified feature nodes to decompose the boundary of the vector features into multiple independent line segments. The start and end points of each independent line segment are both feature nodes or the start / end points of vector features. This divides the entire vector feature boundary into several independently processable line segment units. Then, the server analyzes the common-edge attribute of each independent line segment, traversing all vector features and checking if each line segment appears within the boundary of multiple vector features. If a line segment is shared by two or more adjacent vector features, it is marked as an inner contour; if a line segment belongs to only one vector feature, it is marked as an outer contour. The server determines simplification parameters based on the land feature type (representing the category of geographic entities represented by the vector features, such as paddy fields, dry land, etc.). For example, for paddy field plots, the tolerance for the inner contour simplification parameter is set to 0.5 meters, and the tolerance for the outer contour simplification parameter is set to 1.0 meter; for dry land, the tolerance for the inner contour is set to 0.3 meters, and the tolerance for the outer contour is set to 0.8 meters. Next, the server applies stricter inner contour simplification parameters to the inner contour, using the Douglas-Peucker algorithm or the Visvalingam-Whyatt algorithm to thin the nodes, preserving key shape feature points. The server applies more lenient outer contour simplification parameters to the outer contour, allowing for greater simplification to obtain more regular external boundaries while maintaining the accuracy of the overall shape, generating the final vector map of the cultivated land plot. When using cultivated land extent auxiliary data, simplification can be applied only to the inner contour or to both the inner and outer contours simultaneously.

[0057] The remote sensing image-based farmland parcel mapping method in this application involves a server determining the raster farmland extent based on the grayscale extraction result image of the farmland parcels or auxiliary data on the farmland extent. This ensures the spatial accuracy of subsequent processing. The server uses the raster farmland extent to mask and constrain the grayscale extraction result image of the farmland parcels, retaining pixel values ​​within the raster farmland extent to obtain farmland parcel patches, thus achieving accurate extraction of farmland parcels. Next, the server calculates the shape classification index of each farmland parcel patch and classifies the patches based on this index, obtaining classification results including retained patches, optimizable patches, and removable patches. Areas with removable patches are designated as areas to be filled, preventing low-quality patches from directly entering the final result. Then, the server performs morphological regularization on the retained and optimizable patches to obtain optimized patches. Based on these optimized patches, a patch filling algorithm is used to fill the areas to be filled, resulting in an optimized grayscale result image of the farmland parcels. This method achieves edge regularization and reduces parcel fragmentation while maintaining the basic shape of the patches. Finally, the server performs raster vectorization on the optimized grayscale image of cultivated land parcels, obtaining closed geometric polygon vector elements that describe the spatial boundaries of cultivated land parcels, enclosed by sequentially connected coordinate nodes. The inner and outer contours of these vector elements are identified, and simplified based on corresponding contour simplification parameters to obtain the final vector image of cultivated land parcels. This method improves the smoothness of parcel boundaries while ensuring topological correctness between parcels. This approach alleviates the technical problem of significant deviations between the generated cultivated land parcel map and the actual field shape, thus improving the rendering quality of the cultivated land parcel map.

[0058] Based on the above, the following is a more detailed description of the process provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the method for mapping farmland plots using remote sensing images in this application.

[0059] 201. Obtain the grayscale extraction result map of the farmland plots to be processed and the auxiliary data of the farmland range. Based on the grayscale extraction result map of the farmland plots or the auxiliary data of the farmland range, determine the raster farmland range. (This step has been explained in 101.) 202. Apply mask constraints to the grayscale extraction results of farmland plots using the raster farmland area to obtain farmland plot patches. Mask constraints mean retaining the pixel values ​​of the grayscale extraction results of farmland plots located within the raster farmland area. (This step has been explained in 102.) 203. Calculate the shape classification index of each cultivated land parcel. (This step has been explained in 103.) 204. Classify cultivated land parcels based on shape classification indicators to obtain classification results. Identify the areas from the classification results where parcels can be removed as areas to be filled. The classification results include retained parcels, parcels that can be optimized, and parcels that can be removed. (This step has been explained in section 104.) 205. Set the corresponding corrosion coefficients for the retained patches and the patches that can be optimized, respectively. The corrosion coefficient is the ratio of the area after corrosion to the area before corrosion.

[0060] Corrosion coefficient (L) D The morphological erosion area refers to the parameter that controls the intensity of the morphological erosion operation, representing the minimum percentage by which the area of ​​the patch can be reduced to its original area; the post-erosion area refers to the total number of pixels remaining after the morphological erosion operation; the pre-erosion area refers to the total number of original pixels of the patch before the erosion operation.

[0061] Specifically, based on the patch classification results, the server identifies a set of patches to be retained and a set of patches that can be optimized. These two types of patches have different shape and quality characteristics. The server assigns a higher corrosion coefficient to the retained patches, for example, L. D =0.95 means that the erosion operation can reduce the area of ​​the patch to a maximum of 95% of its original area. This mild erosion is mainly used to remove small burrs and noisy pixels at the edges without significantly changing the overall shape of the patch. The server sets a lower erosion coefficient, such as L, for optimizable patches. D A coefficient of 0.85 means that the area of ​​the erosion patch can be reduced to 85% of its original area. This stronger erosion can more effectively smooth irregular boundaries and remove narrow, protruding parts. The specific value of the erosion coefficient needs to be adjusted according to the actual application scenario. For example, in standard farmland construction projects, a lower erosion coefficient, such as 0.80, may be set to obtain a more regular plot shape; while in precision agriculture management, a higher erosion coefficient, such as 0.98, may be set to maintain the accuracy of plot boundaries. For example, for a retained patch with an area of ​​10,000 pixels, an erosion coefficient of 0.95 means that erosion should stop when the area drops to 9,500 pixels after erosion; for an optimizable patch with an area of ​​8,000 pixels, an erosion coefficient of 0.85 means that erosion should stop when the area drops to 6,800 pixels after erosion.

[0062] 206. Obtain the original area of ​​the retained and optimizable patches, perform iterative erosion on the retained and optimizable patches using a filter kernel of a preset size, and calculate the area ratio of the current area after erosion to the original area after each erosion.

[0063] The original area represents the initial total number of pixels in the preserved and optimizable patches before the erosion operation; the preset size filter kernel refers to the structuring element matrix used to perform the morphological erosion operation; iterative erosion represents the process of repeatedly performing the erosion operation until the stopping condition is met; the current area refers to the total number of pixels remaining in the patch after each erosion operation.

[0064] Specifically, the server first obtains the original area of ​​each patch to be processed. It then counts the number of all foreground pixels (non-zero pixels) by traversing the patch region and stores this number as the original area S. For example, if a retained patch contains 12,500 foreground pixels, its original area S = 12,500. The server selects a suitable preset-size filter kernel as the structuring element. Commonly used filter kernels include 3×3 square kernels, 5×5 circular kernels, or cross-shaped kernels. The choice of filter kernel affects the directionality and intensity of the erosion. For example, a 3×3 matrix of all ones [[1,1,1], [1,1,1], [1,1,1]] can be used as the basic structuring element. The server performs the first erosion operation on the patch. For each pixel in the patch, the center of the structuring element is aligned with that pixel. Only when all positions covered by the structuring element are foreground pixels is the pixel retained as foreground; otherwise, it becomes background. In this way, edge pixels are gradually removed. After the first erosion, the server recounts the number of pixels in the patch to obtain the current area S1, and calculates the area ratio R1 = S1 / S. For example, if 12,000 pixels remain after erosion, then R1 = 12,000 ÷ 12,500 = 0.96. The server then performs a second erosion operation, applying the structuring element again to the patch that has already been eroded to obtain a new current area S2, and calculates the area ratio R2 = S2 / S. The server repeats this iterative process, calculating the area ratio R after the i-th erosion. i =S i Each erosion step causes the patch to shrink further, and the area ratio gradually decreases. The server records the number of erosions and the corresponding area ratio in each iteration, forming a tracking record of the erosion process for easy subsequent analysis and debugging.

[0065] 207. Stop corrosion when the area ratio is less than the corrosion coefficient, and record the total number of corrosion cycles.

[0066] The total number of corrosion operations (N) represents the total number of corrosion operations performed from start to finish.

[0067] Specifically, the server will calculate the area ratio R. i With the preset corrosion coefficient L D Compare and determine whether the stopping condition R is met. i <L DWhen the area ratio first falls below the corrosion coefficient, the server stops the corrosion operation; the number of corrosion cycles at this point is the total number of corrosion cycles, N. For example, for a corrosion coefficient L... D The area ratio of the optimizable patch with a value of 0.85 drops to 0.815 after the 4th corrosion. Since 0.815 < 0.85, the stopping condition is met, so corrosion is stopped and the total number of corrosions N = 4 is recorded.

[0068] 208. Use a filter kernel of preset size to expand the eroded patch to obtain an optimized patch with regular edges. The number of expansions is equal to the total number of erosions.

[0069] The preset size of the filter kernel represents the structuring element matrix used to perform the morphological dilation operation, which is usually the same as the filter kernel used during erosion; the dilation count represents the number of iterations required to perform the dilation operation.

[0070] Specifically, the server uses the same preset-size filter kernel as the dilation stage as the structuring element. For example, if a 3×3 all-one matrix is ​​used during erosion, the same 3×3 all-one matrix is ​​used during dilation to maintain operational symmetry. The server reads the previously recorded total number of erosions, N, and uses it as the iteration number for the dilation operation, ensuring that the number of dilation and erosion operations is exactly equal. The server performs the first dilation operation on the eroded patch. For each pixel in the patch and its neighborhood, if there is any foreground pixel within the coverage area of ​​the structuring element, the center pixel is set as the foreground, thus expanding the boundary outward. The server continues to perform subsequent dilation operations, each dilation based on the previous one, gradually restoring the area of ​​the patch. For example, if the total number of erosions N=4, then 4 consecutive dilation operations are required. During the dilation process, the originally irregular boundary protrusions are not completely restored because they are removed by erosion, while the main body is basically restored to its original size, thus achieving the effect of edge regularization. For example, a patch with jagged boundaries, after 3 erosions, the jaggedness is eliminated, and after 3 dilations, the main body is restored but the jaggedness does not reappear, resulting in a smooth boundary. After the server completes all the expansion operations, it obtains the optimized patch, which has an area close to the original area but a more regular shape and smoother boundaries.

[0071] 209. Add the eroded pixel areas to the area to be filled to obtain the updated area to be filled.

[0072] The eroded pixel region represents the set of pixels that were removed from the original patch during the erosion process but were not fully recovered after dilation; the updated area to be filled represents the expanded area to be filled after adding the eroded pixels.

[0073] Specifically, the server first calculates the eroded pixel regions. By comparing the differences between the original and optimized patches, logical operations are used to identify pixels present in the original patches but absent in the optimized patches; these pixels constitute the eroded pixel regions. The server then obtains the current area to be filled, which consists of two parts: one part is the area within the cultivated land that has not been filled by cultivated land patches, and the other part is the area formed after the cultivated land patches that were classified as removable have been removed. The server performs a region merging operation, performing a logical OR operation between the eroded pixel regions and the original area to be filled to obtain the updated area to be filled.

[0074] 210. Obtain the outermost contour pixels of the updated region to be filled, and traverse the contour in a clockwise direction to obtain the traversal sequence.

[0075] The outermost contour pixels represent the boundary pixels of the updated area to be filled that are adjacent to the classified area (optimized patch) or the background area; the clockwise direction represents the traversal direction in which the area inside is always on the right when moving along the contour; the traversal sequence is used to represent a list of contour pixels arranged in a specific order.

[0076] Specifically, the server performs contour detection on the image to obtain the contour pixel coordinates of the regions to be filled. In practical applications, this can be achieved by calling contour lookup functions in computer vision libraries (such as the `cv2.findContours` function in the OpenCV library). This method can identify and obtain the contour information of all regions to be filled (including multiple disconnected regions) in the image at once, resulting in a set containing all independent contour sequences. Subsequently, the server uses the obtained set of contour sequences as the processing object, extracting each independent contour sequence as the current traversal sequence, and repeating the subsequent filling steps until the contours of all disconnected regions have been processed.

[0077] 211. In a traversal sequence, determine the direction from the current pixel to the next pixel as the target direction.

[0078] The next pixel represents the pixel that succeeds the current pixel in the current traversal sequence; the target direction is used to represent the unit direction vector from the current pixel to the next pixel.

[0079] Specifically, the server, for the extracted current traversal sequence, starts from the first pixel of the sequence and sets it as the current pixel. For example, if the current pixel coordinates are (x... i y i The server reads the coordinates (x, y) of the next pixel from the current traversal sequence. i+1 y i+1This pixel is the successor pixel when traversing the contour in a clockwise direction. The mapping system's server calculates the direction vector from the current pixel to the next pixel, i.e., (Δx, Δy) = (x...). i+1 -x i y i+1 -y i Since the contour pixels are 4-connected, adjacent pixels on the contour must be in direct contact in the horizontal or vertical direction, excluding diagonal connections. Therefore, the possible combinations of (Δx, Δy) are limited to four cases, and one of Δx and Δy must be 0, while the other must be 1 or -1 (i.e., the sum of their absolute values ​​must be 1). Next, the server determines a unique target direction based on the calculated difference vector and encodes it: if the control processing unit calculates the vector as (1, 0), it is determined to be east (e.g., encoded 0); if the vector is (0, 1), it is determined to be south (e.g., encoded 1); if the vector is (−1, 0), it is determined to be west (e.g., encoded 2); and if the vector is (0, −1), it is determined to be north (e.g., encoded 3). Finally, the server uses the identified target direction data to calculate the subsequent four-neighbor pixels.

[0080] 212. Determine the four neighboring pixels that are at a 90-degree counterclockwise angle to the target direction, and identify the patch category to which the four neighboring pixels belong.

[0081] A counterclockwise 90-degree angle represents the vertical direction obtained by turning 90 degrees to the left relative to the target direction; the four neighboring pixels refer to the four neighboring pixels that form a counterclockwise 90-degree angle with the target direction.

[0082] Specifically, the server calculates the direction after a 90-degree counter-clockwise rotation based on the target direction. This direction points outward from the contour, i.e., the outer direction of the area to be filled. This is achieved using a rotation matrix: if the target direction is (dx, dy), then the direction after a 90-degree counter-clockwise rotation is (-dy, dx). For example, if the target direction is east (1, 0), a 90-degree counter-clockwise rotation results in north (0, 1). The server moves one unit vertically from the current pixel position along the north direction to locate the four neighboring pixels. The server obtains the grayscale values ​​of the four neighboring pixels to determine their patch category. For example, if the grayscale values ​​of the four neighboring pixels fall within the range of optimized patch values ​​(e.g., 1-254), they belong to the optimized patch; if the grayscale values ​​are values ​​of the background area (e.g., 0), they belong to the background area.

[0083] 213. If the four neighboring pixels belong to the optimized patch, then fill the pixel value of the current pixel with the pixel value of the optimized patch.

[0084] Specifically, the server first determines whether the four neighboring pixels belong to the optimized patch. Here, 0 is defined as background value, 1-244 as farmland patches, and 255 as the area to be filled. If the grayscale value of the four neighboring pixels belongs to the optimized patch (i.e., pixel value 1-254), the server performs a fill operation, changing the current pixel's (x...) value to... i y i The value is assigned to the four neighboring pixels (x) at a 90-degree counterclockwise angle to the target direction. i y i The grayscale value at (+1) is used. If the four neighboring pixels do not belong to the optimized patch (still the area to be filled or the background value), the server does not perform an assignment operation, but treats the next pixel as the current pixel and iterates through the area. In this way, the pixels in the area to be filled are assigned the grayscale values ​​of the adjacent optimized patches.

[0085] 214. When all pixels in the area to be filled are filled, the iterative filling of the updated area to be filled ends, and the optimized grayscale result of the farmland plot is obtained.

[0086] Iterative filling is used to represent the loop process of repeatedly performing contour extraction and pixel filling until completion; the optimized grayscale result image of cultivated land plots refers to the final grayscale image of all cultivated land plots after morphological optimization and pixel filling.

[0087] Specifically, after each round of filling operations, the server recounts the number of pixels in the area to be filled and checks if there are any unclassified pixels. If the number of pixels to be filled is 0, the filling is considered complete. The server implements an iterative filling strategy. After the first round of contour filling is completed, if there are still pixels to be filled, the contour of the area to be filled is updated, and steps 210-213 are executed again for a new round of contour extraction and filling. This process continues until all pixels are assigned a category. For example, if the initial area to be filled contains 5000 pixels, the first round fills 3000, the second round fills 1500, the third round fills 400, and the fourth round fills 100, the area to be filled becomes empty, and the iteration ends. In some cases, the server may encounter isolated pixels or small areas that cannot be filled. If it determines that the area to be filled cannot be updated after one iteration (the number of filled pixels is 0), the iteration stops. This area to be filled belongs to an independent plot and there are no optimized farmland plots around it. The traversal ends, and the entire area is filled with random grayscale values ​​(1-244) to form a new farmland plot. Then the next contour traversal is performed. After confirming that all pixels have been filled, the server performs an integrity check, traversing the entire image to ensure that no pixels to be filled (pixels with values ​​of 0 or -1) are missed, and generates an optimized grayscale result image of the farmland plot.

[0088] 215. Perform raster vectorization on the optimized grayscale map of cultivated land plots to obtain vector features of the cultivated land plots. The vector features represent closed geometric polygons that describe the spatial boundaries of cultivated land plots, formed by sequentially connecting ordered coordinate nodes. (This step has been explained in section 106.) 216. Identify the inner and outer contours of the vector elements, and simplify the inner and outer contours based on the corresponding contour simplification parameters to obtain the final vector map of the cultivated land plots. (This step has been explained in section 107) Using the remote sensing imagery-based farmland parcel mapping method in this application embodiment, the server first determines the raster farmland extent based on the grayscale extraction result image of the farmland parcels or auxiliary data of the farmland area. The raster farmland extent is then used to mask and constrain the grayscale extraction result image of the farmland parcels, retaining pixel values ​​within the raster farmland extent to obtain farmland parcel patches, ensuring the accuracy of the extraction extent. Next, the server calculates the shape classification index of each farmland parcel patch, classifying the farmland parcel patches based on the shape classification index to obtain classification results of retained patches, optimizable patches, and removable patches. The areas of removable patches are determined as areas to be filled, achieving accurate identification of patches of different quality. Next, the server sets corresponding erosion coefficients for the retained and optimizable patches, obtains the original area, and performs iterative erosion using a filter kernel of a preset size. After each erosion, the area ratio of the current area to the original area is calculated. When the area ratio is less than the erosion coefficient, erosion stops and the total number of erosions is recorded. The eroded patches are then expanded an equal number of times using the same filter kernel to obtain optimized patches with regular edges. The eroded pixel areas are added to the area to be filled to obtain the updated area to be filled. By obtaining the outermost contour pixels and traversing them clockwise, a traversal sequence is obtained. The target direction from the current pixel to the next pixel is determined. The four neighboring pixels at a 90-degree counterclockwise angle to the target direction are identified and their patch categories are identified. If the four neighboring pixels belong to the optimized patch, the pixel value of the current pixel is filled with the pixel value of the optimized patch. When all pixels are filled, the grayscale result image of the optimized farmland plot is obtained, realizing the regularization of patch shape and intelligent filling of the area to be filled. Finally, the server performs raster vectorization on the optimized grayscale image of the cultivated land plots, resulting in closed geometric polygon vector elements that describe the spatial boundaries of the cultivated land plots, which are enclosed by sequentially connected coordinate nodes arranged in an orderly manner. The inner and outer contours of the vector elements are identified and simplified based on the corresponding contour simplification parameters to obtain the final vector image of the cultivated land plots, which improves the smoothness of the boundaries while ensuring topological correctness.

[0089] The methods provided in the above embodiments can be executed by the server of the mapping system. The server of the mapping system in the embodiments of this invention is described below from a hardware processing perspective. Please refer to [link to relevant documentation]. Figure 3This is a schematic diagram of the physical device structure of a server for a mapping system in this application embodiment.

[0090] It should be noted that, Figure 3 The server structure of the mapping system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0091] like Figure 3 As shown, the server of the mapping system includes a Central Processing Unit (CPU) 301, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 302 or programs loaded from storage section 308 into Random Access Memory (RAM) 303, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 303. The CPU 301, ROM 302, and RAM 303 are interconnected via bus 304. Input / output (I / O) interface 305 is also connected to bus 304.

[0092] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including a liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including a hard disk, etc.; and communication section 309 including a network interface card such as a LAN (Local Area Network) card, modem, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0093] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by central processing unit (CPU) 301, it performs the various functions defined in the present invention.

[0094] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0095] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0096] Specifically, the server of the mapping system in this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, it implements the remote sensing image farmland plot mapping method provided in the above embodiment.

[0097] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the server of the mapping system described in the above embodiments; or it may exist independently and not assembled into the server of the mapping system. The storage medium carries one or more computer programs that, when executed by a processor of the server of the mapping system, cause the server of the mapping system to implement the remote sensing image farmland plot mapping method provided in the above embodiments.

[0098] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0099] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0100] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0101] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for mapping cultivated land parcels using remote sensing imagery, characterized in that, The method, applied to a server in a mapping system, includes: Obtain the grayscale extraction result map of the farmland plots to be processed and the auxiliary data of the farmland range, and determine the raster farmland range based on the grayscale extraction result map of the farmland plots or the auxiliary data of the farmland range; The grayscale extraction result image of the cultivated land plot is masked using the grid cultivated land range to obtain cultivated land plot patches. The mask constraint means retaining the pixel values ​​of the grayscale extraction result image of the cultivated land plot located within the grid cultivated land range. Calculate the shape classification index of each of the aforementioned cultivated land plots; The cultivated land parcels are classified based on the shape classification index to obtain classification results. The areas in the classification results that can be removed are identified as areas to be filled. The classification results include retained parcels, optimized parcels, and removed parcels. Morphological normalization is performed on the retained patches and the optimizable patches to obtain optimized patches. Based on the optimized patches, a patch filling algorithm is used to fill the area to be filled with pixels to obtain an optimized grayscale result image of the cultivated land plot. The optimized grayscale result image of the cultivated land plot is subjected to raster vectorization processing to obtain the vector elements of the cultivated land plot. The vector elements represent closed geometric polygons that describe the spatial boundary of the cultivated land plot, which are enclosed by ordered coordinate nodes connected in sequence. Identify the inner and outer contours of the vector elements, and simplify the inner and outer contours based on the corresponding contour simplification parameters to obtain the final vector result map of the cultivated land plot.

2. The method according to claim 1, characterized in that, Based on the grayscale extraction result image of the cultivated land plots or the auxiliary data of the cultivated land range, the raster cultivated land range is determined, specifically including: When using the grayscale extraction result image of the cultivated land plot, the grayscale extraction result image of the cultivated land plot is binarized to obtain the initial raster cultivated land range; The initial grid farmland area is subjected to morphological processing and edge regularization processing to obtain a regular grid farmland area; When using the farmland range auxiliary data, the farmland range auxiliary data is subjected to vector rasterization and binarization to obtain the raster farmland range. The binarization process includes direct binarization or grayscale conversion followed by binarization.

3. The method according to claim 1, characterized in that, The grayscale extraction result image of the cultivated land plot is masked and constrained using the grid cultivated land range to obtain cultivated land plot patches, specifically including: Traverse the grid farmland area, identify the connected regions within the grid farmland area, and calculate the area of ​​each connected region; The connected regions whose area reaches a preset area threshold are used as target cultivated land area patches. Construct the bounding rectangular window of the target cultivated land area patch; The sampling area is determined in the grayscale extraction result image of the cultivated land plot using the circumscribed rectangular window, and pixel values ​​are read from the sampling area; Using the target cultivated land area patch as a mask, the pixel values ​​within the area covered by the target cultivated land area patch are extracted to obtain the cultivated land plot patch.

4. The method according to claim 1, characterized in that, The cultivated land parcels are classified based on the shape classification index to obtain classification results, specifically including: Based on the shape classification index, the cultivated land parcels are classified according to the parcel classification formula to obtain the classification results. The parcel classification formula is as follows: , In the classification formula for cultivated land parcels, O represents cultivated land parcels; C0 represents the classification result of cultivated land parcels, which includes retained parcels, parcels that can be optimized, and parcels that can be removed; O S The area of ​​the cultivated land plot is represented by the O. C R represents the perimeter of the cultivated land parcel; R represents the minimum bounding rectangle of the cultivated land parcel; R S Represents the area of ​​the smallest bounding rectangle; the R C R represents the perimeter of the smallest bounding rectangle; L Represents the length of the longer side of the smallest bounding rectangle; the R... W Represents the length of the shorter side of the smallest bounding rectangle; the R... L / R W The O represents the aspect ratio of the smallest bounding rectangle. C / O S O represents the ratio of the perimeter to the area of ​​the smallest bounding rectangle. S / R S T1 represents the rectangularization index of the smallest bounding rectangle; T2 represents the aspect ratio threshold; T3 represents the perimeter-area ratio threshold; and T3 represents the rectangularization index threshold.

5. The method according to claim 1, characterized in that, Morphological normalization is performed on the preserved and optimized patches to obtain optimized patches, specifically including: Corrosion coefficients are set for the retained patches and the optimizable patches respectively, and the corrosion coefficient is the ratio of the area after corrosion to the area before corrosion; Obtain the original areas of the retained and optimized patches, perform iterative erosion on the retained and optimized patches using a filter kernel of a preset size, and calculate the area ratio of the current eroded area to the original area after each erosion. When the area ratio is less than the corrosion coefficient, corrosion is stopped, and the total number of corrosion cycles is recorded. The eroded patch is expanded using the preset size filter kernel to obtain an optimized patch with regular edges. The number of expansions is equal to the total number of erosions. The eroded pixel areas are added to the area to be filled, resulting in an updated area to be filled.

6. The method according to claim 5, characterized in that, Based on the optimized patch, a patch filling algorithm is used to fill the area to be filled with pixels, resulting in an optimized grayscale image of the cultivated land plot, specifically including: Obtain the outermost contour pixels of the updated region to be filled, and traverse the contour in a clockwise direction to obtain the traversal sequence; In the traversal sequence, the direction from the current pixel to the next pixel is determined as the target direction; Identify the four neighboring pixels that form a 90-degree counterclockwise angle with the target direction, and identify the patch category to which the four neighboring pixels belong; If the four neighboring pixels belong to the optimized patch, then the pixel value of the current pixel is filled with the pixel value of the optimized patch; When all pixels in the area to be filled are filled, the iterative filling of the updated area to be filled ends, and the optimized grayscale result image of the farmland plot is obtained.

7. The method according to claim 1, characterized in that, The process of simplifying the inner and outer contours based on corresponding contour simplification parameters to obtain the final vector result map of cultivated land plots specifically includes: Traverse the vector features to obtain the deduplicated feature nodes. The feature node is a feature node that simultaneously belongs to at least two vector features and has at least three non-overlapping adjacent points. The boundary of the vector feature is decomposed into multiple independent line segments using the feature nodes; Based on the shared edge attribute of the multiple independent line segments, the line segments shared by adjacent vector elements are determined as the inner contour, and the non-shared line segments are determined as the outer contour. Inner contour simplification parameters are applied to the inner contour, and outer contour simplification parameters are applied to the outer contour. The multiple independent line segments are thinned and simplified using a line segment simplification algorithm. The inner contour simplification parameters and the outer contour simplification parameters are determined according to the land cover type to which the vector feature belongs. The thinned and simplified line segments are recombined into closed geometric polygons to obtain the final vector result map of cultivated land plots.

8. A server for a mapping system, characterized in that, The server of the mapping system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the server of the mapping system to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is executed on the server of the cartographic system, the server of the cartographic system performs the method as described in any one of claims 1-7.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are run on the server of the mapping system, the server of the mapping system performs the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • GIS algorithm optimization method applied to elimination of broken pattern spots

    CN112148829A

  • Offshore wind driven generator identification method based on multi-source remote sensing image

    CN120182853A

  • Island target vegetation identification method and device based on remote sensing, terminal and medium

    CN120953806A

  • Curvilinear polygon image scaling method, system and electronic apparatus

    US20250182239A1