Characterizing slope regions

This paper provides a theoretical characterization of monotonically connected image surface regions, called slope regions. The characterization is given by several topological properties described in terms of critical points relative to the region. We formally prove the necessary and sufficient conditions that a region needs to satisfy to be a slope region. We also provide a prototype of slope regions which is general and contains, as particular cases, the prototypes studied and published in previous conference papers.

data. Level curves intersect exclusively at saddles. In terms of earth topography, the configuration of critical points connected by monotonic curves in the surface were discussed a long time ago in Cayley (1859), Maxwell (1870).
The monotonic curves delineate surface patches, called slope regions, with the property that every pair of points inside such a patch can be connected by a monotonic curve. This way, slope regions may be seen as filling the space between the critical sets of the surface (see . A planar triangle is a simple example of a slope region and any triangular mesh partitions the surface into a set of slope regions. The space between critical sets of the surface can always be partitioned into slope regions. The corresponding decomposition of the surface with minimal number of slope regions preserving critical sets is called a minimal slope complex. In general, this partition is not unique and allows certain task and data-specific adaptations but every element of such a partition satisfies the requirements of the general prototype of slope regions given in this paper. First, such general prototype allows to check if a region-based partition (e.g. an image segmentation) is a valid slope complex (i.e., a cell decomposition of the surface where each 2-cell is a slope region) as we will see later. Second, it opens the door to set the grounds to construct a "slope grammar" describing all possible combinations of valid slope regions.
Regarding related works, the concepts of integral lines and Morse-Smale (MS) complexes were previously defined in Edelsbrunner et al. (2003b), Edelsbrunner et al. (2003a) and Edelsbrunner and Harer (2009), with the intention to build a hierarchy of increasingly coarse MS complexes. In that case, the decomposition is made into regions of uniform flow using integral lines. Specifically, MS complexes are built using a real-valued smooth map over the surface, with non-degenerated critical points. We will see later that the concept of integral line has great similarity to the monotonic curves of our approach although monotonic curves are geometrically less constrained.
Many efficient algorithms can be found in the literature to compute consistent MS complexes. For example, in Gyulassy et al. (2014), the authors presented an efficient algorithm to compute consistent MS complexes using a divide-and-conquer strategy for dealing with large data. In Sorgente et al. (2018), the authors introduced a novel algorithm using discrete gradient flow paths to decompose a 3D object into an atlas of disk-like charts. In Comic et al. (2010), the authors computed maximal cells of the ascending and descending Morse complexes through a watershed approach. Nevertheless, since the computation of slope complexes is not the goal of the paper, we only introduce here a first step to it and the comparison of slope complexes and MS-like complexes is left as future work.
With respect to other closely related technique such as Reeb graphs and complexes, in Marzantowicz et al. (2015), the authors characterized the Reeb graphs for functions f on manifolds M with concrete properties. For example, if M has finite fundamental group, then the Reeb graph of f is a tree.
Critical sets can appear in many different configurations. A catalogue of different configurations of the critical points and slope districts was discussed in Lee (1984). The author also provided visualizations of the "slope districts" (a simpler version of slope regions) using Critical Point Configuration Graphs constructed using peaks (local maxima), dales (local minima) and passes (saddle points). In Rosin (1995), the authors described a technique for extracting the slope districts from smooth discrete images and produce a hierarchical description in terms of linked slope districts. Related conference publications published: In Kropatsch (2019a), given a 2D continuous surface, not necessarily being piecewise linear or smooth, we defined slope regions as simply connected components such that any two points in them are connected by a monotonic path, where the intersection between them are allowed. We introduced the concept of slope complexes which are particular cases of 2-dimensional (2D) CW-complexes in which each 2-cell is a slope region. From this start point, we proposed a prototype of slope regions with the constraint that their outer boundary is composed by exactly two monotonic curves. We explored how to create and reduce slope complexes, by describing a basic process to reduce the number of slope regions without affecting the bounding critical points, obtaining a simplified slope complex. The computation of slope complexes was made in  only in the case in which the height map is piecewise linear and slope regions are planar triangles obtained from a triangulation of a 2D continuous surface. In Cerman et al. (2016), we produced superpixel hierarchies (combinatorial graph pyramids) that are multiresolution segmentations of the given picture and where critical points are preserved along the pyramid. In , we approached the study of slope complexes from the point of view of the neighborhood graph of a digital picture. Its vertices can be interpolated to form a 2-manifold with critical points, where slopes and plateaus being the ones recognized by local binary patterns (LBPs). Neighborhood graph produces a cell decomposition of the manifold, where each 2-cell is a slope region. In Kropatsch (2019b), we showed that each level of the pyramid produces a slope complex. Slope complexes in different levels of the pyramid are always homeomorphic to disks. We also addressed the question whether there is a minimal number of slope regions that completely cover the 2.5D surface between a given set of critical points. We also provided a formula to count the minimum number of slope regions required to represent the surface, given the number of critical points. In Batavia et al. (2019b), we used the representation of a surface by a neighborhood (primal) graph and its dual, where the modifications in the primal graph are reflected in the dual. The vertices of such graphs are categorized into maximum, minimum, slope or saddle depending on the orientation of their incident edges. We introduced the orientation of the edges in the dual graph and showed that the LBP category of the dual vertex is consistent with the corresponding face in the primal graph, by providing an interpretation in the image context. Besides, we introduced a technique to orient monotonic paths with level curves in the primal graph and provided necessary and sufficient conditions for both primal and dual graph to merge two slope regions. In Batavia et al. (2019a), we introduced a second prototype with the aim of characterizing slope regions with the constraint that the outer boundary is a level curve. We provided necessary conditions for their existence and we showed that a well-composed 2D digital image can be partitioned into slope regions categorized into one of the two previously described prototypes. Finally, in Batavia et al. (2021), we proposed a Topology-preserving Irregular Image Pyramid (TIIP) algorithm including a hierarchical method to build an irregular image pyramid that preserves slopes regions. The algorithm operates on combinatorial maps which implicitly encode the structure of the image on the higher level of the pyramid with a compact representation. The use of combinatorial maps supports parallel pro- Fig. 1 Example of an image A and its reconstruction F using the TIIP algorithm introduced in Batavia et al. (2021). Observe that the reconstruction D of the original background B lost information while the original fine details C are preserved in E after the reconstruction cessing with time complexity of O(log(d)), where d is the diameter (in pixels) of the largest region after the simplification is made. With the TIIP algorithm, we were able to reconstruct images using as few as 30% of the color values and the information stored on top of the pyramid, although preserving fine details including the texture of the image. An example of an original and reconstructed image is showed in Fig. 1.
In this paper, necessary and sufficient conditions for a region to be slope are formally provided for the first time, obtaining a simple and complete characterization of slope regions and, as a consequence, a prototype for slope regions, which is general and complete. We also prove that prototypes described in previous papers are particular cases of our general prototype described here. Each result (Theorem, Lemma, Corollary) presented in this paper without a previous reference is original and new.
From the application point of view, Cerman et al. (2016) provided an algorithm where the neighborhood graphs were used to represent a digital image. By a sequence of edge contraction and edge removal operations, we reduced the graph and stack them to form an irregular graph pyramid. Later, irregular graph pyramids were used for multi-resolution image segmentation. Similar approaches were used in Wei et al. (2018) for multi-resolution image segmentation using a super pixel hierarchy. The characterization of slope regions presented in this paper opens a door to design robust algorithms to compute slope regions that could be used for image processing tasks such as geometric modeling, or filtering on segments with particular topological properties.
The paper is organized as follows. Section 2 is devoted to present the main definitions and basic tools that will be used throughout this paper. We also introduce the concept of monotonic curves, which will be the key point and reference of our work. Section 3 contains the theoretical results of the paper. We introduce the notion of slope regions, for which we use the concept of monotonic curves, and prove preliminary results which will lead us to obtain a complete characterization of the slope regions at the end of the section.
In Sect. 4, we approach the study of cell decomposition through the use of slope regions and prove that there is a natural way to move from a slope region to a 2-cell. Section 5 focuses on the general prototype of slope regions presented here for the first time, containing the prototypes published in previous conference papers as particular cases, with the aim of giving a combinatorial representation for such regions. Finally, Sect. 6 concludes the paper.

Preliminaries
Let us introduce several definitions based on a map h : R 2 → R with the only requirement of h being continuous but not necessarily smooth.
A curve π : Observe that a level curve is a particular case of monotonic curve. A level curve can also be part of a monotonic curve. Observe that all curves considered in this paper (including level curves) are connected.
Remark 1 A strictly monotonic curve, excluding level curves, is either increasing or decreasing. It is always bounded by a 1-max and a 1-min. This allows us to consider monotonic curves with a natural orientation. In our illustrations: an arrow from point a to point b represents a monotonic curve with endpoints a and b such that h(a) > h(b). When the curve is exactly a level curve, no arrow is pictured. See Fig. 2.
The set X is monotonically connected if it is connected and for any two different points p and q of X there exists a monotonic curve π : [0, 1] → X , with π(0) = p and π(1) = q. The topological interior of X , denoted as topint(X ), is defined as the largest open subset of X . The frontier of X , denoted as fr(X ), is defined as X \ topint(X ).
Observe that a plateau P c can be, for example, just a point in R 2 , a level curve or even the union of a set of level curves. A plateau may also contain holes.
Definition 4 (categories of plateaus) Let P c be a plateau.
A 2-extremum is either a 2-min or a 2-max. A 2-critical plateau is either a 2-extremum or a 2-saddle.
Let us recall that a homeomorphism is a bicontinuous bijective map. Now, let us introduce the concept of region.
Definition 5 (region) Let R be a subset of R 2 and let D be a disk. The subset R is a region if it can be obtained as the image of a continuous surjective map f : Observe that the same region R could be obtained using different continuous surjective maps f : D → R.
Definition 6 (boundary, outer boundary and interior of a region) Let R be a region obtained as the image of a continuous surjective map f : D → R. The set of points in im f | int(D) , denoted as int f (R), is called the interior of R. Similarly, the set of points in im f | ∂ D , denoted by ∂ f R, is called the boundary of R. See Fig. 3. The outer boundary of R is the image of a simple curve π : [0, 1] → ∂ f R, which divides the plane R 2 in two connected components, one, containing R, bounded by im π and one unbounded.  . 4 The boundary, the interior, the frontier, and the topological interior of a region R For the sake of simplicity, the interior and boundary of R will be denoted, respectively, as int(R) and ∂ R, when it is not considered relevant to explicitly mention the function f . Besides, as we will see later, folded curves are needed for connecting the holes to the outer boundary.

Definition 7 (plateau region) A region being a plateau is called a plateau region.
Remark 2 Let R be a region. Then, int(R) lies in topint(R) and fr(R) lies in ∂ R.
Besides, int(R) is homeomorphic to a disk whereas topint(R) does not need to be. Finally, ∂ R is necessarily connected, whereas fr(R) is not. See Fig. 4.
Definition 8 (categories of plateaus relative to a region) Let R be a region and P c ⊂ R a plateau then: Observe that an R-extremum that lies in the topological interior of R is, in fact, a 2-extremum. Conversely, a 2-extremum lying in the frontier of R is an R-extremum.

Slope regions
In this section we formally introduce the concept of slope region and study several preliminary results required to prove the necessary and sufficient conditions that any slope region needs to satisfy. As a main result, we provide and prove a complete and general characterization of slope regions.
Definition 9 (slope region) A slope region S is a monotonically connected region.
Notice that a plateau region is a trivial and particular case of slope regions, due to all points in the plateau region are connected by level curves, which are monotonic curves.

Necessary conditions of slope regions
Let us study properties that any slope region must satisfy.

Theorem 1 If S is a slope region then S does not contain any 2-saddle in its topological interior and it is either a plateau region or it is a region with maximally one R-max and one R-min.
Proof By definition of slope regions there exists a monotonic curve between any two points in S, which directly implies that S cannot contain 2-saddles in its topological interior. Since S is not a plateau and it is closed and bounded, then S contains, at least, one R-max and one R-min. Neither two R-maxima nor two R-minima can be connected by a monotonic curve in S, then S cannot contain neither two or more R-maxima, nor two or more R-minima.

Lemma 1 The boundary of a slope region S is always either a level curve or it contains exactly one 1-max and one 1-min.
Proof If for all p ∈ ∂ S we have that h( p) = c, for some c ∈ R, then the proof is complete. Otherwise, ∂ S is a continuous non-level curve. Then, it has at least one 1-max I and one 1-min J (recall that I and J could be closed intervals or just points). Let us prove that ∂ S has exactly one 1-max and one 1-min. By contradiction, suppose that ∂ S has, for instance, another 1-max, denoted by I . Consider two points p ∈ I and p ∈ I . Assume that h( p) ≤ h( p ).
Since S is a slope region then there exists a monotonic curve π : [0, 1] → S joining p and p . Now, since I is a 1-max, p ∈ I with h( p) ≤ h( p ) and π is monotonic then, necessarily, there exist s, s ∈ [0, 1] such that π(s), π(s ) ∈ ∂ S, h( p) ≤ h(π(s)) ≤ h(π(s )) ≤ h( p ) and π((s, s )) lies in int(S). Therefore, π | [s,s ] divides S in, at least, two disjoint sets S 1 and S 2 , and hence, ∂ S can be divided in two different continuous curves π 1 : [0, 1] → ∂ S and π 2 : [0, 1] → ∂ S, one lying in S 1 and the other lying in S 2 . Suppose that the 1-min J lies in π 1 . Then, there exists another one 1min J lying in π 2 since π 2 is a continuous curve. Consider q ∈ J and q ∈ J . Assume that h(q) ≤ h(q ). Then, there exists a monotonic curveπ : [0, 1] → S between q and q . By similar reasoning as before,π crosses the interior of S and, then, there exists a point r ∈ int(S) such that r ∈ im π ∩ imπ . For such point r , we have

Sufficient conditions of slope regions
Let us prove that sufficient conditions for a region R to be a slope region are: (a) R does not contain any 2-saddle in its topological interior, (b) R is either a plateau region or it contains one R-max and one R-min, and (c) ∂ R is either a level curve or it contains one 1-max and one 1-min.
From now on, let c be a value between the lowest and the highest h-values for the given continuous map h. Let L c = {p ∈ R such that h( p) = c}, being R a given region. The level set 1 L c could be non-connected, so it might not be a plateau.
Lemma 2 Let R be a region with no 2-saddle in its topological interior, and with, exactly, one R-max and one R-min. Let X = R \ L c . Then X = ∅ is composed by at most two connected components.
Proof First, R is not a plateau then X = ∅. LetX be the closure 2 of X . Then,X is a subset of R, since R is closed. Moreover, since R = X ∪ L c thenX \ X is a subset of L c . By contradiction, suppose that X is composed by more than two connected components, for instance, three connected components X 1 , X 2 and X 3 . LetX i be the closure of X i for i = 1, 2, 3. SinceX i \ X i is a subset of L c andX i L c , for i = 1, 2, 3, thenX i cannot be a plateau. An R-max (resp. R-min) relative to regionX i will be denoted byX i -max (resp.X i -min), for i = 1, 2, 3. Now, since eachX i is closed and bounded, then there is at least oneX i -min and oneX i -max, for i = 1, 2, 3. Without loss of generality, suppose that anX 1 -max coincides with the R-max. Then the rest of theX i -maxima cannot lie in X i , for any i = 1, 2, 3, since R only contains one R-max. Consequently, the rest of theX i -maxima lie inX i \ X i ⊆ L c , for i = 1, 2, 3. Similarly, the R-min can coincide with anX 1 -min, anX 2 -min or an X 3 -min. Without loss of generality, suppose that the R-min coincides with anX 2 -min. Then, by the same reason as above, the rest of theX i -minima lie in L c , for i = 1, 2, 3. We conclude that oneX 3 -max and oneX 3 -min lie in L c and noX 3 -extremum lies in X 3 . Then, necessarily,X 3 ⊆ L c , which is a contradiction.
The previous lemma is used to prove that a level set contained in a region with specific constraints is always connected.

Lemma 3 Let R be a region with exactly one R-max, one R-min and without any 2saddle in its topological interior. Assume that the boundary of R, ∂ R, is either a level curve or it contains exactly one 1-max and one 1-min. Then L c is connected, where L c = {p ∈ R such that h( p) = c}.
Proof Let X = R \ L c . By Lemma 2, we know that X is composed by at most two connected components. First, observe that both, the R-max and the R-min, cannot belong to a same connected component of X , named Y , otherwise, there would exist a curve in Y between the R-max and the R-min and a point p in the curve satisfying that h( p) = c which is not possible since X ∩ L c = ∅. Now, the next two cases can be distinguished: -X is connected. Since both the R-max and the R-min cannot belong to X , then L c must be the R-max or the R-min. Therefore, by definition of R-extremum, L c is connected. -X is composed by two connected components X 1 and X 2 . By contradiction, suppose that L c is disconnected. Similar to what was done in the proof of Lemma 2, we can assume that the R-max lies in X 1 and the R-min lies in X 2 . Then, h(x 1 ) > c for all x 1 ∈ X 1 and h(x 2 ) < c for all x 2 ∈ X 2 . Now, suppose that for some connected component L of L c , we have that L ∩X 1 = ∅.
In that case, we could find an open set U ⊂ R 2 such that: L ⊂ U ∩ R ⊂ R \X 1 ; U ∩(L c \L) = ∅ (since L is a connected component of L c ); and U ∩ R is monotonically connected (since R has no 2-saddles in its topological interior). Then U ∩ R ⊂ L ∪ X 2 and, in that case, we conclude that L is an R-max (since h(x 2 ) < c for all x 2 ∈ X 2 ), which is a contradiction. A similar case occurs when L ∩X 2 = ∅.
Let us prove then that if L c is disconnected then there always exists a connected component L of L c such that L ∩X 1 = ∅ or L ∩X 2 = ∅, leading to the previous contradiction.
The different possibilities that can occur are the following: the proof has finished. Otherwise, assume that L ∩X 1 = ∅ and L ∩X 2 = ∅ and suppose thatX 1 ∩ ∂ R = ∅. Let L be another connected component of L c . Then, in particular, L ∩ L = ∅. Since ∂ R ⊆ L then L ⊂ int(R) and necessarily L ∩X 1 = ∅. -∂ R ⊆ X . Since ∂ R is connected, assume, without loss of generality, that ∂ R ⊆ X 1 .
Then L c andX 2 lie in int(R). Therefore,X 2 \ X 2 ⊆ L c . Let L and L be two different connected components of L c . Since ∂ R ⊆ X 1 , X 1 is connected and X = X 1 ∪ X 2 then X 2 has no holes (otherwise, either X 1 is not connected or X 2 ∩ ∂ R = ∅), thenX 2 \ X 2 is connected and lies in one connected component of L c , for example, L. Therefore, L ∩X 2 = ∅. -If ∂ R L c and ∂ R X then, necessarily, ∂ R is not a level-curve. Then, ∂ R has exactly one 1-max and one 1-min. Two cases may arise: (1) One 1-extremum of ∂ R lies in L c and the other lies in X . Suppose, without loss of generality that the 1-min lies in L c and the 1-max lies in X 1 . Then, ∂ R ⊆ L ∪ X 1 for some connected component L of L c . Now, if L ∩X 2 = ∅, the proof has finished. Otherwise,X 2 lies in int(R) and following a reasoning similar than above,X 2 \ X 2 ⊆ L, concluding that L ∩X 2 = ∅.
(2) The two 1-extrema of ∂ R lie in X . Then, necessarily, the 1-max lies in X 1 and the 1-min lies in X 2 . Then ∂ R ⊆ X ∪ L c . Now, if there is a connected component L of L c such that ∂ R ∩ L = ∅ and either L ∩X 1 = ∅ or L ∩X 2 = ∅, the proof has finished. Otherwise, as before, there would exist another connected component L inside int(R) satisfying that L ∩X 1 = ∅ or L ∩X 2 = ∅, concluding the proof.
The next result establishes sufficient conditions for a region R to be a slope region. Briefly, the next result shows that if R satisfies some constraints, it is always possible to construct a monotonic curve between any two points in R concatenating certain monotonic curves and level curves contained in R.

Theorem 2 If R is a region with no 2-saddles in its topological interior, with exactly one R-max and one R-min, and such that the boundary of R is either a level curve or it contains exactly one 1-max and one 1-min, then R is a slope region.
Proof Let us prove that any two different points p, q ∈ R can be joined by a monotonic curve in R.
First, suppose that h( p) = h(q) = c. In this case, p, q ∈ L c and, since L c is connected by Lemma 3, then there is a level curve (which is a particular case of monotonic curve) between p and q in R. Now, assume, without loss of generality, that h( p) < h(q). Since R is connected, there is a curve π : [0, 1] → R from p to q. If π is monotonic then the proof is complete. Otherwise, since π is continuous and [0, 1] is a bounded and closed set and due to h( p) < h(q), there exists n ≥ 1 (n can be infinite) such that there are subsets [t i , s i ], for 1 ≤ i ≤ n, with 0 ≤ t 1 < s 1 ≤ t 2 < s 2 ≤ · · · ≤ t n < s n ≤ 1 for which, every π | [t i ,s i ] , for 1 ≤ i ≤ n, is a monotonic increasing curve, that is, h(π(t i )) < h(π(s i )) for 1 ≤ i ≤ n and satisfying that h(π(t i )) ≤ h(π(t i+1 )) and h(π(s i )) ≤ h(π(s i+1 )) for 1 ≤ i < n; h(π(s i )) = h(π(t i+1 )) for 1 ≤ i < n; and related to p and q, it must verify that h( p) = h(π(t 1 )) and h(π(s n )) = h(q).
Besides, since h(π(s i )) = h(π(t i+1 )), for 1 ≤ i < n, by Lemma 3, there exists a level curve between s i and t i+1 , for 1 ≤ i < n, named γ i . Moreover, since h( p) = h(π(t 1 )) and h(π(s n )) = h(q), there are also two level curves, one between p and t 1 , denoted by γ p , and other between s n and q, named γ q . Then, a monotonic curve π pq can be constructed from p to q by the union of the monotonic curves π | [t i ,s i ] , for 1 ≤ i ≤ n, the level curves γ i , for 1 ≤ i < n, γ p , and γ q , as follows: Hence, there always exists a monotonic curve between any two different points in R, and therefore, R is a slope region.
As an immediate consequence of Theorems 1 and 2, we conclude this section with the characterization of slope regions.

Corollary 1 A region S is a slope region if and only if S satisfies the following conditions: -S does not contain 2-saddles in its topological interior. -S is either a plateau region (possibly with holes) or it contains exactly one R-max
and one R-min. -The boundary of S is either a level curve or it contains exactly one 1-max and one 1-min.
As a consequence, a slope region contains at most one 2-max and one 2-min.

Slope complexes
In this section we define a slope complex as a cell decomposition of the plane R 2 such that the 2-cells are slope regions and the 1-cells are monotonic curves. Using our approach, critical points can be degenerated, and monotonic curves do not necessarily follow the steepest slope, as used in Edelsbrunner et al. (2003b). Table 1 summarizes the different constraints to build MS complexes and slope complexes.
A detailed definition of cell complexes can be found, for example, in Chapter 1 of Hatcher (2000).
Briefly, to construct a cell decomposition of the plane R 2 begin with a discrete space T 0 ⊂ R 2 whose elements are called 0-cells or vertices. The space T 1 ⊂ R 2 is obtained by attaching simple curves with endpoints in T 0 . Such curves are also called 1-cells or edges. To obtain T 2 , attach regions (also called 2-cells or faces) in a way such that the boundary of each region is the union of a finite number of edges of T 1 . If T 2 = R 2 , then T 0 ⊂ T 1 ⊂ T 2 is a cell decomposition of R 2 .
In order to capture, in a cell decomposition of the plane, the behaviour of the continuous map h : R 2 → R, the cell decomposition and the map h need to satisfy several constraints.
First, we need the extra-condition for the continuous map h of not having accumulation points of 2-critical plateaus.
Remark 3 Let p ∈ R 2 . Let D be the disk centered at a point p ∈ R 2 with radius . If, for any > 0, D contains an infinite number of 2-critical plateaus then p cannot be contained in any slope region.
The next definition provides the structure of a cell decomposition formed by slope regions.
Definition 10 (slope complex) A slope complex K is a cell decomposition of R 2 satisfying the following conditions: 1. Each region of K is a slope region. 2. For each 2-critical plateau P, there is a vertex of K which is a point of P. 3. For each slope region S and each R-extremum P, there is a vertex of K which is a point of P.
To end this section, the following result guarantees that we can always compute a slope complex from a decomposition in slope regions.

Proposition 1 The boundary ∂ S of a slope region S can always be decomposed into a finite set of vertices and edges. If ∂ S is a continuous curve with exactly one 1-max and one 1-min, then ∂ S can be decomposed in two different sets of edges and vertices satisfying that each of these sets corresponds to a monotonic curve from a vertex being a point of the R-max to a vertex being a point of the R-min.
Proof By Lemma 1, ∂ S can only be a level curve or a continuous curve with exactly one 1-max and one 1-min. Firstly, if ∂ S is a level curve then it can be decomposed in a finite set of simple level curves, and each of these curves can be decomposed in Higher-order saddles allowed Fig. 5 General prototype of slope regions. The possibility of the existence of more holes is illustrated by dashed lines: Extra holes can be connected by paths to the three holes represented in the picture or to the outer boundary with the only constraint that all the paths can be joined together connecting ⊕ and by exactly two different monotonic paths Fig. 6 A 2.5D mesh plot illustrating an "inclined slope region" and its prototype representation one or two vertices and one edge. Secondly, if ∂ S is a continuous curve with exactly one 1-max and one 1-min, then it can be decomposed in two different monotonic curves between the 1-max and the 1-min. Each monotonic curve can be decomposed in simple monotonic curves being edges with endpoints being vertices. If the 1-max (resp. the 1-min) is a vertex of the R-max (resp. the R-min), then the proof is complete. Otherwise, there exists a monotonic curve π max (resp. π min ) between any point of the R-max and the 1-max (resp. the R-min and the 1-min). Besides, such curves do not intersect ∂ S, since the h-values of the points of ∂ S are lower (resp. higher) than the h-values of the points in π max (resp. π min ). For a similar reason, they do not intersect each other. Finally, decomposing such monotonic curves π max and π min in simple curves being edges, with endpoints being vertices, and joining them to the previous sets of vertices and edges, we obtain two finite sets of edges ∂ S that correspond to exactly two monotonic curves between one vertex of the R-max and one vertex of the R-min.

Prototype of slope regions
As we have shown in Sect. 3, the slope regions have been univocally characterized, but they may have different arrangements, and then, different appearances. Hence it becomes necessary to sum up the common properties of all slope regions in a simple representation called "prototype". A prototype is the combinatorial structure of a slope region. Therefore, prototypes show all the features that a corresponding slope region will exhibit. The prototypes are flexible and it is possible to remove certain elements (e.g., holes) which will result in different configurations of slope regions, but always keeping the same properties provided in Corollary 1. In this section, we first recall two already known prototypes of slope regions. Later, we sum up the two prototypes into a complete and general one, in terms of the elements provided by the characterization of slope regions: the two extrema relative to the region together with the boundary of the region, with the assurance that it represents any slope region. We end up the section with some examples of slope-region decomposition of a given gray-level image. Figure 5 is the graphical representation through graphs of the general prototype representing all the possible configurations of slope regions. Paths represent the corresponding curves on the surface. Similarly, closed paths represent curves with same endpoint. An arrow on a path indicates that the corresponding curve is monotonic. An arrow from point a to point b indicates that h(a) ≥ h(b). The absence of arrows on a path indicates that the path represents a level curve. Observe that due to the characterization of slope regions given in this paper, all the possible configurations of slope regions have similar elements: there is the region R bounded by the outer boundary connecting the 1-max m 1 and the 1-min m 2 .
In the topological interior of the region we could have an R-max ⊕ and the Rmin . Each R-extremum is a vertex of the prototype, with possibly closed paths (representing level curves) attached (see Fig. 7). The R-max ⊕ and the R-min are connected to m 1 and m 2 respectively by a monotonic path. The orientation of the path is from ⊕ to m 1 and from m 2 to since h(⊕) ≥ h(m 1 ) and h(m 2 ) ≥ h( ). Intuitively, each hole represents a bounded connected set of points in R 2 that cannot be connected to the points in R by a monotonic curve. Therefore, a hole cannot be a part of the slope region because it contradicts Definition 9. Intuitively, all the holes are connected to the boundary such that the interior of the region is homeomorphic to a disk. Holes can be further classified depending on their occurrence. Namely, (a) "inclined" holes surrounded by the monotonic paths (⊕, m 1 ) and (m 2 , ) (example: Hole 1 and Hole 2 in Fig. 5); and (b) "horizontal" holes attached to such monotonic paths (example: Hole 3 in Fig. 5). More holes can be connected by paths to the holes represented in Fig. 5 or to the outer boundary with the constraint that all the paths can be joined together connecting ⊕ and by exactly two different monotonic paths. The possibility of the existence of more holes is illustrated in Fig. 5) by dashed lines. Observe that horizontal holes can appear attached to other holes or to the outer boundary by level paths (see, for example, Fig. 6).
Observe that the two monotonic pathsâ andǎ connecting ⊕ and p 1 in Fig. 5 are the same: they represent that there is a monotonic curve in the region which is obtained as the identification of both of them,â andǎ. Similar observation can be made for pathsb,b,ĉ,č,d,ď, or even for h 5 and h 6 , which represent Fig. 7 A 2.5D mesh plot illustrating a "crater" and its prototype representation the same curve and, in that case, it must be a level curve. Otherwise, the resulting curve from the R-min to the R-max is not monotonic which is a necessary condition for the boundary of a slope region, as we proved in Sect. 3. The complete traversal along the boundary of the general prototype can be described as follows: (⊕,â, h 1 ,b, m 1 , e, m 2 ,d, h 4 ,ĉ, ,č, h 3 ,ď, m 2 ,ĝ, p 5 , h 5 , p, h, p, h 6 , p 5 , f , m 1 ,b, h 2 ,ǎ, ⊕). The paths responsible for connecting the elements ⊕, and holes to the outer boundary are a subset of the complete boundary of the slope region, and they are intuitively called as "the folding of the boundary". "Folding" and"unfolding" has also been used in Edelsbrunner et al. (2003b) for treating degenerated saddle points.
The general prototype presented in Fig. 5 is a generalized version of Prototype 1 ("inclined slope region") mentioned in . An example of a 2.5D mesh plot and its graphical representation corresponding to Prototype 1 is given in Fig. 6. Observe that there can be many holes (as mentioned above) inside the slope region and that the outer boundary of the region is surrounded by exactly two monotonic paths connecting the 1-max m 1 and the 1-min m 2 . Prototype 2 ("horizontal slope region") mentioned in Batavia et al. (2019a) can also be obtained from the general prototype presented in Fig. 5, by replacing the monotonic paths in the outer boundary by paths representing level curves.
In the general prototype, if the R-max ⊕ (resp. R-min ) is absent, vertex m 1 (resp. m 2 ) will become the R-max (resp. R-min). Besides, the absence of the R-max and the R-min together with the outer boundary of R being a level curve, will result in a plateau region.
To end up this part of the section, observe that the "crater" in Fig. 7 is an example of a slope region that is not a MS manifold. The R-max and the R-min in Fig. 7 are represented by one vertex and a closed level path attached. Intuitively, the R-max surrounds the crater and the R-min surrounds the foothill and coincides with the outer boundary of the region. Besides, the R-max and the R-min are connected by two monotonic paths in its prototype representation, being the complete boundary of the region described by the closed path ( , b,â, ⊕, h,ǎ, ).

