Electronic boundary marker distribution method based on map terrain recognition

By using map terrain recognition methods, the Zhang-Suen algorithm and KNN algorithm are used to connect breakpoints. Combined with intersection point judgment and "trial and error" method to remove noise points, the problem of unreasonable electronic boundary markers in the demarcation of ecological red line protection areas is solved, achieving accurate distribution and resource conservation.

CN115908732BActive Publication Date: 2026-06-02ZHENGJIANG PUBLIC INFORMATION

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHENGJIANG PUBLIC INFORMATION
Filing Date
2022-11-23
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies for demarcating and marking ecological red line protection areas suffer from problems such as long time consumption, high cost, complex terrain, and unreasonable placement of electronic boundary markers, making it impossible to accurately obtain the boundaries of the area.

Method used

A map-based terrain recognition method is adopted. The Zhang-Suen algorithm is used to extract the map terrain skeleton, the KNN algorithm is used to connect the breakpoints, and the intersection point judgment algorithm is used to mark the distributable points of electronic boundary markers. Combined with the "trial and error method" to remove noise points, the accurate distribution of electronic boundary markers is achieved.

Benefits of technology

It enables precise determination of the setting range of electronic boundary markers, reasonable control of the number of boundary markers, avoidance of resource waste, and improvement of the efficiency and accuracy of boundary demarcation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115908732B_ABST
    Figure CN115908732B_ABST
Patent Text Reader

Abstract

The application discloses an electronic boundary post distribution method based on map terrain recognition, and steps include: S1, acquiring a map terrain skeleton image corresponding to a satellite map; S2, connecting breakpoints in the map terrain skeleton image; S3, removing noise points in the map terrain skeleton image after the breakpoint connection; S4, using a cross point judgment algorithm, marking out terrain inflection points and cross points in the map terrain skeleton image after the denoising as distributable points of the electronic boundary post. The application realizes accurate determination of the setting range of the electronic boundary post by connecting the breakpoints in the map terrain skeleton image and denoising, then uses the cross point judgment algorithm to mark out the terrain inflection points and cross points in the map terrain skeleton image after the breakpoint connection and denoising as the distributable points of the electronic boundary post, realizes reasonable control of the number of the electronic boundary post distribution while taking into account the observation effect of the electronic boundary post, and avoids the problem of wasting the electronic boundary post resources due to excessive setting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a method for distributing electronic boundary markers based on map terrain recognition. Background Technology

[0002] Currently, the demarcation and marking of ecological red line protection areas are mostly carried out manually. However, manual demarcation and marking is time-consuming, costly, and involves unknown dangers in complex terrain. In recent years, machine learning has been widely applied in image processing, map recognition, and other fields. Using machine learning technology to identify and analyze map terrain and find potential boundary marker locations can effectively reduce the workload of surveyors and lower the cost of demarcation and marking.

[0003] Patent CN201911316930.7 discloses an online monitoring method for subway protection zones. This method involves deploying several electronic boundary markers on the ground within the protection zone and using accelerometers within these markers to collect continuous acceleration data. The analysis of this data determines whether construction has occurred at the location of the electronic boundary marker within the current time period. However, if the number of electronic boundary markers is too small, the observation effect is not significant; setting too many markers wastes resources. This patent document does not disclose a technical solution for the rational deployment of electronic boundary markers.

[0004] Patent CN201811505557.5 discloses a method for overall planning of urban charging stations. It uses a fuzzy comprehensive decision-making method to optimize the ranking of pre-built charging stations in order to achieve full coverage of charging users within the urban area. It provides a solution for determining the optimal charging station layout by combining the optimization ranking results. However, this patent does not disclose a technical solution for accurately obtaining the urban area range. It is impossible to accurately obtain the boundary of the area range, which may lead to the planned charging stations being built outside the area range. Therefore, it cannot be applied to the scenario of demarcation and marking of ecological red line protection zones. Summary of the Invention

[0005] This invention aims to accurately obtain the regional boundaries of electronic boundary markers and to rationally set up electronic boundary markers, and provides a method for the distribution of electronic boundary markers based on map terrain recognition.

[0006] To achieve this objective, the present invention adopts the following technical solution:

[0007] A method for distributing electronic boundary markers based on map terrain recognition is provided, comprising the following steps:

[0008] S1, Obtain the map terrain skeleton image corresponding to the satellite map;

[0009] S2, Connect the breakpoints in the map terrain skeleton image;

[0010] S3, Remove noise points from the map terrain skeleton image after the breakpoints are connected;

[0011] S4. Using the intersection point judgment algorithm, terrain inflection points and intersection points are marked in the denoised map terrain skeleton image as distributable points of electronic boundary markers.

