A new slope unit extraction method based on improved marked watershed

. As the basic geomorphologic unit for the occurrence of geological hazards, slope unit is widely used in the prevention and evaluation of landslide-based geological hazards. Its extraction is the primary target and important foundation for the risk assessment of landslide hazards. A new slope unit extraction method based on improved marked watershed is proposed in this paper. Firstly, the DEM image is segmented by marker-based watershed to extract mountain objects. Then the positive and negative terrain of the mountain objects are segmented by watershed to extract ridge lines and valley lines. Finally, these lines are superimposed to extract the slope unit. The experimental results show that slope unit can be extracted by this method. Compared with the traditional GIS methods, horizontal planes and inclined planes can be segmented correctly, and the problem of parallel boundaries caused by filling of depressions can be effectively avoided through this method.


Introduction
Slope unit is the basic geomorphologic unit for the occurrence of geological hazards, which is divided by ridge lines and valley lines. Due to its good reflection of the actual development of landslides in study areas, slope unit plays an increasingly important role in the evaluation of geological hazards with the deepening of research on the risk assessment of geological hazards [1], and its extraction is the primary target and important foundation for the risk assessment of landslide hazards in large-scale regions [2]. The DEM (Digital Elevation Model) data, which is the basic data for digital terrain analysis, contains abundant topographic and geomorphological information to extract slope units. DEM is a sampling sequence of elevation values of terrain surface, which can be expressed by three-dimensional vectors or by general functions as the equation Vi=(Xi,Yi,Zi), where Xi,Yi are plane coordinates, and Zi corresponds to the elevation of the point (Xi,Yi) [3].
At present, the methods of extracting slope units are widely used in hydrological analysis module based on GIS (Geographic Information System) software platform. According to the intersection of ridge lines and valley lines, the terrain surface is divided into several slope units [4][5][6]. Based on this, some improved methods are proposed, including the improved method based on considering the effects of factors of grid resolution and catchment area threshold [7], the improved method based on superimposing curvature and inversion curvature [1], the improved method based on average curvature [8], and so on.
Although the GIS methods mentioned above are widely used, there are still two shortcomings as follows: first of all, these methods are prone to parallel boundaries due to the effect of filling of depressions [9]; besides, these methods cannot effectively distinguish horizontal planes from inclined planes when there are mountain basins or large wide valleys in the terrain [10]. Due to these facts, the slope units extracted by GIS methods often do not conform to the actual topography, making complicated manual revision work a must, which makes the extraction inefficient.
Therefore, this paper attempts to use image segmentation methods to extract slope units. Combined with the positive and negative terrain in GIS, watershed algorithm is used to segment terrain images, i.e. DEM images, to overcome the shortcomings of traditional GIS methods, which are prone to parallel boundaries and cannot effectively distinguish horizontal planes from inclined planes.

Principle of watershed algorithm
Watershed algorithm is a kind of image segmentation method based on topology theory and simulated geomorphology. Benefitting from its simple operation, fast computation, one-pixel width, and connected and closed contour, this method is widely used in the field of image segmentation [11]. One of the most popular watershed algorithms is to simulate the immersion process, regarding a gray image as a topographic feature in Geodesy [12]. The gray value of each point in the image corresponds to the elevation of the terrain surface. Each local minimum and its affected area is a catchment basin, and the boundary of the catchment basin forms a watershed, and that is the ridge line in the terrain.

