Method and system for automatically extracting main ridge line based on topological significance constraint and electronic equipment
Patent Information
- Application Number
- CN202611274531.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-27
AI Technical Summary
第一类是基于人工判读的勾绘方法,依靠人工在地形图或遥感影像上勾绘山脊线,该类方法效率低、主观性强、难以复现,无法适配大范围、高分辨率DEM数据处理
第一:提高自动化程度,消除人工端点依赖。本发明通过高程降序连通分析自动识别山峰点和鞍部点,并基于峰—鞍拓扑树自动确定主干控制点序列,无需用户人工指定主山脊线的起点和终点,避免了因端点选择不当导致路径偏离主脊的问题,实现了真正的全自动提取。
Smart Images

Figure CN122989780A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of digital terrain analysis and geographic information processing technology, and specifically discloses a method, system and electronic equipment for automatic extraction of main ridge lines of segmented minimum cost paths based on topological salience constraints. Background Technology
[0002] With the widespread application of digital elevation models (DEMs) in terrain analysis, watershed delineation, geological surveys, engineering site selection, and GIS (Geographic Information System) spatial analysis, the rapid, accurate, and automated extraction of main ridgelines, as key topographic feature lines describing the terrain framework and controlling landform development and watershed boundaries, has become a core requirement for terrain analysis.
[0003] Existing main ridgeline extraction techniques mainly include the following categories: The first type is the delineation method based on manual interpretation, which relies on manual delineation of ridgelines on topographic maps or remote sensing images. This type of method is inefficient, highly subjective, and difficult to reproduce, and cannot be adapted to large-scale, high-resolution DEM data processing.
[0004] The second category is automatic extraction methods based on terrain curvature, water flow direction, neighborhood analysis, or morphology. These methods require setting a large number of empirical thresholds, are highly sensitive to parameters, have poor stability in different terrain regions, and are prone to breakage, artifacts, or deviation from the main ridge. Moreover, they often extract the complete ridgeline network first, and then use post-processing methods such as length threshold and curvature threshold to filter the main ridgeline, which makes the post-processing process complex.
[0005] The third category is extraction methods based on minimum cost paths. These methods construct an elevation inverse cost surface and search for the path with the minimum cumulative cost between the user-specified start and end points as the main ridgeline. While these methods are logically simple and highly reproducible, they suffer from the following drawbacks: First, they rely on manually specifying the start and end points. If the endpoints are chosen at the foot of a mountain, in a valley, on a boundary, or at a location not part of the main ridgeline, the final path may deviate from the true main structure of the large mountain range, indicating insufficient automation. Second, they employ a single global path search, where the path is only controlled by the cost surface, lacking constraints on the mountain's topology, making it difficult to guarantee that the path passes through peaks and saddles with geomorphic control significance. Third, the results have poor interpretability, failing to explain why the main ridgeline passes through specific locations.
[0006] In summary, existing technologies cannot simultaneously meet the requirements for extracting main ridgelines that are fully automated, independent of human endpoints, conform to the topology of the mountain, and can be directly applied to GIS, and there are obvious technical bottlenecks. Summary of the Invention
[0007] To address the aforementioned issues, this application provides an automatic ridgeline extraction method, system, and electronic device based on a segmented minimum cost path using topological salience constraints. The aim is to provide an automatic ridgeline extraction method that eliminates the need for manual specification of ridge start and end points, automatically identifies peaks and saddles based on DEM elevation to improve topographic rationality, possesses the advantage of elevation-based minimum cost paths, can output multi-layer intermediate topographic data to enhance interpretability, is adaptable to various complex mountainous terrains, and whose vector results can be directly used for GIS mapping and spatial analysis. This method aims to overcome, or at least partially overcome, the shortcomings of existing technologies.
[0008] Firstly, this application provides an automatic extraction method for the main ridgeline of a segmented minimum cost path based on topological salience constraints, the method comprising: Step S110: Obtain the raster data of the digital elevation model (DEM) of the study area, identify and mark invalid and valid pixels, and set the identified invalid pixels as impassable areas; Step S120: Sort all valid pixels in descending order of elevation and traverse them pixel by pixel. Use eight-neighborhood search to find the connected components of the surrounding processed pixels of each pixel to be processed. Based on the number of connected components in the neighborhood, automatically identify peak points and saddle points, simultaneously create or merge connected components and record the coordinate elevation information of peaks and saddles, and establish peak-saddle branches between peaks and corresponding saddles. Step S130: Based on the identified peak points, saddle points, and peak-saddle branches, construct a peak-saddle topology tree based on elevation descending connectivity. Step S140: Determine the topological salience of each peak-saddle branch, and based on the peak-saddle topology tree and the topological salience of each peak-saddle branch, automatically determine a sequence of several main control points for the main ridge line. Step S150: Construct an elevation inverse cost surface based on effective pixels, and perform minimum cost path retrieval on each group of adjacent nodes of the main control point to obtain multiple segmented paths; Step S160: Piece together all segmented paths to obtain the complete main ridgeline and output it as a vector.
[0009] Secondly, this application also provides an automatic extraction system for the main ridgeline of a segmented minimum cost path based on topological salience constraints, the system comprising: The acquisition unit is used to acquire the raster data of the digital elevation model (DEM) of the study area, identify and mark invalid and valid pixels, and set the identified invalid pixels as impassable areas. The peak-saddle identification unit sorts all effective pixels in descending order of elevation and then traverses them pixel by pixel. It uses eight-neighborhood search to find the connected components of the surrounding processed pixels of each pixel to be processed. Based on the number of connected components in the neighborhood, it automatically identifies peak points and saddle points, simultaneously creates or merges connected components, records the coordinate elevation information of peaks and saddles, and establishes peak-saddle branches between peaks and corresponding saddles. Topology building unit, used to construct a peak-saddle topology tree based on elevation descending connectivity, according to the identified peak points, saddle points, and peak-saddle branches; The control point determination unit is used to determine the topological salience of each peak-saddle branch, and based on the peak-saddle topology tree and the topological salience of each peak-saddle branch, automatically determine a sequence of several main control points for the main ridge line. The segmented retrieval unit is used to construct an elevation inverse cost surface based on effective pixels and perform minimum cost path retrieval on each group of adjacent nodes of the main control point to obtain multiple segmented paths. The output unit is used to stitch together all segmented paths to obtain the complete main ridgeline and then output it in vector form.
[0010] Thirdly, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the automatic extraction method for segmented minimum cost path main ridgeline based on topological saliency constraints as described above.
[0011] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the automatic extraction method for segmented minimum cost path main ridgeline based on topological salience constraints as described above.
[0012] This application can achieve at least the following beneficial effects: First, it improves automation and eliminates reliance on manual endpoints. This invention automatically identifies peaks and saddles through elevation descending connectivity analysis and automatically determines the sequence of trunk control points based on a peak-saddle topology tree. Users do not need to manually specify the start and end points of the main ridge line, avoiding the problem of path deviation from the main ridge due to improper endpoint selection, thus achieving truly fully automated extraction.
[0013] Second, to enhance the rationality of the terrain, topological constraints are introduced. This invention establishes a two-level structure for automatically generating segmented cost paths from topological control points. The main ridgeline passes through peaks and saddles automatically determined by the DEM elevation structure. Adjacent control points extend along the minimum cumulative cost path of the elevation anti-cost surface, making the path subject to both peak-saddle connection relationships and cost surfaces, thus better conforming to the actual main structure of the mountain.
[0014] Third, the processing flow is simplified, eliminating the need for post-processing of complete ridgelines. This invention does not require extracting the complete ridgeline network first, nor does it require deleting small ridges or connecting broken segments through length thresholds, curvature thresholds, or other methods. It directly determines the main control points and generates the main ridgelines from the DEM elevation descending connectivity process, avoiding the complex post-processing procedures of traditional methods.
[0015] Fourth, it improves the interpretability of results. This invention can simultaneously output intermediate results such as peak points, saddle points, and main control point sequences, which can clearly explain why the main ridgeline passes through these locations, facilitating result verification and geomorphological interpretation.
[0016] Fifth, it retains the advantages of the minimum cost path method while being more adaptable. This invention inherits the advantages of the minimum cost path method, such as simple logic, reproducibility, and output that can be directly used for GIS analysis. At the same time, it adapts to curved ridges, multi-peak structures, and complex mountainous scenarios through segmented path design. It first determines the topological control points and then optimizes the spatial path, resulting in more stable extraction results.
[0017] Sixth, it is suitable for large-scale data processing. The method of this invention has a rigorous closed-loop process, which does not require manual intervention pixel by pixel. It can efficiently process the extraction of main ridge lines in large-scale research areas and is suitable for DEM data of different resolutions and terrain types. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating an embodiment of the automatic extraction method for segmented minimum cost path main ridgeline based on topological salience constraints according to this application is shown. Figure 2 A schematic diagram of the structure of an automatic ridgeline extraction system for segmented minimum cost paths based on topological salience constraints according to an embodiment of this application is shown. Figure 3 A schematic diagram of the original DEM elevation data of a mountain study area according to an embodiment of this application is shown; Figure 4 A schematic diagram of the results of peak points and saddle points based on elevation descending connectivity identification according to an embodiment of this application is shown; Figure 5 A schematic diagram of a main control point sequence consisting of peak points and saddle points according to an embodiment of this application is shown; Figure 6 A schematic diagram of the final main ridgeline obtained by segmented path splicing according to an embodiment of this application is shown; Figure 7 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0019] To make the objectives, technical claims, and advantages of this application clearer, the technical application of this application will be clearly and completely described below with reference to specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] The main concept of this application is as follows: using effective pixels of the DEM as the basic computational object, the effective pixels are first processed by elevation reduction, and peak points and saddle points are identified based on neighborhood connectivity, forming a topology composed of peak points, saddle points, and peak-saddle branches; then, the sequence of main control points is determined based on the elevation difference of the peak-saddle branches; finally, an eight-neighbor Dijkstra minimum cumulative cost path search is performed between adjacent control points based on the elevation inverse cost surface, and all segmented paths are spliced into a complete main ridgeline. It can be seen that this application first automatically determines "which key peak points and saddle points the main ridgeline should pass through" based on the DEM elevation reduction connectivity process, and then uses minimum cost paths between these adjacent control points to determine "how they should be connected spatially along the elevation". This design not only has the technical concept of minimum cost paths, but also significantly reduces the impact of manual endpoint selection on the results, achieving accurate extraction of the main ridgeline without the need for manual specification of ridge start and end points.
[0021] Example 1 This application provides an automatic extraction method for the main ridgeline of a segmented minimum cost path based on topological salience constraints. The "topological salience constraints" emphasize that the control points of the main ridgeline are not subjectively specified by the user, but are automatically determined by the peak points, saddle points and their connection relationships in the DEM elevation field. The "segmented minimum cost path" emphasizes that the final main ridgeline is not simply connected to the control points, but rather a minimum cumulative cost path search is performed between adjacent control points based on the elevation inverse cost surface.
[0022] Please refer to Figure 1 , Figure 1 This diagram illustrates a flowchart of an automatic extraction method for segmented minimum cost path main ridgelines based on topological salience constraints according to an embodiment of this application. Figure 1 As can be seen, this embodiment includes: Step S110: Obtain the raster data of the digital elevation model (DEM) of the study area, identify and mark invalid and valid pixels, and set the identified invalid pixels as impassable areas.
[0023] The input data for this application is digital elevation model (DEM) raster data of the study area. The DEM is preferably raster format data containing spatial reference information, such as GeoTIFF format data. Each cell in the DEM corresponds to an elevation value and has corresponding coordinate reference system, resolution, and spatial extent information. To ensure consistency in subsequent processing, the DEM raster data preferably has explicit coordinate reference information. Therefore, the DEM can be GeoTIFF or other data formats capable of expressing raster elevation, coordinate reference system, and spatial resolution.
[0024] In some embodiments of this application, the acquisition of raster data of the Digital Elevation Model (DEM) of the study area can be achieved in any of the following ways: (1) by acquiring it through remote sensing mapping equipment, such as aerial photogrammetry, airborne lidar, satellite remote sensing stereo mapping, etc.; (2) by acquiring the DEM product of the study area from an existing DEM database or a public DEM data source; (3) by cropping the existing DEM to obtain the DEM raster data within the target study area. To ensure that the output results can be directly used for GIS analysis, the input DEM preferably contains complete coordinate reference information. The input DEM is recommended to include, but is not limited to, the following information: 1. Elevation value of each pixel; 2. Number of raster rows and columns and pixel spatial resolution; 3. Spatial reference or projection coordinate information; 4. NoData marker or abnormal fill value information; 5. Boundary of the study area or the effective range of the cropped DEM.
[0025] In some embodiments of this application, identifying and marking invalid and valid pixels, and setting the identified invalid pixels as impassable areas, includes: performing a global elevation statistical analysis on the raster data of the Digital Elevation Model (DEM) to identify invalid pixels, including pixels outside the study area, pixels marked as NoData, pixels with abnormal fill values, and pixels outside the actual terrain range; identifying all pixels in the raster data of the DEM, except for invalid pixels, as valid pixels, all of which are located within the study area and have true elevation significance; and setting the invalid pixels as impassable areas. The marking of impassable areas can be achieved through, but is not limited to, raster masks or attribute assignment methods. Impassable areas do not participate in subsequent terrain analysis and accessibility evaluation calculations.
[0026] In the embodiments of this application, the inaccessible area refers to the area that does not participate in the subsequent calculation, and its corresponding pixel is defined as an invalid pixel; or, the area identified as an invalid pixel is set as an inaccessible area. Invalid pixels include, but are not limited to, at least one of the following: (1) pixels that are explicitly marked as NoData in the metadata of the DEM file, i.e., pixels marked as NoData pixels; (2) pixels outside the study area, i.e., pixels that exceed the study area; (3) preset fill value pixels used to fill null values or indicate anomalies, i.e., abnormal fill value pixels, for example, a preset fill value of 32767 and an elevation value of 32767 are abnormal fill value pixels; (4) abnormal pixels that, after inspection, are clearly not within the range of the actual terrain elevation values, i.e., pixels that exceed the range of the actual terrain.
[0027] Therefore, in some embodiments of this application, invalid pixels can be identified using one or a combination of the following methods: Method 1: Read the NoData markers inherent in the raster data file of the Digital Elevation Model (DEM) and label pixels marked as NoData as invalid pixels. Method 2: Identify pixels outside the study area based on the study area boundary mask and label the obtained pixels outside the study area as invalid pixels. Method 3: Perform statistical analysis on the DEM; when a significant abnormal fill value appears in the maximum value or elevation distribution, the value is recorded as an invalid fill value, and the corresponding pixel is labeled as an invalid pixel. In the DEM, each pixel has a corresponding ground elevation value; normal areas represent the actual terrain elevation; missing data, holes, and gaps are often automatically filled with a fixed abnormal fill value. Common abnormal fill values in the industry include, but are not limited to: -9999, 0, extremely negative values / extremely positive values, etc.; when a significant abnormal fill value is identified, the value is recorded as an invalid fill value, and the corresponding pixel is labeled as an invalid pixel. Method 4: Combine the data source description and elevation value range to identify outliers that exceed the normal elevation value range, and mark the pixels identified as outliers as invalid pixels.
[0028] Specifically, in some embodiments, outliers can be determined by simultaneously combining two conditions: the data source description and the reasonable range of regional elevation. First, the production documentation and metadata of the original Digital Elevation Model (DEM) data are reviewed to clarify basic information such as data acquisition methods, production standards, no-data-filling rules, coordinate systems, and elevation datums, and to understand the specific numerical rules preset in the data itself. Second, the normal elevation range corresponding to the local terrain is determined by considering the actual geographical environment of the study area. The actual DEM elevation values are compared with the recorded rules and the reasonable regional elevation range. If the values do not conform to the data production specifications, or significantly exceed the reasonable elevation range of the regional terrain or violate the actual terrain features, they can be determined as elevation outliers.
[0029] For example, in a plain area, DEM metadata indicates that areas with no data are uniformly filled with -9999. The normal elevation range for this area is 5m to 80m. When the image shows values such as -9999 or -500 that are significantly lower than the actual terrain, or when there are superelevation values exceeding 5000m that deviate from the regional topography, these values can be accurately identified as outliers by combining data annotation rules with the local elevation range. It should be noted that a pixel may be identified as invalid using both methods three and four simultaneously; these two methods do not conflict. Furthermore, if a pixel is identified as invalid by either method, then that pixel is considered invalid.
[0030] In this embodiment, a valid pixel refers to a pixel located within the study area, possessing true elevation significance, and not belonging to NoData pixels, pixels outside the study area, or pixels with anomalous fill values. In other words, valid pixels are all available elevation pixels participating in subsequent cost construction and path calculation.
[0031] As can be seen, after identifying invalid pixels, removing them will yield valid pixels.
[0032] In a preferred embodiment, when performing global elevation statistical analysis on the raster data of the digital elevation model (DEM), if the maximum statistical value of the DEM is detected to be a preset threshold (e.g., 032767), all pixels with values at the preset threshold are identified as invalid pixels, and then the invalid pixels are set as impassable areas; finally, based on the raster data after removing such invalid pixels, the statistical values of the valid pixels are recalculated.
[0033] This step creates an effective cell mask. The effective cell mask indicates which cells can participate in subsequent elevation-descending connectivity analysis and minimum-cost path search. Invalid cells do not participate in peak identification, saddle identification, peak-saddle branch construction, cost array construction, or path search.
[0034] Step S120: Sort all valid pixels in descending order of elevation and traverse them pixel by pixel. Use eight-neighborhood search to find the connected components of the surrounding processed pixels of each pixel to be processed. Based on the number of connected components in the neighborhood, automatically identify peak points and saddle points, simultaneously create or merge connected components, record the coordinate elevation information of peaks and saddles, and establish peak-saddle branches between peaks and corresponding saddles.
[0035] Sort all valid cells in descending order of elevation value. After sorting, process the valid cells one by one in this order. Since cells with higher elevations are processed first and cells with lower elevations are processed later, at any given processing time, the processed cells constitute several connected regions with higher elevations.
[0036] For the currently processed cell, check if there are any previously processed valid cells within its eight-neighbor range, and determine which connected components these processed neighboring cells belong to. The preferred neighborhood relationship is an eight-neighbor range, which consists of eight adjacent cells in the top, bottom, left, right, and four diagonal directions. Using an eight-neighbor range avoids the disruption of diagonal continuous ridges or diagonal connections that can occur when using only four-neighbor ranges.
[0037] For maintaining connected components, a disjoint-set data structure can be used to maintain the connected components formed by the currently processed cells, or other data structures that can maintain the merging relationship of connected components can be used.
[0038] Based on the number of processed connected components in the current cell's neighborhood, there are three possible scenarios: First, if there are no processed cells in the neighborhood, the current cell becomes a new peak point; second, if all processed cells in the neighborhood belong to the same connected component, the current cell is merged into that connected component; third, if there are two or more different connected components in the neighborhood, the current cell becomes a saddle point connecting these connected components.
[0039] Specifically, in some embodiments of this application, mountain peaks can be identified using the following method: If, when the current cell is processed, there are no previously processed valid cells in its eight neighborhoods, it means that the cell appears independently at the current elevation level and is not adjacent to any existing elevation connected region. Therefore, the cell is identified as a new peak point, and a new connected component is created using this peak point as a representative.
[0040] The peak points in this application are local peak representative points automatically determined by the DEM elevation descending connectivity process. It does not rely on place names, manual annotations, or external peak databases. As long as a valid cell first forms a new independent connected component during the elevation descending process, that cell can be recorded as a peak point.
[0041] Each peak point should at least record its pixel number, spatial coordinates, elevation value, and the connected component information it represents. Subsequently, when this connected component merges with other connected components through a saddle point, the merging saddle and the peak-saddle elevation difference corresponding to that peak point can also be recorded.
[0042] In some embodiments of this application, identifying saddle points and recording peak-saddle branches can be performed using the following method: If, when the current cell is processed, there are two or more processed cells belonging to different connected components in its neighborhood, it indicates that these originally independent elevation-connected regions are connected for the first time at the current cell. Therefore, the current cell is identified as a saddle point.
[0043] The identification of saddle points is not based on manual interpretation, nor on simple slope or curvature thresholds, but on the merging events of connected components during the elevation-descending processing. In other words, the current cell is identified as a saddle point because it connects the connected components corresponding to different peaks as the elevation gradually decreases.
[0044] For a saddle point, it is necessary to record its cell number, spatial coordinates, elevation value, number of connected components, and the mountain peaks connected to the saddle point.
[0045] For each peak connected by the saddle point, a peak-saddle branch is established. The peak-saddle branch is used to express the connection relationship between a peak point and a saddle point.
[0046] A single saddle point may connect more than two connected components, thus a single saddle point can correspond to multiple peak-saddle branches. To avoid duplicate recording, when multiple connected components trace back to the same peak point, only one peak-saddle branch of that peak point is recorded at the same saddle point.
[0047] After recording the saddle points and peak-saddle branches, multiple connected components participating in the saddle connection event are merged. During merging, the connected component with the highest representative peak elevation is selected as the retained component; if the representative peak elevations are the same, the connected component with the larger number of pixels is selected as the retained component. This merging rule is used to maintain the consistency of connectivity relationships during the elevation-descending connectivity process.
[0048] Step S130: Based on the identified peak points, saddle points, and peak-saddle branches, construct a peak-saddle topology tree based on descending elevation connectivity.
[0049] The purpose of this step is not to extract the complete ridgeline network, nor to directly generate the final main ridgeline, but to organize the peak points, saddle points, and peak-saddle branches generated during the aforementioned elevation descending process into a data structure that can express the main elevation connectivity relationships of the mountain. This data structure is referred to in this paper as the "peak-saddle topology tree based on elevation descending connectivity".
[0050] The basic components of this peak-saddle topology tree include peak points, saddle points, and peak-saddle branches. Peak points represent the locations where new independent connected components are formed during the elevation descending process; saddle points represent the locations where different connected components first connect; and peak-saddle branches represent the connection relationship between a peak point and a saddle point. Since peak points and saddle points represent different types of objects, this structure can be expressed as a connection graph composed of peak point nodes and saddle point nodes.
[0051] From a topographical perspective, peaks represent the starting points of local elevation bodies, saddle points represent the connection points between different elevation bodies, and peak-saddle branching represents the relationship of a peak relative to its connecting saddle. Combining these elements allows us to describe the hierarchical relationship of elevation bodies gradually connecting from high to low elevations within the study area. This hierarchical relationship is not equivalent to all ridgeline networks in the traditional sense, but rather is used to determine the key control points that the main ridgeline of a large mountain range should pass through.
[0052] In this step, each peak point generation event adds a peak point node to the peak-saddle topology tree; each saddle point merging event adds a saddle point node; and each peak point connected to a saddle point forms a peak-saddle branch with that saddle point. Thus, as all valid pixels are processed, all peak points, saddle points, and peak-saddle branches identified by elevation descending connectivity within the study area are incorporated into the same topology.
[0053] It is important to note that constructing the peak-saddle topology tree does not mean that the final main ridgeline has been determined. This topology tree is only the basis for subsequently determining the sequence of trunk control points. The final main ridgeline can only be obtained after further steps to determine the sequence of trunk control points and to perform minimum-cost path searches on adjacent control points.
[0054] This step differs significantly from traditional ridgeline extraction methods. Traditional methods often first extract a large number of local ridgelines based on slope, curvature, flow direction, confluence relationships, or morphological operators, and then delete secondary ridges, connect broken segments, and filter main ridgelines through length thresholding, curvature thresholding, manual editing, or topology repair. This application does not require generating a complete ridgeline network first, nor does it require post-processing of a large number of local ridgelines. Instead, it directly extracts the connection relationships between peak points and saddle points from the DEM elevation descending connectivity process. This set of objects provides the foundation for the subsequent automatic determination of the main control point sequence, making the minimum cost path search no longer a path search between arbitrary two points, but a segmented path search constrained by peak-saddle connectivity relationships.
[0055] The final result of this step includes at least: a set of peak points, a set of saddle points, a set of peak-saddle branches, and the connectivity relationships formed by these objects. These results serve as input for subsequent topological saliency calculations and the determination of the backbone control point sequence.
[0056] Step S140: Determine the topological salience of each peak-saddle branch, and based on the peak-saddle topology tree and the topological salience of each peak-saddle branch, automatically determine a sequence of several main control points for the main ridge line.
[0057] This step forms the evaluation basis for selecting the core control point sequence from the peak-saddle topology tree. The purpose of this step is to assign a quantitative value to each peak-saddle branch that reflects its importance, enabling the automatic identification of continuous paths representing the main structure of the mountain among numerous peaks and saddles.
[0058] In some embodiments of this application, topological salience can be determined by peak-saddle elevation difference, relative peak undulation, peak-saddle branch length, or other indicators that can reflect the importance of peak-saddle branches. Preferably, in some embodiments of this application, the topological salience of the peak-saddle branch is represented by the difference between the elevation of the peak point and the elevation of the corresponding saddle point. This difference reflects the relative undulation of a peak point relative to its connecting saddle. The calculation formula is as follows: R = H_peak - H_saddle; Where R represents the topological salience or elevation difference of the peak-saddle branch; H_peak represents the elevation of the peak point corresponding to the branch; and H_saddle represents the elevation of the saddle point corresponding to the branch. If the calculation result is negative due to special data conditions, R is corrected to 0 to avoid negative weights affecting subsequent path search.
[0059] Using the difference in elevation between a peak and a saddle point as an evaluation metric has clear topographic significance. If the elevation of a peak is significantly higher than that of its connecting saddle, it indicates that the peak has greater undulations relative to its surrounding connecting points, and that the peak is more prominent in the regional topographic structure. If the elevation difference between a peak and its connecting saddle is small, then the peak-saddle branch may only represent minor local undulations or secondary topographic changes.
[0060] Unlike directly using absolute elevation, peak-saddle elevation difference emphasizes the relative prominence of a peak relative to its connecting position. For extracting the main ridgeline of a large mountain range, simply selecting the pixel with the highest elevation is insufficient to represent the main structure of the mountain range, because local peaks may be located on tributary ridges or isolated peaks; while peak-saddle elevation difference can express the relative relationship between peak points and connecting saddles, making it more suitable as a side weight in the search of the main control point sequence.
[0061] Unlike the manual thresholding used in existing technologies, this topological saliency is calculated entirely from the elevation values of peaks and saddles in the DEM, without requiring the user to pre-specify slope thresholds, curvature thresholds, ridge length thresholds, or peak area thresholds. Therefore, this step maintains the automation and reproducibility of the method described in this application.
[0062] In a peak-saddle topology tree, each peak-saddle branch has an R value. The larger the R value, the higher the weight of that branch in the subsequent search of the main control point sequence. In this way, the tree can automatically favor peak-saddle connections with larger elevation differences and more prominent terrain features, rather than relying on human experience to determine which peaks or saddles are important.
[0063] When a saddle point connects to multiple peaks, an R-value is calculated for each peak and the saddle point. This preserves the differences in the connections of multiple peaks near the same saddle: even if they share the same saddle, the elevation differences of different peaks relative to that saddle may differ, and their importance in the main path may also differ.
[0064] The calculation of topological significance involves assigning a weight to each peak-saddle branch, which is then used in subsequent steps for the automatic determination of the backbone control point sequence.
[0065] The following describes how to automatically determine the sequence of trunk control points.
[0066] The automatic determination of the main control point sequence is the core step in realizing automated main ridgeline extraction. The peak-saddle topology tree and peak-saddle branch topology salience obtained in the previous step automatically determine the sequence of control points that the main ridgeline should pass through without requiring the user to specify the start and end points.
[0067] The main control point sequence is a node sequence formed by arranging peak points and saddle points in a certain order. This sequence is not the final main ridgeline, but rather the control framework for subsequent segmented minimum cost path searches. The final main ridgeline needs to be obtained by performing minimum cost path searches and concatenating the nodes in this control point sequence.
[0068] The sequence of main control points typically presents an alternating pattern of peak points and saddle points, for example: P1→S1→P2→S2→P3→S3→P4; Where P represents a peak point and S represents a saddle point. This sequence represents a continuous connection relationship that starts from a peak point at the end of a main trunk, passes through several key saddle points and intermediate peak points, and extends to another peak point at the end of a main trunk.
[0069] In a preferred embodiment, the peak-saddle topology tree is viewed as a weighted undirected connected graph. The nodes in the graph are peak points and saddle points, and the edges are peak-saddle branches with edge weights equal to the calculated topological salience R. Then, continuous paths with larger cumulative edge weights are found in the connected graph, and these paths are used as the main control point sequence.
[0070] Specifically, two Dijkstra searches can be used to determine the sequence of control points on the backbone. First, select any node in a connected component as the starting node, calculate the cumulative edge distance from the starting node to all nodes within the same connected component, and select the peak with the largest distance as the first endpoint. Then, starting from the first endpoint, calculate the cumulative edge distance to all other nodes again, and select the peak with the largest distance as the second endpoint. Based on the predecessor node relationships recorded in the second search, backtracking from the second endpoint to the first endpoint yields the node sequence between the two endpoints.
[0071] If multiple disconnected peak-saddle connections exist within the study area, the above process is performed on each connection separately, and the cumulative weights of the paths obtained from each connection are compared. The path with the highest cumulative weight is selected as the final main control point sequence. This avoids the situation where the method only obtains the main ridgeline based on a local area when the study area contains multiple independent mountains or multiple unconnected elevation regions.
[0072] In this step, peak points are preferentially selected at the two ends of the main control point sequence, rather than saddle points. The reason for this is that, in terms of geomorphological representation, the main ridgeline should typically extend from one major elevation body to another. If the endpoints fall on saddle points, the main path may only express a local connection and cannot fully represent the direction of the main mountain's extension.
[0073] Once the main control point sequence is determined, the first and last nodes of the main control point sequence can be used as automatic start and end control points for the overall main ridgeline, while the intermediate peaks and saddles serve as intermediate control points during the path extension process.
[0074] It is important to emphasize that the sequence of control points obtained in this step does not directly connect the peaks and saddles into a line, nor is it the final main ridgeline. This sequence only answers the question of "which key control points the main ridgeline should pass through." The specific connections between these control points in the DEM space will be determined by the minimum cost path search in subsequent steps.
[0075] After automatically determining the sequence of main control points, the final output includes: the sequence of main control points, the set of peak points participating in the sequence, the set of saddle points participating in the sequence, and the cumulative topological salience value corresponding to the sequence. This information can be used for subsequent path searching or as an intermediate result output, facilitating the checking in GIS software whether the main control points conform to the main structure of the mountains in the study area.
[0076] Step S150: Construct an elevation inverse cost surface based on effective pixels, and perform minimum cost path retrieval on each group of adjacent nodes of the main control point to obtain multiple segmented paths.
[0077] Construct an elevation inverse cost surface.
[0078] In some embodiments of this application, the maximum elevation value of valid pixels is statistically analyzed, and an elevation inverse cost surface is constructed based on the maximum elevation value. This includes: statistically analyzing the elevation values of all retained valid pixels and taking the maximum value as the maximum elevation value max(DEM) of valid pixels in the study area; based on this maximum elevation value, the cost value of each valid pixel is calculated using the following formula to construct the elevation inverse cost surface of valid pixels. This elevation inverse cost surface is used to guide path search between adjacent control points, making the path tend to pass through terrain locations with higher elevations. cost(i,j) = H_max - DEM(i,j) + a; Where cost(i,j) is the cell passage cost, H_max is the maximum effective cell elevation, DEM(i,j) is the current cell elevation, and a is the positive offset, preferably 1. Invalid cells are set to impassable or have infinite cost.
[0079] As can be seen from the above formula, the higher the pixel elevation, the lower the cost value; the lower the pixel elevation, the higher the cost value. The purpose of adding a positive offset is to ensure that the cost value of all effective pixels is greater than 0, and to avoid zero-cost pixels.
[0080] Invalid cells remain null or impassable on the cost surface and do not participate in path propagation.
[0081] For example, when the maximum effective elevation value (DEM) of the study area is 6200, if a certain pixel has an elevation of 6150, its cost value is 51; if another pixel has an elevation of 4800, its cost value is 1401. This shows that high-altitude pixels have significantly lower costs, therefore subsequent minimum-cost expansion will preferentially propagate along high-altitude terrain, which is more consistent with the topographical pattern that the main ridgeline is usually located at the elevation ridge.
[0082] Perform a segmented minimum cost path search between adjacent control points.
[0083] For each pair of adjacent control points in the main control point sequence, a minimum cost path search is performed. For example, for P1→S1→P2→S2→P3, segmented paths between P1 and S1, S1 and P2, P2 and S2 and P3 need to be calculated separately.
[0084] Minimum cost path search method: Using the eight-neighborhood Dijkstra algorithm and A... Algorithms or other algorithms with the minimum cumulative cost.
[0085] The eight-neighbor Dijkstra algorithm is preferred. Each valid cell is treated as a graph node, and adjacent valid cells are treated as graph edges. The edge cost between adjacent cells p and q is preferably calculated in the following form: E(p,q) = D(p,q) × [cost(p) + cost(q)] / 2; Where D(p,q) is the spatial distance between two pixels.
[0086] Horizontal and vertical movement is calculated using either cell width or height, while diagonal movement is calculated using diagonal distance. This edge cost allows pathfinding to consider both cell elevation cost and spatial movement distance.
[0087] To improve computational efficiency, a buffer can be added to the minimum bounding row and column range of the start and end points to form a local search window. If no path is found within the initial window, the window is expanded; if no path is found even after expanding to the maximum window, the search can be reversed to the full graph. This design does not change the minimum cost path logic, but only reduces the search overhead in irrelevant regions.
[0088] Step S160: Piece together all segmented paths to obtain the complete main ridgeline and output it as a vector.
[0089] The segmented paths are spliced to obtain the complete main ridgeline. Following the sequence of the main control points, the segmented minimum-cost paths obtained between adjacent control points are spliced sequentially. Since adjacent segments share control points, duplicate cells are removed during splicing to ensure the final path is continuous and non-repetitive.
[0090] The spliced main ridgeline satisfies two constraints: first, the entire ridgeline passes through the main control points automatically determined by the peak-saddle topology; second, adjacent control points extend along the minimum cumulative cost path on the elevation reverse cost surface. Therefore, this result has both topological control significance and spatial path optimization significance.
[0091] Finally, the output is vectorized. The pixel sequence of the final main ridgeline is converted into pixel center point coordinates in sequence and connected into a vector polyline. Ideally, the output should be in Shapefile format for easy opening in GIS software such as ArcGIS, ArcGIS Pro, and QGIS.
[0092] Preferably, in addition to the final main ridgeline, the system can also output the sequence of peak points, saddle points, main control points, and segmented paths to verify and demonstrate the method execution process.
[0093] As can be seen, this application can output multiple intermediate and final results for verification and GIS applications. These results may include, but are not limited to: 1. Peak point vector data, used to represent representative points of local peaks automatically identified during the elevation descending connectivity process. 2. Saddle point vector data, used to represent the locations where multiple connected components first connect. 3. Main control point sequence vector data, used to represent the key peak points and saddle points that the automatically determined main ridgeline should pass through. 4. Segmented path vector data, used to represent the segmented lines obtained by searching for the minimum cost path between adjacent control points. 5. Final main ridgeline vector data, used to represent the complete main ridgeline after all segmented paths are sequentially spliced together.
[0094] The above description may involve several key data objects from Table 1, which are summarized below for better understanding of this application. It should be noted that these are not independent software module names, but rather intermediate data results required to illustrate the methodological logic.
[0095] Table 1
[0096] Example 2 This application also provides an automatic ridgeline extraction system for segmented minimum cost paths based on topological salience constraints. Please refer to [link / reference]. Figure 2 , Figure 2 This diagram illustrates the structure of an automatic ridgeline extraction system for segmented minimum cost paths based on topological salience constraints, according to an embodiment of this application. Figure 2 It can be seen that the automatic extraction system for the main ridgeline of the segmented minimum cost path based on topological salience constraints 200 includes: The acquisition unit 210 is used to acquire the raster data of the digital elevation model (DEM) of the study area, identify and mark invalid and valid pixels, and set the identified invalid pixels as impassable areas. The peak-saddle identification unit 220 is used to sort all effective pixels in descending order of elevation and then traverse pixel by pixel. It uses eight-neighbor search to retrieve the connected components of the surrounding processed pixels of each pixel to be processed. Based on the number of connected components in the neighborhood, it automatically identifies peak points and saddle points, simultaneously creates or merges connected components, records the coordinate elevation information of peaks and saddles, and establishes peak-saddle branches between peaks and corresponding saddles. Topology building unit 230 is used to construct a peak-saddle topology tree based on elevation descending connectivity according to the identified peak points, saddle points and peak-saddle branches; The control point determination unit 240 is used to determine the topological salience of each peak-saddle branch, and automatically determine a sequence of several main control points for the main ridge line based on the peak-saddle topology tree and the topological salience of each peak-saddle branch. The segmented retrieval unit 250 is used to construct an elevation inverse cost surface based on effective pixels and perform minimum cost path retrieval on each group of adjacent nodes of the main control point to obtain multiple segmented paths. Output unit 260 is used to stitch together all segmented paths to obtain the complete main ridgeline and then output it in vector form.
[0097] It should be noted that the automatic extraction system for the main ridgeline of the segmented minimum cost path based on topological salience constraints can be implemented one-to-one with the aforementioned automatic extraction method for the main ridgeline of the segmented minimum cost path based on topological salience constraints, which will not be elaborated here.
[0098] Example 3 In this embodiment, a DEM (Digital Elevation Model) image, cropped to the target mountain range, is input into the automatic ridgeline extraction system for segmented minimum cost paths based on topological saliency constraints (hereinafter referred to as the system). The system first identifies the valid pixels in the DEM and processes these valid pixels from high to low elevation. Locations with higher elevations and no surrounding processed pixels are identified as peaks; when a lower pixel connects two or more existing connected components, that pixel is identified as a saddle point.
[0099] Subsequently, the system establishes peak-saddle branches based on the connection relationship between peak points and saddle points, and calculates the difference between the elevation of the peak point and the elevation of the saddle point for each branch. Using this elevation difference as the edge weight, the system automatically determines a main control point sequence with a larger cumulative weight.
[0100] After obtaining the sequence of main control points, the system constructs an elevation inverse cost surface and performs an eight-neighborhood Dijkstra minimum cost path search segment by segment between adjacent control points. Finally, all segmented paths are concatenated and vectorized for output, yielding the final main ridgeline.
[0101] Please refer to the intermediate data and final results. Figures 3-6 , Figure 3 A schematic diagram of the original DEM elevation data of a mountain study area according to an embodiment of this application is shown; Figure 4 A schematic diagram of the results of peak points and saddle points based on elevation descending connectivity identification according to an embodiment of this application is shown; Figure 5 A schematic diagram of a main control point sequence consisting of peak points and saddle points according to an embodiment of this application is shown; Figure 6 A schematic diagram of the final main ridgeline obtained by splicing segmented paths according to an embodiment of this application is shown. Figures 3-6The demonstration showed that the process of first inputting the original DEM elevation data of the study area, then extracting all the peaks and saddles in the area using the elevation descending order connectivity algorithm, selecting the main control points of the mountain based on the topological relationship of the points, and finally solving the segmented paths between adjacent control points and splicing them to generate the complete main ridge line.
[0102] In summary, this application can achieve at least the following beneficial effects: First, it improves automation and eliminates reliance on manual endpoints. This invention automatically identifies peaks and saddles through elevation descending connectivity analysis and automatically determines the sequence of trunk control points based on a peak-saddle topology tree. Users do not need to manually specify the start and end points of the main ridge line, avoiding the problem of path deviation from the main ridge due to improper endpoint selection, thus achieving truly fully automated extraction.
[0103] Second, to enhance the rationality of the terrain, topological constraints are introduced. This invention establishes a two-level structure for automatically generating segmented cost paths from topological control points. The main ridgeline passes through peaks and saddles automatically determined by the DEM elevation structure. Adjacent control points extend along the minimum cumulative cost path of the elevation anti-cost surface, making the path subject to both peak-saddle connection relationships and cost surfaces, thus better conforming to the actual main structure of the mountain.
[0104] Third, the processing flow is simplified, eliminating the need for post-processing of complete ridgelines. This invention does not require extracting the complete ridgeline network first, nor does it require deleting small ridges or connecting broken segments through length thresholds, curvature thresholds, or other methods. It directly determines the main control points and generates the main ridgelines from the DEM elevation descending connectivity process, avoiding the complex post-processing procedures of traditional methods.
[0105] Fourth, it improves the interpretability of results. This invention can simultaneously output intermediate results such as peak points, saddle points, and main control point sequences, which can clearly explain why the main ridgeline passes through these locations, facilitating result verification and geomorphological interpretation.
[0106] Fifth, it retains the advantages of the minimum cost path method while being more adaptable. This invention inherits the advantages of the minimum cost path method, such as simple logic, reproducibility, and output that can be directly used for GIS analysis. At the same time, it adapts to curved ridges, multi-peak structures, and complex mountainous scenarios through segmented path design. It first determines the topological control points and then optimizes the spatial path, resulting in more stable extraction results.
[0107] Sixth, it is suitable for large-scale data processing. The method of this invention has a rigorous closed-loop process, which does not require manual intervention pixel by pixel. It can efficiently process the extraction of main ridge lines in large-scale research areas and is suitable for DEM data of different resolutions and terrain types.
[0108] Example 4 Figure 7A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. Figure 7 As shown, the electronic device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used for communication with external devices via a network connection. When executed by the processor, the computer program implements the functions or steps of the automatic extraction method for the segmented minimum cost path main ridgeline based on topological saliency constraints.
[0109] In one embodiment, the electronic device provided in this application includes a memory and a processor. The memory stores a database and a computer program that can run on the processor. When the processor executes the computer program, it implements the steps of the aforementioned method for automatically extracting the main ridgeline of the segmented minimum cost path based on topological salience constraints.
[0110] The above is as stated in this application. Figure 2 The method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological saliency constraints, as disclosed in the illustrated embodiment, can be applied to a processor or implemented by a processor. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be completed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory. The processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above-mentioned automatic extraction method of the segmented minimum cost path main ridge line based on topological salience constraints.
[0111] In one embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the aforementioned method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological salience constraints.
[0112] It should be noted that the functions or steps that the above-mentioned electronic devices or computer-readable storage media can achieve can be referred to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0113] 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. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0114] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.
[0115] The above-described embodiments are only used to illustrate the technical application 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 applications 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 applications to deviate from the spirit and scope of the technical applications of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An automatic extraction method for the main ridgeline of a segmented minimum cost path based on topological salience constraints, characterized in that, The method includes: Step S110: Obtain the raster data of the digital elevation model (DEM) of the study area, identify and mark invalid and valid pixels, and set the identified invalid pixels as impassable areas; Step S120: Sort all valid pixels in descending order of elevation and traverse them pixel by pixel. Use eight-neighborhood search to find the connected components of the surrounding processed pixels of each pixel to be processed. Based on the number of connected components in the neighborhood, automatically identify peak points and saddle points, simultaneously create or merge connected components and record the coordinate elevation information of peaks and saddles, and establish peak-saddle branches between peaks and corresponding saddles. Step S130: Based on the identified peak points, saddle points, and peak-saddle branches, construct a peak-saddle topology tree based on elevation descending connectivity. Step S140: Determine the topological salience of each peak-saddle branch, and based on the peak-saddle topology tree and the topological salience of each peak-saddle branch, automatically determine a sequence of several main control points for the main ridge line. Step S150: Construct an elevation inverse cost surface based on effective pixels, and perform minimum cost path retrieval on each group of adjacent nodes of the main control point to obtain multiple segmented paths; Step S160: Piece together all segmented paths to obtain the complete main ridgeline and output it as a vector.
2. The method for automatic extraction of main ridge lines of segmented minimum cost paths based on topological salience constraints according to claim 1, characterized in that, In step S120, for the current cell, the eight-neighborhood is used to determine the cell connectivity. If there are no processed valid cells in the neighborhood of the current cell, the current cell is determined to be a peak point and a new connected component is created. If there are processed pixels in the neighborhood of the current pixel that belong to multiple connected components, then the current pixel is determined to be a saddle point. Peak-saddle branches are established for each mountain peak connected to the saddle point, and all associated connected components are merged.
3. The method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological salience constraints according to claim 2, characterized in that, When merging all associated connected components, the connected component with the highest main peak elevation is retained first; if the elevations are the same, the connected component with more pixels is selected for retention.
4. The method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological salience constraints according to claim 1, characterized in that, The formula for calculating the topological significance of the peak-saddle branch is: ; In the formula, Set the elevation of the mountain peak. The elevation of the corresponding saddle point; If the difference calculated for a peak-saddle branch is negative, then the topological significance R of that peak-saddle branch is corrected to 0.
5. The method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological salience constraints according to claim 1, characterized in that, In step S140, the peak-saddle topology tree is transformed into a weighted undirected graph with topological salience as the edge weight, and the Dijkstra algorithm is used twice to filter the backbone control point sequence, with both ends of the sequence being mountain peaks. If there are multiple sets of unconnected mountain zones within the study area, calculate the cumulative weight of the paths in each zone, and select the node sequence corresponding to the maximum weight as the final trunk control point sequence.
6. The method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological salience constraints according to claim 1, characterized in that, In step S150, the formula for calculating the passage cost of the elevation reverse cost surface is: ; in, Let be the maximum elevation of all valid pixels in the entire region, and 'a' be a positive offset constant. Invalid pixels are assigned an infinite cost.
7. The method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological salience constraints according to claim 1, characterized in that, In step S150, the eight-neighbor Dijkstra algorithm or A algorithm is used between adjacent control points. The algorithm performs minimum cost path retrieval; When using the eight-neighbor Dijkstra algorithm to perform minimum cost path retrieval, each valid cell is treated as a graph node, and adjacent valid cells are treated as graph edges; the edge cost between adjacent cells p and q is preferably calculated using the following formula: E(p,q) = D(p,q) × [cost(p) + cost(q)] / 2; Where D(p,q) is the spatial distance between two pixels.
8. The method for automatically extracting the main ridgeline of a segmented minimum cost path based on topological salience constraints according to claim 1, characterized in that, In step S160, the paths of each segment are spliced in the order of the main control points, and duplicate control point pixels shared by adjacent segments are deleted during splicing. The vectorized output includes: the complete main ridgeline in Shapefile format, as well as the following intermediate vector results: peak points, saddle points, main control points, and segmented paths.
9. An automatic ridgeline extraction system for segmented minimum cost paths based on topological salience constraints, characterized in that, The system includes: The acquisition unit is used to acquire the raster data of the digital elevation model (DEM) of the study area, identify and mark invalid and valid pixels, and set the identified invalid pixels as impassable areas. The peak-saddle identification unit sorts all effective pixels in descending order of elevation and then traverses them pixel by pixel. It uses eight-neighborhood search to find the connected components of the surrounding processed pixels of each pixel to be processed. Based on the number of connected components in the neighborhood, it automatically identifies peak points and saddle points, simultaneously creates or merges connected components, records the coordinate elevation information of peaks and saddles, and establishes peak-saddle branches between peaks and corresponding saddles. Topology building unit, used to construct a peak-saddle topology tree based on elevation descending connectivity, according to the identified peak points, saddle points, and peak-saddle branches; The control point determination unit is used to determine the topological salience of each peak-saddle branch, and based on the peak-saddle topology tree and the topological salience of each peak-saddle branch, automatically determine a sequence of several main control points for the main ridge line. The segmented retrieval unit is used to construct an elevation inverse cost surface based on effective pixels and perform minimum cost path retrieval on each group of adjacent nodes of the main control point to obtain multiple segmented paths. The output unit is used to stitch together all segmented paths to obtain the complete main ridgeline and then output it in vector form.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the automatic extraction method for segmented minimum cost path main ridgeline based on topological salience constraints as described in any one of claims 1 to 8.