[0012] Preferably, the method for obtaining the map terrain skeleton using the Zhang-Suen algorithm includes the following steps:

[0013] S11, Obtain a new pixel p1 on the satellite map after image preprocessing, and determine whether p1 is a foreground point.

[0014] If so, proceed to step S12;

[0015] If not, proceed to step S14;

[0016] S12, determine whether the pixel p1 is an erodible pixel.

[0017] If so, proceed to step S13;

[0018] If not, proceed to step S14;

[0019] S13, set the pixel p1 as the background point.

[0020] S14, determine whether each pixel in the satellite image has been traversed.

[0021] If so, proceed to step S15;

[0022] If not, return to step S11 and continue to acquire new pixels;

[0023] S15, determine whether there are any new pixels eroded in this erosion iteration compared to the previous erosion iteration.

[0024] If so, proceed to the next iteration;

[0025] If not, the skeletal image obtained after this round of iteration is used as the map terrain skeleton corresponding to the final satellite map.

[0026] Preferably, step S12, the method for determining whether pixel p1 is an erodible pixel, includes the following steps:

[0027] S121, obtain the eight neighboring pixels of the pixel p1, and denot them as p2-p9 respectively, where p2 and p6 are the pixels above and below the pixel p1 in the eight neighboring areas, p8 and p4 are the pixels to the left and right of p1 in the eight neighboring areas, p9 and p7 are the pixels to the upper left and lower left of p1 respectively, and p3 and p5 are the pixels to the upper right and lower right of p1 respectively.

[0028] S122, Determine whether the number of iterations for eroding the pixel is odd.

[0029] If so, the first strategy is then executed to determine whether the pixel p1 is an erodible pixel.

[0030] If not, the second strategy will be executed to determine whether the pixel p1 is an erodible pixel.

[0031] The first strategy includes steps S123-S124-S125-S126 executed sequentially, specifically:

[0032] S123, determine whether n1≤N(p1)≤n2, where N(p1) represents the number of foreground pixels among the eight neighboring pixels of pixel p1.

[0033] If so, proceed to step S124;

[0034] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0035] S124, determine whether A(p1) = 1. A(p1) means that the 0-1 pixel values ​​of the eight neighboring pixels of pixel p1 have changed once according to p2-p3-p4-p5-p6-p7-p8-p9-p2. A pixel value of "0" indicates that the pixel is a background pixel, and a pixel value of "1" indicates that the pixel is a foreground pixel.

[0036] If so, proceed to step S125;

[0037] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0038] S125, determine if p2×p4×p6=0. p2×p4×p6=0 means that at least one of the pixels p2, p4, and p6 is a background pixel, with a pixel value of "0" and a pixel value of "1" for the foreground pixel.

[0039] If so, proceed to step S126;

[0040] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0041] S126, determine if p4×p6×p8=0. p4×p6×p8=0 means that at least one of the pixels p4, p6, and p8 is a background pixel.

[0042] If so, then pixel p1 is determined to be an erodible pixel.

[0043] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0044] The second strategy includes steps S123-S124-S127-S128 executed sequentially, specifically:

[0045] S123, determine whether n1≤N(p1)≤n2, where N(p1) represents the number of foreground pixels among the eight neighboring pixels of pixel p1.

[0046] If so, proceed to step S124;

[0047] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0048] S124, determine whether A(p1) = 1. A(p1) means that the 0-1 pixel values ​​of the eight neighboring pixels of pixel p1 have changed once according to p2-p3-p4-p5-p6-p7-p8-p9-p2. A pixel value of "0" indicates that the pixel is a background pixel, and a pixel value of "1" indicates that the pixel is a foreground pixel.

[0049] If so, proceed to step S127;

[0050] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0051] S127, determine if p2×p4×p8=0. p2×p4×p8=0 means that at least one of the pixels p2, p4, and p8 is a background pixel.

[0052] If so, proceed to step S128;

[0053] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0054] S128, determine if p2×p6×p8=0. p2×p6×p8=0 means that at least one of the pixels p2, p6, and p8 is a background pixel.

[0055] If so, then pixel p1 is determined to be an erodible pixel.

[0056] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0057] As preferred options, n1 = 1; n2 = 6.

[0058] Preferably, preprocessing the satellite image includes binarizing the satellite image.

[0059] Preferably, the method for connecting breakpoints in the map terrain skeleton image using the KNN algorithm includes the following steps:

[0060] S21, Obtain the training dataset for training the classification and labeling model;

[0061] S22, Use the training dataset and the KNN algorithm to train the classification and labeling model;

[0062] S23, using the trained classification and labeling model, predict the category of each pixel in the map terrain skeleton image of the breakpoint to be connected;