Design of algorithm for extracting slope unit
According to the principle of watershed algorithm, each local minimum in the image to be segmented corresponds to a sub-region of segmentation result, and the number of sub-regions is determined by the number of local minima. In generation of DEM data, a large number of local minima will be produced during data acquisition or data interpolation, besides the ones corresponding to the real terrain, such as karst caves, lakes and depressions. These pseudo-minima will cause serious over-segmentation when watershed segmentation method being used [7]. At present, there are two main methods to solve the problem of over-segmentation: one is to preprocess the image before watershed segmentation to reduce the factors causing over-segmentation [13]; the other is to merge the results of watershed segmentation according to some criteria [14]. Generally, the criterion of region merging is difficult to find and the calculation is heavy [15], so this paper chooses to preprocess DEM images to solve the problem of over-segmentation.
Due to a large number of local minima and pseudominima in a DEM image, it is difficult to reduce the minima accurately through pretreatment to hold the balance between over-segmentation and undersegmentation [16]. Considering the large gradient value at the boundary of a DEM image, watershed segmentation for the gradient map of the DEM image can effectively avoid the influence of minima in the original image and extract the boundaries of mountains. After completing the first segmentation, each sub-region is a single mountain object or a single basin object in the terrain. It is necessary to segment these sub-regions again to extract slope units. For each sub-region, its number of minima is greatly reduced compared with the original image, and the pretreatment is not affected by the minima of other sub-regions. Therefore, each sub-region can be directly segmented by watershed to extract ridge lines. Based on the positive and negative terrain of GIS methods, valley lines can be extracted by segmenting the negative terrain of each sub-region, which is obtained through reversing the DEM image of each sub-region. With the ridge lines and valley lines, the slope units can eventually be extracted.
In summary, according to the features of DEM images, marker-based watershed algorithm is used to solve the problem of over-segmentation in this paper, so as to extract the boundaries of mountains and obtain mountain objects, and then combined with the idea of the positive and negative terrain in GIS, the positive and negative terrain of mountain objects are segmented to extract ridge lines and valley lines respectively, and finally these lines are superimposed to obtain slope units.

Implementation of algorithm
A slope unit extraction method based on improved marked watershed is designed in this paper. The algorithm flow chart is shown in Figure 1, and the specific implementation steps are as follows.

Marker-based watershed segmentation
Considering that the direct use of watershed segmentation will cause serious over-segmentation, it is necessary to preprocess the original DEM images. The marker-based watershed algorithm is a kind of improved watershed algorithm based on preprocessing, which can effectively solve this problem. In this paper, morphological openand-close reconstruction, gradient operation and frontand-back markers are performed on DEM images. Finally, the marked gradient images are segmented by watershed to extract mountain objects.

Morphological open-and-close reconstruction operation
Given that mathematical morphology is pretty effective in localization, high segmentation precision and good anti-noise performance, it will effectively reduce the minima to reduce over-segmentation if combined with the mathematical morphology [17]. In this paper, a mixed morphological open-and-close reconstruction operation (Eq.1, Eq.2) is applied to the original DEM image I to get the reconstructed image M, thus eliminating the light and dark details and the noise simultaneously.
where, se represents structuring element, the symbols ~, Θ and ⨁ represent complement operation, erosion operation and dilation operation respectively, and the function imreconstruct (A,B) indicates that A is expanded and reconstructed by B. In this paper, the structuring element se takes the shape of disk with a radius of 3.

Gradient operation
For the DEM images, the gradient values at the boundaries of mountains are larger than those of other parts of mountains. Therefore, the gradient image instead of the original DEM image for watershed segmentation can be used to extract the boundaries of mountains and effectively distinguish horizontal planes from inclined planes. The Sobel operator is a commonly used gradient operation, which can calculate the gradient approximate value of the luminance function of the image, and it can reduce the edge blur as the influence of pixel position is weighted [18]. In this paper, the Sobel operator is used to calculate the gradient value of the original DEM image I and get the gradient image G (Eq.3). where,

Front-and-back markers
If the gradient image G is segmented directly by watershed, the result will still be over-segmented. Accordingly, the DEM gradient image G is marked by marking the foreground and background, thus only the marked positions appearing the minima, to achieve better segmentation results. In this paper, the foreground markers fgm are obtained by searching for local maxima of the reconstructed image M in 3.1.1. The image M is binarized by an automatic threshold, and after binarization, a distance transform is required. And then watershed segmentation based on above result should be done. The boundaries of watershed are the background markers bgm. In order to shield the irrelevant minima, the markers fgm and bgm are used to modify the gradient image G (Eq.4), to obtain the modified gradient image Gmark.

