An automatic extraction method for terrain ridge lines based on a weighted topological network graph

Through the method based on weighted topological network diagram, the problems of low terrain ridge line extraction efficiency and insufficient noise resistance in the prior art are solved, and high-precision and smooth ridge line extraction effect are achieved.

CN119417999BActive Publication Date: 2025-06-20WUHAN GUO YAO XIN TIAN DI INFORMATION TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411451402.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-06-20
Estimated Expiration
2044-10-17

AI Technical Summary

Technical Problem

The prior art has problems with large calculation amounts, insufficient noise resistance, low feature point extraction accuracy, and breakage and noise in the ridge line when extracting terrain ridge lines.

Method used

The method based on the weighted topological network graph is adopted to extract the ridgeline by combining terrain rasterization, downsampling, neighborhood mean smoothing, refinement processing, construction of weighted topological network graphs, breaking closed graphs, filtering short branches and redundant branches, weighted average and point aggregation.

Benefits of technology

The efficiency and accuracy of ridgeline extraction is improved, noise resistance is enhanced, and the fracture and redundant branches of ridgelines are reduced, ensuring that the extracted ridgeline is well matched with the actual terrain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417999B_ABST
    Figure CN119417999B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for automatically extracting terrain ridge lines based on a weighted topological network graph, belonging to the field of digital terrain analysis, and comprising the following steps: S1 rasterize the terrain of the target area to obtain DEM data; S2 set a sampling step size to downsample the DEM to obtain a sampled point image; S3 use the neighborhood search method to extract target points from the sampled point image, and use neighborhood mean smoothing for correction processing to obtain weighted mountaintop points; S4 thin the mountaintop point image and retain the mountaintop points on the ridge line skeleton; S5 construct a weighted topological network graph for the mountaintop point graph, and use the Kruskal algorithm to break the closed graph to form a maximum spanning tree. For the method for automatically extracting terrain ridge lines based on a weighted topological network graph, after steps such as neighborhood mean smoothing and removal of redundancy in ridge line extraction, the influence of noise is largely removed, the problem that traditional ridge line extraction methods are sensitive to noise is overcome, and at the same time, the extraction accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention patent relates to the technical field of digital terrain analysis, and specifically to an automatic extraction method of terrain ridge lines based on a weighted topological network graph. Background Technique

[0002] Digital Elevation Model (DEM) is a way of discrete mathematical representation of the Earth's surface, and it is also one of the core data for three-dimensional spatial data processing and digital terrain analysis in remote sensing and geographic information systems. Ridge lines and valley lines can be extracted from the digital elevation model to represent important demarcation lines of mountainous terrain changes, and they have important applications in terrain representation, digital terrain analysis, surveying and mapping, and engineering design. Therefore, automatically, accurately, and efficiently extracting ridges and valley lines from DEM has always been an important topic in the field of digital terrain analysis, and it has played an important guiding role in aspects such as scientific utilization of terrain for infrastructure construction, regional planning, and disaster prevention and control.

[0003] Existing ridge line extraction methods mainly include:

[0004] ① Methods based on terrain water flow simulation. The basic idea of this method is that water always follows the natural law of flowing from high to low. Calculate the water accumulation volume of each grid point in the DEM data in sequence. If the water accumulation volume of the grid point in the grid is greater than a given threshold, it is considered a water accumulation point. Connect these water accumulation points in sequence according to a certain rule to obtain the water accumulation line, and find each water accumulation line in the area from high to low; according to the obtained water accumulation line, calculate and find the boundary line of each water accumulation area to obtain the water dividing line. The water dividing line is considered the ridge line, and the water accumulation line is the valley line. This method has strong anti-noise ability, but there are problems such as the calculation amount increasing in a quadratic relationship with the increase in the number of grids, resulting in poor extraction efficiency, and poor extraction effect for mountains with small undulations.