[0063] S24, the pixel value of each pixel in the map terrain skeleton image to be connected is set to the pixel value representing the predicted pixel category, thereby completing the connection of each breakpoint in the map terrain skeleton image.

[0064] The method for training the classification and labeling model specifically includes the following steps:

[0065] S221, the training dataset is divided into a test set and a training set, and then the ratio m of the test set and training set for cross-validation is selected;

[0066] S222, determine the value of k, the number of neighboring points in this model iteration training;

[0067] S223, find the k nearest neighbors to the test sample x;

[0068] S224, predict the category y to which x belongs;

[0069] S225, Verify the classification accuracy of the model obtained in this iteration, and determine whether the classification accuracy of the model in this iteration is greater than expected.

[0070] If so, proceed to step S226;

[0071] If not, return to step S222;

[0072] S226, in each model iteration training where the classification accuracy is greater than expected, the k value used in that iteration with the best classification accuracy is selected as the k value of the KNN algorithm for training the classification labeling model, so as to train the classification labeling model.

[0073] Preferably, in step S223, the Euclidean distance metric is used to find the k points that are closest to x, and the Euclidean distance L between the two points is... p (x i ,x j It is calculated using the following formula (1):

[0074]

[0075] In formula (1), They represent samples x respectively i x j The l-th pixel;

[0076] n represents the number of features in the sample;

[0077] In step S224, the method for predicting the category y of the test sample x is expressed by the following formula (2):

[0078]

[0079] Where I represents the indicator function, y i = j When I = 1, I = 0 otherwise;

[0080] Find the k nearest neighbors of x in the training set. The neighborhood of x that includes these k neighbors is denoted as N. k (x);

[0081] y i This represents the predicted category for the i-th sample x;

[0082] c j This represents the j-th real category;

[0083] N represents N k The number of samples in (x).

[0084] Preferably, in step S3, noise points in the map terrain skeleton image after connecting the breakpoints are removed by a "trial and error method". The method for removing noise points by the "trial and error method" specifically includes the following steps:

[0085] S31, Set the burr removal length threshold;

[0086] S32, Calculate the length of each connected region in the map terrain skeleton image;

[0087] S33, Connected regions in the map terrain skeleton image whose length is less than the length threshold are treated as noise points and removed;

[0088] S34 compares the noise reduction effect of the current iteration with that of the previous iteration.

[0089] If the noise reduction effect is greater than the set effect threshold, return to step S31, reset the length threshold, and continue noise reduction;

[0090] If the denoising effect is less than or equal to the effect threshold, then denoising is terminated.

[0091] Preferably, step S4, using the intersection point determination algorithm to mark the proposed distribution points of the electronic boundary markers, includes the following steps:

[0092] S41, traverse each pixel in the map terrain skeleton image after breakpoint connection and denoising to determine whether each pixel is a skeleton color.

[0093] If so, proceed to step S42;

[0094] If not, then the pixel is determined to be a non-target pixel;

[0095] S42, determine whether each pixel of the skeleton color has more than two foreground points in its eight-neighbor area and whether the foreground points are not adjacent to each other.

[0096] If so, then the pixel is determined to be the target point;

[0097] If not, then the pixel is determined to be a non-target pixel;

[0098] S43, mark the target point as the distributable point of the electronic boundary marker.

[0099] This invention achieves precise determination of the setting range of electronic boundary markers by connecting breakpoints in the map terrain skeleton image and removing noise. Then, using an intersection point judgment algorithm, terrain inflection points and intersection points are marked in the map terrain skeleton image after breakpoint connection and noise removal as possible distribution points for electronic boundary markers. This achieves reasonable control of the number of electronic boundary markers while taking into account the observation effect of electronic boundary markers, avoiding the problem of wasting electronic boundary marker resources due to setting too many. Attached Figure Description

[0100] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0101] Figure 1 This is a flowchart illustrating the implementation of an electronic boundary marker distribution method based on map terrain recognition, according to an embodiment of the present invention.

[0102] Figure 2This is a flowchart of obtaining map terrain skeletons using the Zhang-Suen algorithm;

[0103] Figure 3 This is a flowchart for determining whether pixel p1 is an erodible point;

[0104] Figure 4 This is a schematic diagram of the eight neighborhoods of pixel p1;

[0105] Figure 5 This is a flowchart of connecting breakpoints in the map terrain skeleton using the KNN algorithm;

[0106] Figure 6 This is a flowchart of training a classification and labeling model using the KNN algorithm;

[0107] Figure 7 This is a comparison image showing the effect before and after reconnecting the breakpoints;

[0108] Figure 8 This is a comparison image showing the effect of denoising a map's terrain skeleton before and after denoising.

