Introduction to Mathematical Morphology
Total Page:16
File Type:pdf, Size:1020Kb
COMPUTER VISION, GRAPHICS, AND IMAGE PROCESSING 35, 283-305 (1986) Introduction to Mathematical Morphology JEAN SERRA E. N. S. M. de Paris, Paris, France Received October 6,1983; revised March 20,1986 1. BACKGROUND As we saw in the foreword, there are several ways of approaching the description of phenomena which spread in space, and which exhibit a certain spatial structure. One such approach is to consider them as objects, i.e., as subsets of their space of definition. The method which derives from this point of view is. called mathematical morphology [l, 21. In order to define mathematical morphology, we first require some background definitions. Consider an arbitrary space (or set) E. The “objects” of this :space are the subsets X c E; therefore, the family that we have to handle theoretically is the set 0 (E) of all the subsets X of E. The set p(E) is incomparably less arbitrary than E itself; indeed it is constructured to be a Boolean algebra [3], that is: (i) p(E) is a complete lattice, i.e., is provided with a partial-ordering relation, called inclusion, and denoted by “ c .” Moreover every (finite or not) family of members Xi E p(E) has a least upper bound (their union C/Xi) and a greatest lower bound (their intersection f7 X,) which both belong to p(E); (ii) The lattice p(E) is distributiue, i.e., xu(Ynz)=(XuY)n(xuZ) VX,Y,ZE b(E) and is complemented, i.e., there exist a greatest set (E itself) and a smallest set 0 (the empty set) such that every X E p(E) possesses a complement Xc defined by the relationships: XUXC=E and xn xc= 0. Given two sets X and Y E p(E), the notion of their set diference X/Y derives from the intersection and the complement, as follows: X/Y=Xn YC; X/Y is the part of X which does not belong to Y (see Fig. lc). In brief, given two sets B and X belonging to p(E), we may have (Fig. 1): (a) B is included in X (notation: B c X) (p) B hits X (notation: B fi X) meaning B n X # 0 (y) B misses X (notation B c Xc) meaning B n X = $I and these relationships will apply when B is replaced by every family {B;). Finally, the structure of a Boolean algebra provides the general framework on which we shall perform morphological treatments. Mathematical morphology is the application of lattice theory to spatial structures. 283 0734-189X/86 $3.00 Copyright $’ 1986 by Academic Press, lnc All rights of reproduction in any form resrrwd 284 JEAN SERRA FIG. 1. (a) B, hits X (B, R X); E, misses X (B2 C Xc); B, is included in X (B, C X); (b) complement X’ of set X; (c) difference X/Y of the two sets X and Y. These definitions may seem rather abstract and far away from the practical applications. As a matter of fact, we shall pursue the discussion by concentrating mainly upon the Euclidean space R” with dimension n = 1,2, or 3, or its digital version Z” in terms of grids of points. Pedagogically speaking, the Euclidean case is the first to be considered, since it corresponds to the physical world in which we live; on the other hand, many images are reasonably binary, at least in a first approximation (such as microstructures (Fig. 10) biological cells, (Fig. 11) seg- mented zones in remote sensing, etc.). However, to restrict the approach to the Euclidean sets would mean ignoring other important domains to which the method applies. Let us briefly quote, for example: -functions of W” considered as sets of R x Wn-‘, via their umbrae (see [25]); -planar graphs, such as the partition of a map into counties [4]; -products of spaces, when several images are defined at each pixel. The conditional operations introduced in Sections 5 and 6 below illustrate this mor- phology. They result in context dependent transformations; -vector spaces, such as propagations, when a range of directions is function of each pixel [5]; -topological spaces which are necessary for introducing probabilities, and for treating the questions of robustness [l]; -etc. All in all, these various extensions indicate that we have to keep in mind two different levels of generality: the Euclidean (or digital) binary case, which is useful and gives a good intuition of what is going on, and the Boolean algebra associated with the general framework of the method. 2. MORPHOLOGICAL TRANSFORMATIONS 2.a. Hit-or-Miss Transformation, Dilation, Erosion The final goal of computer vision is often to segment images into objects and textures in accordance with the judgment of the human eye. But this is not always the case. It may happen that slight nuances escape human perception although they INTRODUCTION 2X5 FIG. 2. (a) Cat brain cortex after hypoxia. The human eye does not detect the slightest difference with the normal state. Nevertheless, by investigating one thousand neurons by morphological openings, significant differences are exhibited [6]. (b) Sandstone rock from the oil reservoir of Hassi-Messaoud (Sahara): how does one predict the permeability of this material from its texture? are significant (see Fig. 2a). Moreover, the purpose of an image treatment may not be to match vision, but to estimate some physio-chemical properties. In the case of Fig. 2b, the Navier-Stokes equation, which governs the physical process, corre- sponds to nothing intuitive. Therefore, we do not look for a computerized substitute for human vision, but for a coherent framework for describing spatial organization. To this end, we define the structure of an object by the set of the relationships existing between the various parts of the object. We will study the structure experimentally by trying each of the possible relationships in turn, and examining whether or not it is satisfied. Of course, such knowledge will greatly depend on the choice made for the system of relationships considered possible, and this a priori choice determines the relative worth of the resulting concept of structure. We saw that the media under study may have no recognizable pattern. This lack of meaning (for us) leads to the position of probing them systematically, by starting from the simplest relations that one can imagine. From this comes the idea of a structuring element. With each point x of the space E in which we work, we associate a set B(x) called a structuring element. (Note that B(x) may vary from one place to another). We can modify every set x E $I( E) by some B(x) in several ways. The most important ones are as follows: dilation of X: (x: B(x) fl X} (1) erosionof X: {x: B(x) C X}. (2) The dilation of X by B(x) is the set of all the points x such that B(x) hits X. The erosion of X by B(x) is the set of all the points x such that B(x) is included in X. Starting from two structuring elements B’(x) and B2(x) we also define the 286 JEAN SERRA hit-or-miss transformation (in brief HMT) as being the difference of X eroded by B’(x) and X dilated by B2(x). HMT of X: (erosion of X by B’)/(dilation of X by B2). Dilation and erosion turn out to be particular cases of HMTs. The class of transformations generated by the (possibly infinite) unions, products, and complementations of HMTs constitutes, by definition, the morphological truns- formations over p(E). Of course, these operations are not the only pieces of information; in particular, they can be combined with measures on p(E) (e.g., the area or the volume of sets in the Euclidean space) or with other types of operations (convolution, for example). 2. b. Basic Properties First of all, a general comment: all of the morphological transformations are non-reversible, (except, in each particular case, for some subclasses of sets such as the invariant ones). In fact, the idea of restoring the images is quite irrelevant here; on the contrary, our philosophy will consist of stating that the images under study exhibit too much information, and that the goal of any morphological treatment is to manage the loss of information through the successive transformations. In order to do this, we must play with a few underlying general properties which are the key to any morphological analysis. We now present the four most important ones. In what follows, $ is the generic symbol of a morphological transformation. (i) Increasing: 4 is increasing when it preserves inclusion, i.e., when xc y=, 44x) = J/(y) ‘dx,YE b(E). (4) For example, the transformation “replace X by its boundary JX” is not increasing. (ii) Anti-extensiuity: r/ is anti-extensive when it shrinks X, i.e., when J/(x)= x Vx E b(E). (5) (iii) Idempotence: # is idempotent when the result q(X) remains unchanged if we reapply the transformation, i.e., when vwxN = W) vx E b(E). (6) (iv) Homotopy: Here the set E is considered as a topological space. However, for the sake of simplicity, we limit ourselves to the bounded sets of the plane. With each bounded set K, associate its homotopy tree whose trunk corresponds to the background K, (i.e., the infinite connected component of Kc), the first branches corresponding to the connected components K1 of K adjacent to K, and the second branches to the pores K, of K adjacent to K,, etc. (see Fig.