[0005] ② Methods based on DEM terrain feature extraction. This method refers to a cross-section extreme value method. Its basic idea is to find the maximum and minimum points on the cross-section curve of the terrain. Potential terrain feature points are related to the local extreme points on their terrain cross-sections. It is considered that the maximum point is the water dividing point of the terrain, and the minimum point is the water accumulation point of the terrain. Finally, connect the formed feature lines based on the extracted feature points. This type of method is sensitive to noise, there are many breaks and branches in the results, the ridge lines are discontinuous, and there are large deviations from the actual terrain.

[0006] ③ Methods based on image processing. The idea of this method is: assuming that the higher the elevation value of the grid point, the brighter the gray value, then the position of the mountain top in the image is brighter than other positions, and the ridge line extends along an area with a gray value higher than both sides. This method is intuitive and efficient, but there are problems such as unsatisfactory noise removal and uncontrollable removal of breaks and branches.

[0007] Method, apparatus, storage medium, and electronic device for extracting ridge lines of a disclosed patent (CN 117911434A). A method for extracting ridge lines is proposed, including: obtaining a ridge line image and performing region of interest detection on the ridge line image; performing ridge line detection on the detected region of interest and constructing a sampling point set according to the ridge line detection result; screening out target sampling points on the ridge line from the sampling point set and obtaining a ridge line path according to the target sampling points. This method can be executed in parallel for multiple regions of interest, taking less time and avoiding calculations for non-target regions, thereby reducing the execution time. However, the improvement in the extraction accuracy of feature points is not significant, and the problems of breaks and noise in the ridge line are not fundamentally solved.

[0008] Method and system for adaptively extracting valley and ridge lines based on scale space of a disclosed patent (CN 105550691A). A method and system for adaptively extracting valley and ridge lines based on scale space are provided, including first oversampling the original DEM as the initial DEM for processing, and establishing an image pyramid according to the initial DEM; starting from the top layer of the DEM pyramid, performing adaptive multi-angle terrain section elevation extreme value method extraction, and obtaining ridge lines and valley lines through post-processing, and then refining the extraction results layer by layer. Compared with existing methods, this disclosure can take into account both the overall trend and detailed changes in ridge (valley) extraction, ensure the extraction accuracy, and quickly obtain the extraction results, ensuring the extraction efficiency. This method can adapt to the influence of different terrain undulations on the overall result. However, it does not solve the interference of local sampling point noise and optimize a fine ridge line.

[0009] The feature point connection algorithm used in the prior art is relatively complex. When facing the application requirements of large-scale terrain data, the detection results are prone to deviation; the surface geometric shape analysis algorithm used is based on the extracted terrain feature points as the basis for generating feature lines. When the extracted feature points are insufficient or uneven, it will cause problems such as breaks and intersections in the generated terrain feature lines.

[0010] Contents of the invention patent

[0011] Aiming at the deficiencies of the prior art, the invention patent provides a method for automatically extracting terrain ridge lines based on a weighted topological network graph, which has the advantages of being able to ensure the extraction efficiency, having strong anti-noise ability, and being able to extract ridge lines with clear veins, etc., and solves the problems that the feature point connection algorithm used in the prior art is relatively complex, and when facing the application requirements of large-scale terrain data, the detection results are prone to deviation; the surface geometric shape analysis algorithm used is based on the extracted terrain feature points as the basis for generating feature lines. When the extracted feature points are insufficient or uneven, it will cause problems such as breaks and intersections in the generated terrain feature lines.

[0012] To achieve the above object, the present invention patent provides the following technical solution: An automatic extraction method for terrain ridge lines based on a weighted topological network graph, comprising the following steps:

[0013] S1 rasterize the terrain of the target area to obtain DEM data;

[0014] S2 downsample the DEM with a set sampling step to obtain a sampled point image;

[0015] S3 extract target points from the sampled point image using the neighborhood search method, and perform correction processing using neighborhood mean smoothing to obtain weighted peak points;

[0016] S4 thin the peak point image and retain the peak points on the ridge line skeleton;

[0017] S5 construct a weighted topological network graph for the peak point graph, and use the Kruskal algorithm to break the closed graph to form a maximum spanning tree;