[0109] Figure 9 This is an example image comparing the effects of marking inflection points and intersections on a map's terrain skeleton before and after. Detailed Implementation

[0110] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0111] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual images. They should not be construed as limiting the scope of this patent. To better illustrate the embodiments of the present invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual dimensions of the product. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0112] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "inner," and "outer" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present patent. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0113] In the description of this invention, unless otherwise explicitly specified and limited, the term "connection" or similar designation indicating a connection between components should be interpreted broadly. For example, it can refer to a fixed connection, a detachable connection, or an integral part; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can refer to the internal communication between two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0114] The electronic boundary marker distribution method based on map terrain recognition provided in this embodiment of the invention, such as... Figure 1 As shown, the steps include:

[0115] S1, After image preprocessing of the satellite map, the Zhang-Suen algorithm is used to obtain the map terrain skeleton image corresponding to the satellite map;

[0116] The method for image preprocessing of satellite maps is as follows:

[0117] First, the satellite map is divided into multiple map tiles;

[0118] Then, each map tile is binarized. See the example of the binarized map tile for details. Figure 7 , Figure 7 The black area represents the background of the original map tile image after binarization, while the white area represents the foreground of the original image after binarization.

[0119] Map terrain skeleton extraction is essentially the process of extracting the central pixel contour of a target in an image. It involves refining the target based on its center. This invention uses the Zhang-Suen algorithm to extract the map terrain skeleton corresponding to satellite maps. The specific extraction method is as follows: Figure 2 As shown, the algorithm includes steps S11-S15. Each iteration of the algorithm involves eroding the target pixel that meets specific conditions, making the target increasingly thinner. Through continuous iteration, the algorithm terminates when no new pixels are eroded from the target after the previous erosion, resulting in a single-pixel skeletal image.

[0120] In step S11, a new pixel p1 is first obtained on the preprocessed satellite map, and it is determined whether the pixel p1 is a foreground point. If p1 is a foreground point, proceed to step S12; otherwise, proceed to step S14. It should be noted that existing methods for determining whether a pixel is a foreground point can be used. The specific determination process is not described in detail.

[0121] In step S12, it is determined whether p1 is an erodible pixel.

[0122] If so, proceed to step S13;

[0123] If not, proceed to step S14;

[0124] The method for determining whether pixel p1 is an erodible pixel is as follows: Figure 3 As shown, it includes steps S121-129.

[0125] In step S121, the eight neighboring pixels of pixel p1 are taken and labeled as p2-p9 respectively. Please refer to the example diagram of the eight neighbors of p1. Figure 4 ;

[0126] In step S122, it is determined whether the number of iterations in this iteration is odd.

[0127] If so, the first strategy is then executed to determine whether pixel p1 is an erodible pixel;

[0128] If not, the second strategy will be executed to determine whether pixel p1 is an erodible pixel.

[0129] The first strategy includes steps S123-S124-S125-S126 executed sequentially, specifically:

[0130] In step S123, it is determined whether 2≤N(p1)≤6, where N(p1) represents the number of foreground pixels among the eight neighboring pixels of pixel p1.

[0131] If so, proceed to step S124;

[0132] If not, then pixel p1 is determined to be an uncorruptible pixel;

[0133] In step S124, it is determined whether A(p1) = 1, that is, whether... Figure 4 Did the 0-1 pixel values ​​of the eight neighboring pixels of p1 change once in the order p2-p3-p4-p5-p6-p7-p8-p9-p2?

[0134] If so, proceed to step S125;

[0135] If not, then pixel p1 is determined to be an uncorruptible pixel;

[0136] In step S125, it is determined whether p2×p4×p6=0. p2×p4×p6=0 means that at least one of the pixels p2, p4, and p6 is a background pixel, the pixel value of the background pixel is "0", and the pixel value of the foreground pixel is "1".

[0137] If so, proceed to step S126;

[0138] If not, then pixel p1 is determined to be an uncorruptible pixel;

[0139] In step S126, it is determined whether p4×p6×p8=0. p4×p6×p8=0 means that at least one of the pixels p4, p6, and p8 is a background pixel.

[0140] If so, then pixel p1 is determined to be an erodible pixel;

[0141] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0142] The second strategy includes steps S123-S124-S127-S128 executed sequentially, specifically:

[0143] S123, determine whether n1≤N(p1)≤n2, where N(p1) represents the number of foreground pixels among the eight neighboring pixels of pixel p1.

[0144] If so, proceed to step S124;

[0145] If not, then pixel p1 is determined to be an uncorruptible pixel;

