A method for extracting ridge lines and valley lines based on DBSCAN cluster analysis
The DBSCAN cluster analysis method is used to process terrain data, which solves the problems of automation and accuracy of terrain feature extraction in the existing technology, realizes the efficient extraction of ridge lines and valley lines, provides a new approach to terrain data mining, and improves the efficiency of terrain feature extraction. improve the efficiency and accuracy of terrain feature extraction.
Patent Information
- Application Number
- CN202111093275.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-09-17
AI Technical Summary
Existing terrain feature extraction methods have shortcomings in automation and accuracy. Especially in the extraction process of ridge lines and valley lines, it is difficult to achieve efficient and accurate automated processing.
Use the DBSCAN cluster analysis method to cluster terrain data, segment the terrain data and extract features by selecting appropriate parameters (such as Minpts and EPS), identify ridge points and valley points, and construct ridge lines through the topological relationships of sub-regions and valley lines.
It realizes the automatic extraction of terrain features, significantly improves work efficiency and accuracy, can effectively identify ridge lines and valley lines in the terrain, and provides a new data mining method to support the application of geographic information systems.
Smart Images

Figure CN113807437B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of terrain feature extraction, combines a geographic information system with a data mining technology, and realizes the extraction of ridge lines and valley lines through a DBSCAN cluster analysis method, and specifically relates to a ridge line and valley line extraction method based on DBSCAN cluster analysis. Background Art
[0002] Terrain feature extraction is an important research topic in geography. Most of the terrain feature extraction by scholars is the extraction of feature lines or feature points. Feature points include ridge points, valley points, peak points, etc. Feature lines include ridge lines, valley lines, slope edge lines, slope line lines, etc. The terrain feature point extraction methods based on DEM regular grid data can be divided into four categories:
[0003] 1. Image processing based methods
[0004] The DEM of the regular grid is used as a raster image. Since the RGB color of the image is complex, it can be grayed out. The gray value of the image represents the DEM value of the raster. The pixel size is the size of the raster grid. Each grid in each DEM data on the regular grid corresponds to each pixel in the image. When solving problems related to digital elevation models, you can use image processing-based methods to convert DEM into images. If you assume that the larger the elevation value of the grid point, the brighter the gray value, then the top of the mountain in the image will be brighter than other positions. If it is a ridge line, then the gray value along a certain line should be higher than the gray value on both sides; the valley line is the opposite. Since the valley line is lower than the two sides, the color on the valley line is darker than the two sides.
[0005] 2. Methods based on terrain surface geometry analysis
[0006] 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. The potential terrain feature points are related to the local extreme points on their terrain cross-sections. The maximum points are considered to be the watershed points of the terrain, and the minimum points are considered to be the watershed points of the terrain. Finally, the extracted feature points are connected to form characteristic lines.
[0007] 3. Water flow analysis algorithm based on terrain surface
[0008] The basic idea of this method is that water always follows the natural law of flowing from high to low. The water volume of each grid point in the DEM data is calculated in sequence. If the water volume of the grid point in the grid is greater than the given threshold, it is considered to be a water point. According to a certain rule, these water points are connected in sequence to obtain the watershed line. Find each watershed line in the area from high to low; according to the obtained watershed line, find the boundary line of each watershed area through calculation, and get the watershed line. The watershed line is considered to be the ridge line, and the watershed line is the valley line.
[0009] 4. Combining ensemble morphology analysis with surface flow simulation
[0010] The idea of this method is to first use relatively sparse DEM grid data to extract the approximate terrain characteristic lines in the area according to the surface water simulation method; then perform geometric morphological analysis on the terrain in the surrounding adjacent areas to accurately determine the terrain characteristic lines.
[0011] As an important data mining method, cluster analysis technology has important application value in various fields. The extraction of terrain features through clustering method will create a new way. Summary of the invention
[0012] In view of the above problems, the present invention proposes a ridgeline and valleyline extraction method based on DBSCAN cluster analysis. The terrain data is first rasterized and converted into text data that can be read by the algorithm, and then two parameters of the DBSCAN algorithm are selected through a certain strategy for cluster analysis, and finally the terrain characteristics are further studied based on the clustering results.
[0013] The present invention provides a ridge line and valley line extraction method based on DBSCAN cluster analysis, and the specific steps are as follows:
[0014] Step 1: Terrain data preparation. Obtain terrain DEM data and convert raster data into text format through a series of software processing to be read by the algorithm;
[0015] Step 2: Cluster analysis of terrain data: using clustering algorithm to divide the viewshed into multiple separate sub-areas SVi (i=1, 2, ···, k), where k is the number of divided sub-areas;
[0016] 2-1: The terrain clustering division using the DBSCAN clustering algorithm is mainly based on the distance between terrain units. The specific steps are as follows:
[0017] 1) Similarity calculation based on Euclidean distance, assuming that any two points P i , P j The distance formula between Where P i The coordinates of (X i, Y i , Z i ), Xi and Yi represent longitude and latitude, Z i Indicates the elevation value of the location. j The coordinates of (X j , Y j , Z j ),X j , Y j Indicates longitude and latitude, Z j Indicates the elevation value of the location.
[0018] 2) When d≤ε (ε is the set threshold), and P i For sub-region V i The class in P j Not in sub-region V i Class in V i =V i ∪{P j}.
[0019] 2-2: Parameter selection. The DBSCAN clustering algorithm requires the input of two parameters: the minimum number of sample points (expressed by Minpts) and the neighborhood radius (expressed by EPS). For the parameter selection of the DBSCAN algorithm, there are the following steps:
[0020] 1) According to the terrain accuracy, the initial value of EPS is dynamically selected. At the same time, the initial value is also the lower limit of EPS, which is MinEPS. If the terrain resolution is R×R, the initial value of EPS is R meters, that is, MinEPS=R. When selecting the Minpts parameter, if you choose to start from 1, even if the distance between each point in the data and its adjacent points exceeds EPS, it can form a cluster, which is meaningless. Therefore, consider the initial value of Minpts to choose 2.
[0021] 2) Change the EPS value gradually to determine the upper and lower limits of the neighborhood radius. The EPS parameter is used to determine whether a grid is called a cluster threshold, which is essentially a measure of the smoothness between adjacent grids. When adjacent grids can be clustered together to form a cluster, it means that they should be relatively smooth, that is, the slope between the grids is not very steep. Generally, the slope does not exceed 45°. With a maximum slope of 45°, the center distance between two adjacent grids can be calculated. Therefore, the maximum possible value of EPS is 2R.
[0022] Change the value of EPS and determine its range When the number of clusters no longer changes and the number of noise data is 0, the EPS value at this time is the upper limit MaxEPS, and the neighborhood radius value range is determined to be (MinEPS, MaxEPS).
[0023] 3) Determine the range of the neighborhood radius, change the value of Minpts gradually, and calculate the clustering results under different Minpts within a fixed range, as well as the changes in noise data.
[0024] 4) In the process of extracting terrain feature lines, useless data at the hillside should be excluded. The DBSCAN algorithm can be used to identify the points at the hillside as noise. The minimum number of sample points in the cluster needs to be set relatively large, and the neighborhood radius is relatively small to ensure that the points at the top of the mountain can be clustered into multiple clusters, while the points at the hillside are identified as noise data.
[0025] Step 3: Extraction of ridge points and valley points;
[0026] Center of sub-region: The center of a sub-region can be expressed as the average value of the topographic points in the sub-region. Sub-area A can be used i It is represented by the average value of each grid point P(X,Y,Z) in , and the calculation formula is as follows:
[0027]
[0028] Among them, X, Y are the ground coordinates of the grid point P, and Z is the elevation value of the grid point P; the calculated feature points are the ridge points and valley points in the terrain. The ridge points are the feature points of the ridge line and are located at high altitudes, and the valley points are the feature points of the valley line and are located at low altitudes.
[0029] Step 4: Extract feature lines and determine ridge lines and valley lines.
[0030] The proximity relationship between sub-regions can be represented by a complete sub-region graph, where nodes are sub-regions, edges between nodes represent proximity relationships between sub-regions, edge weights are represented by the distances between sub-regions, and central points are connected to construct a spatial topological graph between sub-regions.
[0031] Calculate the minimum distance between each sub-region and find the adjacent sub-regions. In order to effectively characterize the neighboring relationship of sub-regions, the complete graph can be pruned. When the weight of the edge in the complete graph is greater than the given threshold, the edge is deleted. After pruning, the sub-region complete graph is converted into a road, that is, a non-complete graph with a node degree of 2 except for the starting and ending points with a degree of 1, also known as a simulation line. After pruning, the sub-region complete graph is converted into an incomplete graph.
[0032] The incomplete map represents the ridge lines and valley lines of the terrain, and the average value of the elevation of the grid on each simulated line is calculated. The average value can represent the average elevation of the simulated line. If the elevation of each simulated line is distributed alternately, it is a ridge line or a valley line.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention proposes a ridgeline and valleyline extraction method based on DBSCAN cluster analysis. First, the DEM grid unit of the target area is obtained, and the terrain itself is clustered using the DBSCAN algorithm. After selecting two parameters of the DBSCAN algorithm according to a certain strategy, the raster data in text format is clustered using the algorithm. Automatically extracting terrain features through computer methods is a rare feature extraction method in terrain feature extraction. It realizes the automatic extraction of terrain features and greatly improves work efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is an example map of terrain in an application embodiment of the present invention.
[0036] Figure 2 It is a distribution diagram of DBSCAN clustering noise data when minPts=2 in an application embodiment of the present invention.
[0037] Figure 3 This is a graph showing the variation of the number of noise data with the neighborhood when Minpts is 6 in an application embodiment of the present invention.
[0038] Figure 4 It is a clustering effect diagram when the DBSCAN parameter is selected as (35,5) in the application embodiment of the present invention.
[0039] Figure 5 It is a clustering effect diagram when the DBSCAN parameter is selected as (34,5) in the application embodiment of the present invention.
[0040] Figure 6 It is a clustering effect diagram when the DBSCAN parameter is selected as (33,5) in the application embodiment of the present invention.
[0041] Figure 7 It is a clustering effect diagram when the DBSCAN parameter is selected as (32,5) in the application embodiment of the present invention.
[0042] Figure 8 It is a clustering effect diagram when the DBSCAN parameter is selected as (32,4) in the application embodiment of the present invention.
[0043] Fig. 9 It is a clustering effect diagram when the DBSCAN parameters are selected as (31,4) in the application embodiment of the present invention.
[0044] Fig.10 It is a clustering effect diagram when the DBSCAN parameter is selected as (31,5) in the application embodiment of the present invention.
[0045] Fig.11It is a distribution diagram of all sub-areas after DBSCAN clustering in an application embodiment of the present invention.
[0046] Fig.12 It is a distribution diagram of DBSCAN clustering sub-regions in an application embodiment of the present invention.
[0047] Fig.13 It is a connection diagram of the center points of the DBSCAN clustering sub-regions in the application embodiment of the present invention.
[0048] Fig.14 It is a mapping diagram of terrain feature lines extracted by DBSCAN clustering on the terrain in the application embodiment of the present invention, wherein (a) is a two-dimensional mapping diagram and (b) is a three-dimensional mapping diagram. DETAILED DESCRIPTION
[0049] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0050] The present invention relates to a ridge line and valley line extraction method based on DBSCAN cluster analysis. In practical application, the following steps A to D are performed.
[0051] Step A. For the area under study, it is necessary to prepare the corresponding terrain data and convert the data into a format readable by the algorithm, and then proceed to step B.
[0052] In actual application, step A specifically includes the following steps A1 and A2.
[0053] Step A1. Use ArcGIS software to load terrain data. The terrain elevation range is 243.349 meters to 905.813 meters ( Figure 1 );
[0054] Step A2. Use the raster export function in ArcGIS software to export the terrain data into text format;
[0055] Step B. Clustering the geographic data in text format, selecting two parameters of the DBSCAN algorithm according to a certain strategy, and then proceeding to step C;
[0056] In practical applications, step B specifically includes the following steps B1 to B5:
[0057] Step B1: The resolution of the grid data is 30*30, that is, the distance between each two adjacent grids is 30 meters. When selecting the EPS parameter, consider starting from 30 meters. When selecting the MinPts parameter, determine that the minimum sample point starts from 2.
[0058] Step B2: Set the maximum slope between neighborhood grids to 45°, then the neighborhood radius EPS is in the range [30,42]. The neighborhood radius EPS starts at 30 meters and increases by 1. The sample point MinPts is 2 ( Figure 2 ), call the DBSCAN algorithm to perform cluster analysis until a cluster is formed. The EPS value at this time is the upper limit. In this example, the upper limit of the neighborhood is determined to be 35 meters and the lower limit is 30 meters.
[0059] Step B3: Calculate the clustering results under different minimum sample points. When choosing the value of MinPts, a relatively large value should be selected to ensure that the non-feature lines in the hillside area are excluded. When MinPts = 6, the number of noise data is constant with the neighborhood and is equal to the total number of data ( Figure 3 ), at this time, the change of the cluster is no longer affected by the neighborhood. When MinPts = 5, the noise data is still changing, and finally it is determined that MinPts = 5 is the most appropriate minimum number of sample points.
[0060] Step B4: In the process of extracting terrain feature lines, useless data at the hillside should be excluded. The DBSCAN algorithm is used to identify the points at the hillside as noise. The minimum number of sample points in the cluster needs to be set relatively large, and the neighborhood radius is relatively small, to ensure that the points at the top of the mountain can be clustered into multiple clusters, while the points at the hillside are identified as noise data. With the minimum number of sample points as 5, different neighborhood values are selected, and combined with the sub-area distribution of the clustering results, the neighborhood radius is determined to be 31 meters. Figures 4 to 9 The clustering diagrams are shown when the neighborhood radius is 32, 33, 34, and 35. At the same time, the results when the minimum number of sample points is 4 and the neighborhood radius is 31 or 32 are not as good as when (31,5). When the minimum number of sample points is 4, the clustering effect when the neighborhood radius is 33 or 34 is only worse than when it is 31 or 32.
[0061] In summary, we select parameters eps = 31 meters, MinPts = 5, and perform DBSCAN clustering on the entire terrain to obtain the sub-area division results as follows: Fig.10 As shown, the center point of each sub-region is Fig.12 shown.
[0062] Step C. List the clustered classes separately ( Fig.11 ), calculate the minimum distance between sub-areas, connect the center points of the sub-areas, and construct the spatial topological structure between the sub-areas. As shown in Table 1, 6 simulated lines are formed, and several points are randomly selected on the 6 lines to calculate their average values, and the average value can represent the average elevation of the simulated line. If the elevation size is alternately distributed, it is a ridge line or a valley line. If three consecutive lines are increasing or decreasing, the middle line is at a hillside position, and points with similar elevations along the hillside are clustered together.
[0063] Table 1 Feature point elevation
[0064]
[0065] Step D. Load the clustering result distribution map into ArcGIS. The result distribution is as follows: Fig.13 As shown, lines 1, 2, 3, 4, and 6 are ridge lines or valley lines, line 5 is on the hillside, and the two adjacent lines are increasing or decreasing. The corresponding two-dimensional and three-dimensional mappings of terrain feature lines on the terrain are shown in Fig.14 shown.
[0066] The above technical solution involves a terrain feature extraction method based on DBSCAN cluster analysis, which performs DBSCAN cluster analysis on the entire terrain, analyzes the relationship between the divided sub-areas, and extracts characteristic lines, characteristic points, etc. The method extracts terrain features through the DBSCAN clustering method, which can automate the extraction of terrain features.
[0067] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A ridgeline and valleyline extraction method based on DBSCAN cluster analysis, characterized in that: The specific steps are as follows: Step 1: Obtain terrain data; obtain the DEM data of the terrain and convert the raster data into text format for reading; Step 2: Calculate the similarity between terrain grid points; Calculate the similarity based on Euclidean distance, and calculate the center points P of any two terrain grids in combination with the three-dimensional terrain i and P j The distance between Step 3: Terrain sub-region division: Use the DBSCAN algorithm to divide the sub-regions, determine the two parameters of the neighborhood radius EPS and the minimum sample point MinPts, and use the clustering algorithm to divide the view into multiple separate sub-regions SVi (i=1,2,···,k), where k is the number of divided sub-regions; Step 4: Extract ridge points and valley points; according to the determined neighborhood radius EPS and minimum sample point MinPts, use the DBSCAN clustering algorithm to obtain the final cluster as the divided sub-region; Step 5: Determine the ridge line and valley line; the proximity relationship between sub-regions is represented by a sub-region complete graph, where nodes are sub-regions, edges between nodes represent the proximity relationship between sub-regions, and the weight of the edge is represented by the distance between sub-regions. The minimum distance between each sub-region is calculated to find adjacent sub-regions. The center points of adjacent sub-regions are connected to form a connection relationship graph. In the step 5 of determining the ridge line and the valley line, it is necessary to use a graph analysis method to determine the ridge line and the valley line. The specific steps are as follows: Step 5-1: Cluster the sub-region A i Calculate its center; the center of the sub-region Use sub-area A i It is represented by the average value of each grid point P(X,Y,Z) in , and the calculation formula is as follows: Among them, X, Y are the ground coordinates of the grid point P, and Z is the elevation value of the grid point P; the calculated feature points are the ridge points and valley points in the terrain. The feature points on the ridge line are the ridge points, and the feature points on the valley line are the ridge points; Step 5-2: Construct sub-region topological relationships; connect the center points and construct a spatial topological map between sub-regions; Step 5-3: Graph pruning: In order to effectively characterize the neighboring relationship of sub-regions, the complete graph is pruned. When the weight of an edge in the complete graph is greater than a given threshold, the edge is deleted. After pruning, the complete graph of the sub-region is converted into a path, that is, a non-complete graph with a node degree of 2 except for the starting and end points, which is also called a simulation line. Step 5-4: Determine the ridge line and valley line; calculate the average value of the elevation of the grid on each simulation line, and the average value represents the average elevation of the simulation line. If the elevation of each simulation line is distributed alternately, it is a ridge line or a valley line.
2. The method for extracting ridge lines and valley lines based on DBSCAN cluster analysis according to claim 1, characterized in that: In step 2, any two topographic grid center points P i and P j The distance between them is obtained by formula (1): Where P i The coordinates of (X i , Y i , Z i ), X i Indicates longitude, Y i Indicates latitude, Z i Indicates the elevation value of the point; P j The coordinates of (X j , Y j , Z j ), X j Indicates longitude, Y j Indicates latitude, Z j represents the elevation value of the point, and d represents P i and P j The distance between.
3. The method for extracting ridge lines and valley lines based on DBSCAN cluster analysis according to claim 1, characterized in that: In the step 3, when the DBSCAN algorithm is used to divide the sub-regions, two parameters of the algorithm cluster analysis need to be determined, namely, the neighborhood radius EPS and the minimum sample point MinPts. The determination steps are as follows: Step 3-1: According to the terrain resolution R×R, dynamically determine the initial value of EPS, which is also the lower limit of EPS and is set as minEPS; according to the terrain accuracy R, determine the initial value of EPS to be R, that is, minEPS=R; MinPts parameter determines the minimum number of neighborhood sample points to form a cluster, and the initial value of MinPts is determined to be 2; Step 3-2: The maximum slope between adjacent terrain grids is 45°, so the search range of EPS calculated based on terrain resolution is The neighborhood radius EPS starts from R and increases by 1 successively. The sample point MinPts is 2. The DBSCAN algorithm is called for clustering analysis until a cluster is formed. The EPS value at this time is the upper limit, recorded as maxEPS. The neighborhood radius value range is (minEPS, maxEPS); Step 3-3: Determine the parameter MinPts; after determining the range of neighborhood radius, the minimum number of samples MinPts starts from 2, and increases by 1 each time, and the value of MinPts is changed successively, and the DBSCAN algorithm is used for clustering analysis; calculate the clustering results under different MinPts within the neighborhood radius, as well as the changes in noise data; when selecting the value of MinPts, a relatively large one should be selected to ensure that non-feature lines in the hillside area are excluded; when MinPts = P, the number of noise data is unchanged with the neighborhood and is equal to the total number of data, that is, all are noise points. At this time, the change of the cluster is no longer affected by the neighborhood; but when MinPts = P-1, the noise data changes, then it is determined that MinPts = P-1 is the most appropriate minimum number of sample points, and the EPS value at this time is the final neighborhood radius.