[0018] S6 filter short ridge lines, short branches of ridge lines, and redundant branches;

[0019] S7 smooth the ridge line by combining point aggregation and weighted average to obtain the ridge line of the final result.

[0020] Further, the step S2 includes:

[0021] S21, parameter selection: The sampling step is usually taken as the smaller value of the number of rows and columns multiplied by the sampling ratio a. The size of this ratio setting determines the level of downsampling. If the downsampling level is too high, feature points may be misjudged. If the downsampling level is too low, ridge feature points may not be recognized and the extraction efficiency will be affected;

[0022] S22, collect the corresponding grid values of the DEM at a certain interval according to the preset sampling step, and the obtained sampled point image is used for the next calculation.

[0023] Further, the step S3 includes:

[0024] S31, the definition of the peak point is the point corresponding to the maximum elevation value within a certain area. If there is a point P in a certain section of the pixel in the eight directions (east - west, north - south, northeast - southwest, northwest - southeast) that satisfies all the conditions in formula (1), it is a potential peak point and is assigned a value of 1, otherwise it is assigned a value of 0. Among them, L(P) is the number of sampling points with an elevation value smaller than that of point P among the four sampling points extended to the left of the section, and R(P) is the number of sampling points with an elevation value smaller than that of point P among the four sampling points extended to the right of the section;

[0025]

[0026] S32. For neighborhood mean smoothing, a convolution template of n×n is specified with a sampling point as the center, and the average value of the pixel values within the neighborhood is calculated. The calculation formula is as shown in Equation (2), where i and j are the coordinates in the template, N is the number of pixels in the template, and f(x, y) is the pixel value at the center of the template;

[0027]

[0028] Regarding the selection of the window size, the specific operation can be set by those skilled in the art. Usually, better result accuracy and efficiency can be obtained by performing average focus statistics under the default 5×5 window;

[0029] S33. After performing a subtraction operation on the original image and the image after neighborhood mean smoothing, pixels with values higher than zero are assigned 1 as positive terrain, and pixels with values lower than zero are assigned 0 as negative terrain;

[0030] S34. Using the positive and negative terrain images to correct the potential mountaintop point image can filter out the points misclassified as mountaintops in the negative terrain and effectively remove the noise points;

[0031] S35. Set the weight value of each mountaintop point as the original gray value of the pixel.

[0032] Furthermore, the step S4 includes:

[0033] The Zhang-Suen thinning algorithm is a classic thinning algorithm. When used to process the result point set of S3, it can retain the mountaintop points on the backbone and effectively remove the redundant branches generated by invalid mountaintop points. The specific algorithm is as follows:

[0034] S41. First, specify a 3×3 neighborhood analysis window. The pixel numbers in the window are as shown in Equation (3). The operation of the algorithm includes two stages;

[0035]

[0036] S42. In the first stage, if the pixel P1 satisfies all the conditions in Equation (4), then the pixel P1 can be set to zero, where B(P1) represents the number of non-zero neighborhood pixels of P1, and A(P1) represents the number of times the pixel value changes from 0 to 1 along the clockwise direction starting from P2 and returning to P2;

[0037]

[0038] S43. In the second stage, if the pixel P1 satisfies all the conditions in Equation (5), then the pixel P1 can be set to zero, where B(P1) represents the number of non-zero neighborhood pixels of P1, and A(P1) represents the number of times the pixel value changes from 0 to 1 along the clockwise direction starting from P2 and returning to P2;

[0039]

[0040] Further, the step S5 includes:

[0041] S51. Taking the target mountaintop point as the center, searching for other target mountaintop points in the 3×3 rectangular neighborhood in eight directions and connecting them. Each edge is assigned a weight equal to the sum of the weights of the two target mountaintop points. After completion, a weighted topological network graph of the mountaintop points is obtained;

[0042] S52. According to the idea of constructing a spanning tree by Kruskal, sorting all the edges in the weighted topological network in descending order of their weights and storing them in the set of candidate edges;