Watershed segmentation
The modified gradient image Gmark is segmented by watershed segmentation (Eq.5), and one-pixel wide and closed split lines Edge1 are obtained, which are the boundaries of mountains in the terrain. With the boundary of each mountain, the DEM image S of each separated mountain object can be obtained. It is noteworthy that the principle of watershed algorithm shows that the watershed is a ridge line in the terrain, but here for DEM images, the split line Edge1 corresponds to the contour line of each object in images, that is, the boundary of the mountain.

Watershed segmentation combined with the positive and negative terrain
After completing the first segmentation of the DEM image, namely, the marker-based watershed segmentation, each sub-region of the image is a separate mountain object or a separate basin object, not the slope unit. For each sub-region, the pseudo-minima have been greatly reduced compared with the original image.

Experimental results and analysis
In this paper, the software MATLAB R2017a is used to verify following three aspects: the necessity of markers, the validity and adaptability of the algorithm and the superiority of the algorithm. According to these three aspects, this paper correspondingly carries out the comparative experiment of watershed segmentation with or without marker, the comparative experiment with DEM data in different sample areas and the comparative experiment with different segmentation methods. The experimental results and analysis are as follows.

Comparative experiment with or without marker
In order to verify the necessity of markers, this paper carries out a comparative experiment of watershed segmentation with or without marker. The DEM data of 1:10000 scale and 5-meter resolution in a mountain area is selected as the test data. Figure 2 (a) is a DEM image to be segmented. Figure 2 (b) is the result of watershed segmentation without marker. Figure 2 (c) is the result of watershed segmentation with markers after 3.1 marking.
The experimental results show that the segmentation result without marker appears serious over-segmentation, such as the region shown in the red box, the extracted mountain objects and basin objects are incomplete, and the locations are inaccurate; while the segmentation result with markers can effectively avoid over-segmentation, and the mountain objects and basin objects can be correctly segmented by introducing gradient images, such as the region shown in the red box, the extracted mountain objects and basin objects are relatively complete, and the locations are basically accurate.
(a) DEM image (b) without marker (c) with markers

Comparative experiment with DEM data in different sample areas
In order to verify the validity and adaptability of the algorithm, this paper carries out a comparative experiment with DEM data in different sample areas.

Comparison experiments with different segmentation methods
In order to verify the superiority of the algorithm, this paper carries out a comparative experiment with different segmentation methods. The slope units of the DEM image shown in Figure 3 (a1) are extracted by traditional method and our method respectively. Based on the hydrological analysis tool of ArcGIS software, the slope units are extracted by dividing the sub-basin boundaries of the positive and negative terrain of the depression-free area. The flow threshold of positive terrain is 800 and that of negative terrain is 500, and the result is shown in Figure 4 (a). The experimental result of our method is shown in Figure 4 (b). As shown in Figure 4 (a), many parallel boundaries have appeared in the slope units extracted by the traditional GIS method, and the mountain objects and basin objects have been obviously mis-segmented. Due to these facts, the slope units extracted by the GIS method usually need complicated manual revision work. As shown in Figure 4 (b), our method can effectively avoid the parallel boundaries caused by the filling of depressions, and distinguish horizontal planes from inclined planes, thus correctly segmenting mountain objects and basin objects. Compared with the traditional GIS method, our method overcomes the shortcomings of the traditional method, and the slope units extracted by our method are closer to the real terrain.

Conclusions
In this paper, a slope unit extraction method based on improved marked watershed is proposed. First, the original DEM image is segmented to obtain mountain objects by marker-based watershed algorithm. Then each mountain object is segmented to extract the slope units by watershed combined with positive and negative terrain.
The experimental results show that our method can extract slope units, and it has pretty validity and adaptability for DEM data with different types of landforms and different resolution. The boundaries of the extracted results are clear and the locations are accurate, which are in line with the real terrain. Besides, our method overcomes the shortcomings of traditional GIS methods, which are prone to parallel boundaries, and cannot effectively distinguish horizontal planes and inclined planes, thus avoiding complicated manual revision work in the later period and greatly improving the efficiency of extraction. Because the selection of gradient operators and the shape and size of morphological structuring elements are difficult in quantitative analysis, it is lack of quantitative calculation and analysis to select these parameters during the experiments. Considering the influence of these parameters on the segmentation result, our next step is to establish a more complete method for quantitative extraction of slope units.