[0146] S124, determine if A(p1) = 1. A(p1) represents the pixel values ​​(0-1) of the eight neighboring pixels of pixel p1, which have changed once according to p2-p3-p4-p5-p6-p7-p8-p9-p2. A pixel value of "0" indicates that the pixel is a background pixel, and a value of "1" indicates that the pixel is a foreground pixel.

[0147] If so, proceed to step S127;

[0148] If not, then pixel p1 is determined to be an uncorruptible pixel;

[0149] S127, determine if p2×p4×p8=0. p2×p4×p8=0 means that at least one of the pixels p2, p4, and p8 is a background pixel.

[0150] If so, proceed to step S128;

[0151] If not, then pixel p1 is determined to be an uncorruptible pixel;

[0152] S128, determine if p2×p6×p8=0. p2×p6×p8=0 means that at least one of the pixels p2, p6, and p8 is a background pixel.

[0153] If so, then pixel p1 is determined to be an erodible pixel;

[0154] If not, then pixel p1 is determined to be an uncorruptible pixel.

[0155] Please continue to refer to Figure 1 After determining that pixel p1 is an erodible pixel, proceed to the following step:

[0156] S13, set pixel p1 as the background point, that is, assign the pixel value of p1 to "0";

[0157] In step S14, it is determined whether each pixel in the satellite image has been traversed.

[0158] If so, proceed to step S15;

[0159] If not, return to step S11 and continue to acquire new pixels;

[0160] S15, determine whether there are any new pixels eroded in this erosion iteration compared to the previous erosion iteration.

[0161] If so, proceed to the next iteration;

[0162] If not, the skeletal image obtained after this round of iteration is used as the map terrain skeletal image corresponding to the final satellite map.

[0163] When using the Zhang-Suen algorithm to perform skeletalization on satellite maps, breakpoints or noise points may appear. These breakpoints and noise points can affect the definition of the electronic boundary marker setting range. Therefore, it is necessary to process the data of these breakpoints and noise points to avoid affecting the determination of the electronic boundary marker distribution range.

[0164] This invention uses the KNN algorithm to connect breakpoints in a map terrain skeleton image and uses a trial-and-error method to remove noise points from the map terrain skeleton image after the breakpoints are connected.

[0165] K-Nearest Neighbors (KNN) is a classic and simple supervised learning algorithm. It's a relatively simple classifier that doesn't involve an explicit learning or training process, making it a form of lazy learning. KNN is a good choice when there is little or no prior knowledge about the data distribution. It can be used to solve both classification and regression problems.

[0166] This embodiment uses the KNN algorithm to connect breakpoints in the map terrain skeleton image, directly connecting nearest neighbors using distance (Euclidean distance). The operational principle of the KNN algorithm is as follows:

[0167] However, when classifying test samples, the training dataset is first scanned to find the k most similar training samples. The category of the test sample is then determined by voting based on the categories of the training samples. Alternatively, weighted voting can be performed by calculating the similarity between the training and test samples. If the output needs to be in the form of the probability of each class for the test sample, it can be estimated using the distribution of the number of samples of different categories among the k training samples.

[0168] like Figure 5 As shown, the method for connecting breakpoints using the KNN algorithm in this embodiment specifically includes the following steps S21-S24:

[0169] In step S21, the training dataset for training the classification and labeling model is first obtained. The training dataset is represented as T = {(x1,y1),(x2,y2),…,(x...} i ,y i ),…,(x N ,y N )},in, Let X represent the feature vector of the i-th map terrain skeleton image used as a training sample, and let the feature space X be an n-dimensional real vector space R. n , This indicates that the number of training samples is N. i ∈y={c1,c2,…,c K} represents x i The category of the map terrain skeleton image referred to, c K Let i represent the Kth category, where i = 1, 2, ..., N;

[0170] In step S22, the obtained training dataset is used to train a classification and labeling model using the KNN algorithm. The model training method specifically includes the following steps S221-S226:

[0171] In step S221, the training dataset is first divided into a test set and a training set. In this embodiment, the k value is selected by performing cross-validation on the dataset. The dataset is first divided into a training set and a test set, and then the training set is divided into sub-training sets and sub-test sets. For example, the percentage of the number of test sets in the sample dataset (m) can be 5%, 10%, 15%, 20%, 25%, 30%, 35%, 40%, etc.

[0172] In step S222, the number of neighboring points k for this model iteration training is determined. In this embodiment, a small k value is selected initially, and the value of k is continuously increased in each iteration. Finally, based on the verification results of each iteration, the most suitable value is selected. For example, when the k value is increased, the model's classification error rate usually decreases first because there are more surrounding samples to learn from, and the classification effect improves. However, when the k value is even larger, the error rate may also become higher. For example, when the sample size is 35, if the k value is increased to 30, the classification performance of the KNN algorithm becomes very poor.