[0043] S53. Taking out the edge with the largest weight from the set of candidate edges and adding it to the spanning tree;

[0044] S54. Judging whether the added edge causes a non-endpoint intersection with the spanning tree. If not, adding it to the spanning tree; otherwise, removing it from the spanning tree;

[0045] S55. Judging whether the added edge forms a closed loop with the spanning tree. If it does not form a closed loop, adding it to the spanning tree; otherwise, removing it from the spanning tree;

[0046] S56. Repeating the operations of S43, S44, and S45 until the set of candidate edges is empty.

[0047] Further, the step S6 includes:

[0048] S61. Determining the ridgeline threshold, and defining the ridgelines and branches smaller than this threshold as short branches and invalid ridgelines;

[0049] Generally, it is considered that this threshold is not a fixed value. Through research, it is found that removing the ridgelines and branches with an actual length less than 200m can obtain a better denoising effect;

[0050] S63. Removing all the defined short branches and invalid ridgelines;

[0051] S64. Removing the points without connection relationships from the target mountaintop point set.

[0052] Further, the step S7 includes:

[0053] S71. Performing the first step of smoothing on the ridgeline using weighted average: Designating a 3×3 neighborhood analysis window, calculating the weighted average of the row and column numbers of the pixels in the neighborhood. The calculation formulas are as shown in Equation (6) and Equation (7), where N is the number of pixels in the neighborhood analysis window, x n , y n are the row and column numbers of the original pixel, and w nis the corresponding pixel weight value, and f(x) and f(y) are the row and column numbers after smoothing;

[0054]

[0055] S72, Aggregation point operation: Specify an n×n neighborhood analysis window, merge the points with connection relationships within the window into one cluster, and use the cluster point with the largest weight as the cluster center;

[0056] To avoid eliminating the characteristics of the ridge line when aggregating the top points of the target mountain, it should be avoided that the aggregation sampling window is too large. The default setting of 3×3 can obtain good results;

[0057] S73, Calculate the connection relationship of the cluster according to the connection relationship of all the top points of the target mountain within the cluster: Traverse to obtain the top points of the target mountain within the cluster, obtain the adjacent points of the top points of the target mountain. If the adjacent point and the top point of the target mountain do not belong to the same cluster, then build a connection relationship between these two clusters;

[0058] S74, Obtain the coordinates of each cluster center after the first smoothing as the new cluster center, and draw the ridge line according to the new cluster center and the connection relationship, which is the second smoothing of the ridge line;

[0059] S75, Obtain the final result of the ridge line after two smoothings.

[0060] Compared with the prior art, the technical solution of the present application has the following beneficial effects:

[0061] 1. For the automatic extraction method of terrain ridge lines based on a weighted topological network graph, after steps such as neighborhood mean smoothing and redundancy removal in ridge line extraction, the influence of noise is largely removed, overcoming the problem of traditional ridge line extraction methods being sensitive to noise, and at the same time ensuring the extraction accuracy.

[0062] 2. For the automatic extraction method of terrain ridge lines based on a weighted topological network graph, ridge point refinement processing is carried out before smoothing the ridge line, reducing the jaggedness and redundant branches generated by the Kruskal algorithm breaking the closed graph. When smoothing the ridge line, a combination of weighted average and point aggregation is used, which can not only ensure that the line of the ridge line extends smoothly along the actual terrain, but also ensure that the characteristic points of the ridge are on the ridge line, being more consistent with the actual terrain.

[0063] 3. For the automatic extraction method of terrain ridge lines based on a weighted topological network graph, a computer method is used to complete the extraction of the ridge line, realizing the automatic extraction of terrain features. Multiple redundancy removal processes are carried out in the process, improving the anti-noise ability of the algorithm. At the same time, for terrain data with a large amount of data, good extraction effects and speeds can be achieved, greatly improving work efficiency and user experience. Description of the Drawings

[0064] Figure 1 It is a flowchart of an embodiment of the present invention patent;