Slopes in an image landscape
Let us now consider the digital image pictured in Fig. 8 and a 2.5D surface obtained by defining a continuous "height" (intensity) map h : R 2 → R by interpolating the gray Fig. 8 a A digital image and, with the local minima, local maxima and saddle plateaus surrounded, respectively, by blue, red and green closed curves. b-d Different slope-region decomposition of the same image level of the pixels. In the picture, the local minima, local maxima and saddle plateaus are surrounded, respectively, by a blue, red and green closed curve.
The following examples of slope-region decomposition show both plateau regions and non-plateau slope regions S connecting R-max to R-min with folded boundaries forming monotonic paths. As per Corollary 1, a non-plateau slope region S contains exactly one R-max and one R-min. Therefore, the minimum number of slope regions required to decompose the image is three (see, for example, Fig. 8b). Also for any sloperegion decomposition, either the saddle plateau is one region of the decomposition, or the saddle plateau is divided into respective slope regions (as shown by dashed lines in Fig. 8d).
The main advantage of slope decomposition over watershed or MS decomposition is the flexibility to choose the size of the slope region and the receptive field of the local extrema. Also, unlike MS decomposition algorithms, we allow holes inside the slope region. Depending on the constraints for optimization, following are a few examples of slope-region decompositions:

Conclusions and future work
In this paper, we have provided a complete characterization of monotonically connected regions, so-called slope regions, in terms of their main topological elements, namely, their critical points and the critical points on their boundary.
Moreover, a decomposition of a 2.5D surface in slope regions preserves the arrangements between critical points of the surface. We have also provided a general prototype of slope regions, in terms of graphs, that fulfills the characterization presented here.
For future work, we plan to extend the theory of slope regions to slope volumes and slope manifolds embedded in R 3 to exploit the topological properties of 3D spaces.
The work can very well be compared with the concept of dyads and dendrites mentioned in Bertrand (2013) and Bertrand (2014).
We also plan to work on persistence measures which will be useful to eliminate the insignificant critical points. Besides, we plan to prove that MS complexes can be seen as particular cases of slopes complexes. Finally, Cerman et al. (2016) can be considered as a first step in the computation of slope complexes and we plan to continue this work in the very near future.
Regarding future applications, with the complete characterization of slope regions at hand, we could compute minimal slope complexes (slope complexes with minimal number of slope regions preserving critical points) and these minimal slope complexes could be used for robust image classification tasks, for example. Besides, notice that any hill-climbing optimization (such as back-propagation in neural networks) inside a slope region reaches the 2-max (if contained in the interior of the slope region). Consequently, iterative optimization on a given surface converges whenever the starting point is inside the slope region having the global maximum, even if there are other local maxima in the surface.
Besides, since a decomposition of a 2.5D surface into slope regions endows topological and structural properties, such decomposition could be used for applications such as segmentation, object recognition or geometric modeling.
Funding Open Access funding provided thanks to the CRUE-CSIC agreement with Springer Nature. This work has been partially supported by Ministerio de Ciencia e Innovación -Agencia Estatal de Investigación/10.13039/501100011033 under project PID2019-107339GB-I00 and the University of Seville. by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.