[0173] In step S223, the k nearest neighbors to the test sample x are found; in this embodiment, the Euclidean distance metric is used to calculate the k nearest (most similar) points to x. For example, suppose two points... They represent samples x respectively i x j The nth pixel in the array. Then, according to the Euclidean distance metric, x... i x j European distance They represent x respectively i x j The l-th pixel, when p=2,

[0174] In step S224, the category y to which pixel x belongs is predicted according to the classification decision rule (preferably the majority voting rule). In this embodiment, the neighborhood covering these k points is denoted as N. k (x), in N k In (x), predict the class y of x according to the majority voting rule:

[0175]

[0176] Where I represents the indicator function, y i =c j When I = 1, I = 0 otherwise;

[0177] Find the k nearest neighbors of x in the training set. The neighborhood of x that includes these k neighbors is denoted as N. k (x);

[0178] y i This represents the predicted category for the i-th sample x;

[0179] c j This represents the j-th real category;

[0180] N represents N k The number of samples in (x);

[0181] In step S225, the classification accuracy of the model obtained in this iteration is verified.

[0182] If so, proceed to step S226;

[0183] If not, return to step S222;

[0184] There are many existing methods for verifying the classification accuracy of a model, which will not be discussed here.

[0185] In step S226, a suitable k value from multiple iterations is selected as the final k value used for model training. In this embodiment, the average classification accuracy of the model obtained from each iteration is preferably taken as the comparison standard. The classification accuracy of each iteration is compared with this comparison standard, and the k value used in the iteration with the highest classification accuracy is selected as the k value used to train the classification labeling model. For a test sample x, it is input into the classification labeling model trained using the finally selected k value. The model uses the class of the nearest neighbor of x in the training set as the predicted class for x.

[0186] Please continue to refer to Figure 5 In step S23, the trained classification and labeling model is used to predict the category of each pixel in the map terrain skeleton image of the breakpoint to be connected, and the corresponding predicted category (foreground point or background point) is obtained.

[0187] In step S24, based on the classification result of step S23, the category of each pixel in the map terrain skeleton image of the breakpoint to be connected is set to the predicted category, finally obtaining the map terrain image after connecting the breakpoints. For example, if the pixel value of a breakpoint in the original map terrain skeleton image is "0" representing a background point, while the classification result predicted for that point in step S23 is "1" representing a foreground point, then the pixel value of that breakpoint is set from "0" to "1", completing the connection of that breakpoint. Please refer to the comparison image before and after the breakpoint connection. Figure 7 , Figure 7 The left image in the image is a partial example of the map terrain skeleton image before the breakpoints were connected. Figure 7 The right image in the diagram is a schematic diagram of the local image after the breakpoints are connected.

[0188] After resolving the breakpoint issue, we found numerous spikes (noise points) in the map terrain skeleton image after breakpoint reconnection. These spikes are typically pixels of objects such as houses and buildings on the map. To remove the influence of these spikes on the delineation of the electronic boundary marker distribution range, after completing the breakpoint reconnection, as follows... Figure 1 As shown, the electronic boundary marker distribution method based on map terrain recognition provided in this embodiment proceeds to the following steps:

[0189] S3 removes noise points from the map terrain skeleton image after connecting breakpoints using a trial-and-error method. The specific removal method is as follows:

[0190] Based on the characteristic that the length of the burr is much smaller than the length of the bone branch, for example, as... Figure 8 The spurs shown in the diagram are separated from the skeleton in the connected region 200 and deleted, while maintaining the connectivity of the original image after deleting the spurs. For example, ... Figure 8 After removing the connected region 100 containing the burrs in the left image, we get... Figure 8 In the middle right figure, the connectivity of the bones in the connected region remains unchanged after the burrs are removed.

[0191] The "trial and error method" is actually a threshold selection method based on node length. For example, the length threshold is gradually increased in steps of 50. Connectivity regions below the length threshold are identified as burr regions and removed. After each burr removal, it is determined whether the burr removal effect has deteriorated or whether there is no significant change. If so, the burr removal is stopped, and the step size is selected as the length threshold for burr removal.

[0192] Please continue to refer to Figure 1 After denoising the map terrain skeleton image, the electronic boundary marker distribution method based on map terrain recognition provided in this embodiment proceeds to the following steps:

[0193] S4. Using the intersection point determination method, terrain inflection points and intersection points are marked as distributable points of electronic boundary markers in the denoised map terrain skeleton image. The specific marking method includes the following steps:

[0194] S41, iterate through each pixel in the map terrain skeleton image after breakpoint connection and denoising to determine whether each pixel is a skeleton color.

[0195] If so, proceed to step S42;

[0196] If not, then the pixel is determined to be a non-target point;