[0065] Figure 2 It is the result of the peak points extracted by S3;

[0066] Figure 3 It is the refined result of the peak points by S4;

[0067] Figure 4 It is the preliminary effect of the ridge line generated by S4;

[0068] Figure 5 It is the result of the ridge line after filtering invalid ridge lines by S5;

[0069] Figure 6 It is the effect of the ridge line after smoothing by S6, and it is also the final result of ridge line extraction. Detailed Embodiment

[0070] Next, the technical solutions in the embodiments of the present invention patent will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention patent. Obviously, the described embodiments are only a part of the embodiments of the present invention patent, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention patent without creative efforts shall fall within the protection scope of the present invention patent.

[0071] Please refer to Figures 1 to 6 , a method for automatically extracting terrain ridge lines based on a weighted topological network graph in this embodiment, includes the following steps:

[0072] S1 rasterize the terrain of the target area to obtain DEM data;

[0073] S2 set a sampling step size to downsample the DEM to obtain a sampled point image;

[0074] S3 use the neighborhood search method to extract target points from the sampled point image and use neighborhood mean smoothing for correction processing to obtain weighted peak points;

[0075] S4 refine the peak point image and retain the peak points on the ridge line skeleton;

[0076] S5 construct a weighted topological network graph for the peak point graph, and use the Kruskal algorithm to break the closed graph to form a maximum spanning tree;

[0077] S6 filter short ridge lines, short branches of ridge lines, and redundant branches;

[0078] S7 uses a method combining point aggregation and weighted average to smooth the ridgeline and obtain the final ridgeline result.

[0079] In this embodiment, step S2 includes:

[0080] S21, Parameter selection: The sampling step is usually taken as the smaller value of the number of rows and columns multiplied by the sampling ratio a. The size of this ratio setting determines the level of downsampling. If the downsampling level is too high, feature points may be misjudged. If the downsampling level is too low, ridgeline feature points may not be recognized and the extraction efficiency will be affected.

[0081] S22, Collect the corresponding grid values of the DEM at a certain interval according to the preset sampling step, and the obtained sampling point image is used for the next calculation.

[0082] In this embodiment, step S3 includes:

[0083] S31, The mountaintop point is defined as the point corresponding to the maximum elevation value within a certain area. For a pixel, if there is a point P in a certain cross-section in the eight directions (east - west, north - south, northeast - southwest, northwest - southeast) that satisfies all the conditions in formula (1), it is a potential mountaintop point and is assigned a value of 1, otherwise it is assigned a value of 0. Here, L(P) is the number of sampling points with elevation values smaller than that of point P among the four sampling points extended to the left of the cross-section, and R(P) is the number of sampling points with elevation values smaller than that of point P among the four sampling points extended to the right of the cross-section.

[0084]

[0085] S32, Neighborhood mean smoothing designates an n×n convolution template centered on a sampling point and calculates the average value of the pixel values within the neighborhood. The calculation formula is as shown in formula (2), where i, j are the coordinates in the template, N is the number of pixels in the template, and f(x, y) is the pixel value at the center of the template.

[0086]

[0087] In the selection of the window size, the specific operation can be set by those skilled in the art. Usually, better result accuracy and efficiency can be obtained by performing average focus statistics under the default 5×5 window.

[0088] S33, After subtracting the original image from the image smoothed by neighborhood mean, the pixels with values higher than zero are assigned a value of 1 for positive terrain, and the pixels with values lower than zero are assigned a value of 0 for negative terrain.

[0089] S34, Use the positive and negative terrain images to correct the potential mountaintop point image, which can filter out the points misclassified as mountaintops in the negative terrain and effectively remove the noise.

[0090] S35. Set the weight value of each mountaintop point to the original gray value of the pixel.

[0091] In this embodiment, step S4 includes:

[0092] The Zhang-Suen thinning algorithm is a classic thinning algorithm. Using it to process the result point set of S3 can retain the mountaintop points on the backbone and effectively remove the redundant branches generated by invalid mountaintop points. The specific algorithm is as follows:

[0093] S41. First, specify a 3×3 neighborhood analysis window. The pixel numbers in the window are as shown in Equation (3). The operation of the algorithm includes two stages;

[0094]

[0095] S42. In the first stage, if pixel P1 satisfies all the conditions in Equation (4), then pixel P1 can be set to zero, where B(P1) represents the number of non-zero neighborhood pixels of P1, and A(P1) represents the number of times the pixel value changes from 0 to 1 along the clockwise direction starting from P2 and returning to P2;

[0096]

[0097] S43. In the second stage, if pixel P1 satisfies all the conditions in Equation (5), then pixel P1 can be set to zero, where B(P1) represents the number of non-zero neighborhood pixels of P1, and A(P1) represents the number of times the pixel value changes from 0 to 1 along the clockwise direction starting from P2 and returning to P2;

[0098]

[0099] In this embodiment, step S5 includes:

[0100] S51. Taking the target mountaintop point as the center, search for other target mountaintop points in the 3×3 rectangular neighborhood in eight directions and connect them. Each edge is assigned a weight equal to the sum of the weight values of the two target mountaintop points. After completion, a weighted topological network diagram of the mountaintop points is obtained;

[0101] S52. According to the idea of constructing a spanning tree by Kruskal, sort all the edges in the weighted topological network in descending order of weight values and store them in the set of candidate edges;

[0102] S53. Take out the edge with the largest weight value from the set of candidate edges and add it to the spanning tree;

[0103] S54. Determine whether the added edge causes a non-endpoint intersection with the spanning tree. If not, add it to the spanning tree; otherwise, remove it from the spanning tree;

[0104] S55. Determine whether the added edge forms a closed loop with the spanning tree. If it does not form a closed loop, add it to the spanning tree; otherwise, remove it from the spanning tree.

[0105] S56. Repeat the operations of S43, S44, and S45 until the set of candidate edges is empty.

[0106] In this embodiment, step S6 includes:

[0107] S61. Determine the ridgeline threshold. Ridgelines and branches shorter than this threshold are defined as short branches and invalid ridgelines.

[0108] Generally, it is considered that this threshold is not a fixed value. Through research, it is found that removing ridgelines and branches with an actual length less than 200m can achieve a better denoising effect.

[0109] S63. Eliminate all defined short branches and invalid ridgelines.

[0110] S64. Points without connection relationships will be removed from the set of target mountaintop points.

[0111] In this embodiment, step S7 includes:

[0112] S71. Perform the first smoothing of the ridgeline using weighted averaging: Specify a 3×3 neighborhood analysis window, calculate the weighted average of the row and column numbers of the pixels within the neighborhood. The calculation formulas are as shown in Equations (6) and (7), where N is the number of pixels in the neighborhood analysis window, x n , y n are the row and column numbers of the original pixel, w n is the weight value of the corresponding pixel, and f(x), f(y) are the row and column numbers after smoothing.

[0113]

[0114] S72. Aggregation point operation: Specify an n×n neighborhood analysis window, merge the points with connection relationships within the window into a single cluster, and use the cluster point with the largest weight as the cluster center.

[0115] To avoid eliminating the characteristics of the ridgeline when aggregating the target mountaintop points, the aggregation sampling window should not be set too large. By default, setting it to 3×3 can achieve a better effect.

[0116] S73. Calculate the connection relationship of the cluster based on the connectivity of all target mountaintop points within the cluster: Traverse to obtain the target mountaintop points within the cluster, obtain the adjacent points of the target mountaintop points. If the adjacent point and the target mountaintop point do not belong to the same cluster, establish a connection relationship between these two clusters.

[0117] S74. Obtain the coordinates of each cluster center after the first smoothing as the new cluster centers, and draw the ridge line based on the new cluster centers and the connection relationships, which is the second smoothing of the ridge line.

[0118] S75. Obtain the final result of the ridge line after two smoothings.

[0119] Compared with the prior art, the technical solution of the present application has the following beneficial effects:

[0120] For the automatic terrain ridge line extraction method based on the weighted topological network graph, after steps such as neighborhood mean smoothing and redundancy removal in the ridge line extraction, the influence of noise is largely removed, overcoming the problem that the traditional ridge line extraction method is sensitive to noise. At the same time, the extraction accuracy is also ensured. Ridge point refinement is performed before smoothing the ridge line to reduce the jaggedness and redundant branches generated by the Kruskal algorithm for breaking the closed graph. When smoothing the ridge line, a combination of weighted average and point aggregation is used, which can not only ensure that the lines of the ridge line extend smoothly along the actual terrain, but also ensure that the characteristic points of the ridge are on the ridge line, being more consistent with the actual terrain. The extraction of the ridge line is completed using a computer method, realizing the automatic extraction of terrain features. Multiple redundancy removal processes are carried out in the process, improving the anti-noise ability of the algorithm. At the same time, for terrain data with a large amount of data, good extraction effects and speeds can be achieved, greatly improving the work efficiency and user experience.

[0121] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0122] The standard parts used in this application document can all be purchased from the market, and can also be customized according to the descriptions in the specification and the drawings. The specific connection methods of each part all adopt conventional means such as bolts, rivets, and welding that are mature in the prior art. The machinery, parts, and equipment all adopt conventional models in the prior art. The control method is to automatically control through a controller, and the control circuit of the controller can be realized by simple programming by those skilled in the art, which belongs to the common general knowledge in this field. Therefore, the control method and circuit connection will not be explained in detail in this application document.

[0123] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention.

Claims

1. A method for automatically extracting terrain ridgelines based on a weighted topological network graph, characterized in that: The following steps are involved: S1, rasterize the terrain of the target area and obtain DEM data; S2, set the sampling step size to downsample the DEM and obtain the sampling point image; S3, extracting the target point from the sampling point image using the neighborhood search method, and performing correction processing using neighborhood mean smoothing to obtain the weighted mountain top point; S4, refine the mountain top point image and retain the mountain top points on the ridgeline skeleton; S5, construct a weighted topological network graph for the peak point graph, use the Kruskal algorithm to break the closed graph, and form a maximum spanning tree; S6, filter short ridgelines, short branches on ridgelines, and redundant branches; S7, using a method combining point aggregation and weighted average to smooth the ridge line to obtain the final ridge line; The S7 includes: S71, use weighted average to perform the first step of smoothing the ridge line: specify a 3×3 neighborhood analysis window, calculate the weighted average of the pixel row and column numbers in the neighborhood, and the calculation formula is as shown in formula (6) and formula (7), where N is the number of pixels in the neighborhood analysis window, x is n ,y n are the row and column numbers of the original pixel, is the corresponding pixel weight, , is the row and column number after smoothing; , , S72, clustering point operation: specify an n×n neighborhood analysis window, if all target mountain top points in the window have a connected relationship, then obtain the target mountain top point with the maximum weight in the window, and use the sampling point as a clustering center of all target mountain top points in the window; In order to avoid eliminating the ridgeline features when aggregating the target mountain top points, the aggregation sampling window should not be too large. The default setting of 3×3 achieves better results. S73, calculating the connection relationship of the cluster according to the connectivity relationship of all target mountain top points in the cluster: traversing to obtain the target mountain top point in the cluster, obtaining the adjacent point of the target mountain top point, and if the adjacent point does not belong to the cluster, then establishing a connection relationship between the cluster where the adjacent point belongs and the cluster; S74, obtaining the coordinates of each cluster center point after the first smoothing as a new target mountain top point, and drawing a ridge line according to the connection relationship between the new target mountain top point and the corresponding cluster, which is the second smoothing of the ridge line; S75, the final result of the ridge line is obtained after two smoothing steps.