[0197] S42 determines whether each pixel of the skeletal color has more than two foreground pixels in its eight-neighbor area and whether the foreground pixels are not adjacent to each other.

[0198] If so, then the pixel is determined to be the target point;

[0199] If not, then the pixel is determined to be a non-target pixel;

[0200] S43, mark the target point as a distributable point of the electronic boundary marker (e.g., Figure 9 (As indicated by the reference numeral "200" in the attached figure). Figure 9 The right image in the middle is a pair Figure 9The left-hand diagram in the figure shows the possible distribution points of electronic boundary markers. In summary, this invention achieves precise determination of the electronic boundary marker setting range by connecting breakpoints in the map topographic skeleton image and denoising it. Then, using an intersection point judgment algorithm, terrain inflection points and intersection points are marked as possible distribution points for electronic boundary markers in the map topographic skeleton image after breakpoint connection and denoising. This achieves reasonable control over the number of electronic boundary markers while considering the observation effect, avoiding the problem of wasting electronic boundary marker resources due to excessive setting.

[0201] It should be stated that the above-described specific embodiments are merely preferred embodiments of the present invention and the technical principles employed. Those skilled in the art should understand that various modifications, equivalent substitutions, and variations can be made to the present invention. However, such variations, as long as they do not depart from the spirit of the present invention, should be within the scope of protection of the present invention. Furthermore, some terminology used in this specification and claims is not limiting, but merely for ease of description.

Claims

1. An electronic stake distribution method based on map terrain recognition, characterized by the steps of include: S1, Obtain the map terrain skeleton image corresponding to the satellite map; S2, Connect the breakpoints in the map terrain skeleton image; S3, Remove noise points from the map terrain skeleton image after the breakpoints are connected; S4. Using the intersection point judgment algorithm, the terrain inflection points and intersection points are marked in the denoised map terrain skeleton image as the distributable points of electronic boundary markers. Step S4, the method of marking the proposed distribution points of electronic boundary markers using the intersection point judgment algorithm includes the following steps: S41, traverse each pixel in the map terrain skeleton image after breakpoint connection and denoising to determine whether each pixel is a skeleton color. If so, proceed to step S42; If not, then the pixel is determined to be a non-target pixel; S42, determine whether each pixel of the skeleton color has more than two foreground points in its eight-neighbor area and whether the foreground points are not adjacent to each other. If so, then the pixel is determined to be the target point; If not, then the pixel is determined to be a non-target pixel; S43, mark the target point as the distributable point of the electronic boundary marker.

2. The electronic stake distribution method based on map terrain recognition according to claim 1, characterized in that, The steps for obtaining the map terrain skeleton using the Zhang-Suen algorithm include: S11: Obtain a new pixel p1 on the satellite image after image preprocessing, and determine whether p1 is a foreground point. If so, proceed to step S12; If not, proceed to step S14; S12, determine whether the pixel p1 is an erodible pixel. If so, proceed to step S13; If not, proceed to step S14; S13, set the pixel p1 as the background point. S14, determine whether each pixel in the satellite image has been traversed. If so, proceed to step S15; If not, return to step S11 and continue to acquire new pixels; S15, determine whether there are any new pixels eroded in this erosion iteration compared to the previous erosion iteration. If so, proceed to the next iteration; If not, the skeletal image obtained after this round of iteration is used as the map terrain skeleton corresponding to the final satellite map.

3. The electronic staking method based on map terrain recognition according to claim 2, characterized in that, In step S12, the method for determining whether pixel p1 is an erodible pixel includes the following steps: S121, obtain the eight neighboring pixels of the pixel p1, and denot them as p2-p9 respectively, where p2 and p6 are the pixels above and below the pixel p1 in the eight neighboring areas, p8 and p4 are the pixels to the left and right of p1 in the eight neighboring areas, p9 and p7 are the pixels to the upper left and lower left of p1 respectively, and p3 and p5 are the pixels to the upper right and lower right of p1 respectively. S122, Determine whether the number of iterations for eroding the pixel is odd. If so, the first strategy is then executed to determine whether the pixel p1 is an erodible pixel. If not, the second strategy will be executed to determine whether the pixel p1 is an erodible pixel. The first strategy includes steps S123-S124-S125-S126 executed sequentially, specifically: S123, determining whether , denotes the number of foreground pixel points in the eight-neighborhood pixel points adjacent to the pixel point p1, If so, proceed to step S124; If not, then pixel p1 is determined to be an uncorruptible pixel. S124, determining whether , The 0-1 pixel values of the eight neighboring pixels of the pixel point p1 change once according to p2-p3-p4-p5-p6-p7-p8-p9-p2, and the pixel value "0" of the pixel point indicates that the pixel point is a background point of the image, and "1" indicates a foreground point of the image. If so, proceed to step S125; If not, then pixel p1 is determined to be an uncorruptible pixel. S125, determine if p2×p4×p6=0. p2×p4×p6=0 means that at least one of the pixels p2, p4, and p6 is a background pixel, with a pixel value of "0" and a pixel value of "1" for the foreground pixel. If so, proceed to step S126; If not, then pixel p1 is determined to be an uncorruptible pixel. S126, determine if p4×p6×p8=0. p4×p6×p8=0 means that at least one of the pixels p4, p6, and p8 is a background pixel. If so, then pixel p1 is determined to be an erodible pixel. If not, then pixel p1 is determined to be an uncorruptible pixel. The second strategy includes steps S123-S124-S127-S128 executed sequentially, specifically: S123, determining whether , denotes the number of foreground pixel points in the eight-neighborhood pixel points adjacent to the pixel point p1, If so, proceed to step S124; If not, then pixel p1 is determined to be an uncorruptible pixel. S124, determining whether , The 0-1 pixel values of the eight neighboring pixels of the pixel point p1 change once according to p2-p3-p4-p5-p6-p7-p8-p9-p2, and the pixel value "0" indicates that the pixel point is a background point of the image, and "1" indicates that it is a foreground point of the image. If so, proceed to step S127; If not, then pixel p1 is determined to be an uncorruptible pixel. S127, determine if p2×p4×p8=0. p2×p4×p8=0 means that at least one of the pixels p2, p4, and p8 is a background pixel. If so, proceed to step S128; If not, then pixel p1 is determined to be an uncorruptible pixel. S128, determine if p2×p6×p8=0. p2×p6×p8=0 means that at least one of the pixels p2, p6, and p8 is a background pixel. If so, then pixel p1 is determined to be an erodible pixel. If not, then pixel p1 is determined to be an uncorruptible pixel.

4. The electronic staking method based on map terrain recognition according to claim 3, characterized in that, ; 。 5. The electronic staking method based on map terrain recognition according to claim 2, characterized in that, Preprocessing the satellite image includes binarizing the satellite image.

6. The electronic staking method based on map terrain recognition according to claim 1, characterized in that, The method for connecting breakpoints in the map terrain skeleton image using the KNN algorithm includes the following steps: S21, Obtain the training dataset for training the classification and labeling model; S22, Use the training dataset and the KNN algorithm to train the classification and labeling model; S23, using the trained classification and labeling model, predict the category of each pixel in the map terrain skeleton image of the breakpoint to be connected; S24, the pixel value of each pixel in the map terrain skeleton image to be connected is set to the pixel value representing the predicted pixel category, thereby completing the connection of each breakpoint in the map terrain skeleton image. The method for training the classification and labeling model specifically includes the following steps: S221, dividing the training dataset into a test set and a training set, and then selecting a ratio of the test set and the training set for cross-validation of the values; S222, determine the value of k, the number of neighboring points in this model iteration training; S223, find the k nearest neighbors to the test sample x; S224, predict the category y to which x belongs; S225, Verify the classification accuracy of the model obtained in this iteration, and determine whether the classification accuracy of the model in this iteration is greater than expected. If so, proceed to step S226; If not, return to step S222; S226, selecting the k value used in the iteration with the optimal classification accuracy as the k value used in the KNN algorithm for training the classification labeling model, to train the classification labeling model.

7. The electronic staking method based on map terrain recognition according to claim 6, characterized in that, In step S223, the Euclidean distance measurement method is used to find the first k points closest to x, and the Euclidean distance between two points This is calculated by the following equation (1): In formula (1), Representing samples respectively , The 1 pixel; represents the number of features in the sample; In step S224, the method for predicting the category y of the test sample x is expressed by the following formula (2): wherein denotes an indicator function, when, otherwise ; Find the k nearest points to x in the training set. The neighborhood of x that covers these k points is denoted as ; represents the predicted class for the th sample x; represents the first real class; represents the number of samples in.

8. The electronic staking method based on map terrain recognition according to claim 1, characterized in that, In step S3, the "trial and error method" is used to remove the noise points in the map terrain skeleton image after breakpoint connection. The "trial and error method" for removing noise points specifically includes the following steps: S31, setting a burr removal length threshold; S32, calculating the length of each connected region in the map terrain skeleton image; S33, regarding the connected regions in the map terrain skeleton image with a length less than the length threshold as noise points and removing them; S34, comparing the current denoising effect with the last denoising effect, If the denoising effect is greater than the set effect threshold, return to step S31, and continue denoising after resetting the length threshold; If the denoising effect is less than or equal to the effect threshold, terminate the denoising.