2. The method for automatically extracting terrain ridgelines based on a weighted topological network graph according to claim 1, characterized in that: The S2 includes: S21, parameter selection: The sampling step size is usually the smaller value of the number of rows and columns multiplied by the sampling ratio a. The size of the ratio setting determines the degree of downsampling. If the downsampling degree is too high, the feature points will be misjudged. If the downsampling degree is too low, the ridge feature points will not be identified and the extraction efficiency will be affected. S22, collecting DEM corresponding grid values ​​at a certain interval according to a preset sampling step, and the obtained sampling point image is used for the next step of calculation.

3. The method for automatically extracting terrain ridgelines based on a weighted topological network graph according to claim 1, characterized in that: The S3 includes: S31, the mountain top point is defined as the point corresponding to the maximum elevation in a certain area. If there is a point P that satisfies all the conditions in formula (1) in a certain section of the pixel in the east-west, north-south, northeast-southwest, northwest-southeast, it is a potential mountain top point and is assigned a value of 1, otherwise it is assigned a value of 0, where The number of sampling points with a smaller elevation value than point P among the four sampling points extending from the left side of the section. It is the number of sampling points with smaller elevation values ​​than point P among the four sampling points extending from the right side of the section; , S32, neighborhood mean smoothing is to specify an n×n convolution template with a sampling point as the center, and calculate the average value of the pixel values ​​in the neighborhood. The calculation formula is as follows: (2), where i, j are the coordinates in the template, N is the number of pixels in the template, is the pixel value at the center of the template; , Regarding the selection of window size, the specific operation is set by those skilled in the art. Usually, the average focus statistics are performed under the default 5×5 window to obtain better result accuracy and efficiency; S33, after performing a subtraction operation on the original image and the image smoothed by the neighborhood mean, the pixels above the zero value are assigned a value of 1, which is a positive terrain, and the pixels below the zero value are assigned a value of 0, which is a negative terrain; S34, using the positive and negative terrain images to correct the potential mountain top point image, filtering out the points in the negative terrain that are mistakenly classified as mountain tops, and effectively removing noise points; S35, setting the weight of each mountain top point to the original grayscale value of the pixel.

4. The method for automatically extracting terrain ridgelines based on a weighted topological network graph according to claim 1, characterized in that: The S5 includes: S51, taking the target mountain top point as the center, searching for other target mountain top points in eight directions in a 3×3 rectangular neighborhood to connect with it, and assigning a weight to each edge equal to the sum of the weights of the two target mountain top points. After completion, a weighted topological network diagram of the mountain top points is obtained; S52, according to Kruskal's idea of ​​constructing a spanning tree, all the edges in the weighted topological network are sorted in descending order according to the weights and stored in the edge set to be selected; S53, taking the edge with the largest weight from the set of edges to be selected and adding it to the spanning tree; S54, determining whether the added edge has any intersection with a non-endpoint of the spanning tree, if not, adding the edge to the spanning tree, otherwise removing the edge from the spanning tree; S55, determining whether the added edge forms a closed loop with the spanning tree, if not, adding the edge to the spanning tree, otherwise, removing the edge from the spanning tree; S56, repeat the operations of S53, S54, and S55 until the set of edges to be selected is empty.

5. The method for automatically extracting terrain ridgelines based on a weighted topological network graph according to claim 1, characterized in that: The S6 includes: S61, determining a ridgeline threshold, and ridgelines and branches smaller than the threshold are defined as short branches and invalid ridgelines; S62, it is generally believed that this threshold is not a fixed value. After research, it is found that the removal of ridge lines and branches with an actual length of less than 200m can achieve better denoising effects; S63, remove all defined short branches and invalid ridge lines; S64, points without connection relationships will be removed from the target mountain top point set.

Citation Information

Patent Citations

  • Self-adaptive valley and ridge line extraction method and system based on scale space

    CN105550691A

  • Ridge line extraction method and device, storage medium and electronic equipment

    CN117911434A

  • Mountain line extraction method based on Gaussian scale space

    CN104899865A

  • Ridge line and valley line extraction method based on DBSCAN clustering analysis

    CN113807437A