Full text
IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 7, NO. 4, APRIL 1998 555 Antiextensive Connected Operators for Image and Sequence Processing Philippe Salembier, Member, IEEE, Albert Oliveras, Member, IEEE, and Luis Garrido Abstract— This paper deals with a class of morphological operators called connected operators. These operators filter the signal by merging its flat zones. As a result, they do not create any new contours and are very attractive for filtering tasks where the contour information has to be preserved. This paper shows that connected operators work implicitly on a structured representation of the image made of flat zones. The max-tree is proposed as a suitable and efficient structure to deal with the processing steps involved in antiextensive connected operators. A formal definition of the various processing steps involved in the operator is proposed and, as a result, several lines of generalization are developed. First, the notion of connectivity and its definition are analyzed. Several modifications of the traditional approach are presented. They lead to connected operators that are able to deal with texture. They also allow the definition of connected operators with less leakage than the classical ones. Second, a set of simplification criteria are proposed and discussed. They lead to simplicity-, entropy-, and motion-oriented operators. The problem of using a nonincreasing criterion is analyzed. Its solution is formulated as an optimization problem that can be very efficiently solved by a Viterbi algorithm. Finally, several implementation issues are discussed showing that these operators can be very efficiently implemented. Index Terms— Connected operators, connectivity, mathematical morphology, motion criterion, optimization, sequence processing, simplicity criterion, Viterbi algorithm, watershed. I. INTRODUCTION THE FIRST connected operators reported in the literature are known as binary opening by reconstruction [1]. These operators independently act on each connected component of the binary image: they eliminate the connected components that would be totally removed by an erosion with a given structuring element and they leave the other components unchanged. This filtering approach offers the advantage of simplifying the image, because some components are removed, as well as preserving the contour information, because the components that are not removed are perfectly preserved. This approach has been generalized for gray-level functions using the so-called reconstruction process [2]. Beside opening by reconstruction, - operators, area opening [3], dynamics filters [4], and more recently, volumic [5], complexity [6], motion [7], and moment-oriented [8] operators have been proposed. These operators offer various simplification criteria Manuscript received August 23, 1996; revised June 4, 1997. The associate editor coordinating the review of this manuscript and approving it for publication was Dr. Henri Maitre. The authors are with E.T.S.E.T.B-Universitat Polit` ecnica de Catalunya, 08034 Barcelona, Spain (e-mail: [email protected]). Publisher Item Identifier S 1057-7149(98)02462-2. (size, contrast, shape, etc.) while preserving contours. This property makes them very attractive for a large number of applications such as noise cancellation, segmentation, pattern recognition, etc. The extensive use of connected operators has motivated some theoretical studies. For instance, the notions of connected operators and of flat zones are discussed in a formal way in [9]–[11]. Connectivity issues related to connected operators are analyzed in [12]–[14]. Finally, relations with structured representations of images such as region adjacency graphs and trees are discussed in [7] and [15]. The purpose of this paper is to focus on the class of antiextensive connected operators (and by duality, extensive connected operators). Based on a formal operator definition involving a tree representation of the image called a maxtree, several contributions are proposed. First, the notion of connectivity is analyzed. Several modifications of the traditional approach are presented. They lead to connected operators that are able to deal with texture or to connected operators that have much less leakage than classical operators. Second, a set of new simplification criteria are proposed and discussed. In particular, simplicity-, entropy-, and motionoriented operators are defined. The problem of using a nonincreasing criterion is analyzed and its solution is formulated as an optimization problem that can be very efficiently solved by a Viterbi algorithm. Finally, several applications as well as implementation issues are discussed. Note that part of the work reported here can be found in conference proceedings [6], [7], [13]. One of the objectives of the paper is to review these contributions. However, some new contributions are also presented here. These original contributions mainly concern the max-tree creation and processing, the use of the Viterbi algorithm to deal with nonincreasing criteria, and the entropy connected operator. The organization of this paper is as follows. Section II is devoted to the notion of binary and gray-level connected operators. This presentation will highlight three major processing steps: tree creation, tree filtering, and image restitution. These three steps are, respectively, discussed in Sections III–V. Finally, Section VI is devoted to the conclusions. II. CONNECTED OPERATORS A. Theoretical Definition In [9], [10], the concept of binary connected operators is formally defined as follows: 1057–7149/98$10.00 1998 IEEE
556 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 7, NO. 4, APRIL 1998 Fig. 1. Binary connected operator. Definition 1—Binary Connected Operators: A binary operator is connected when for any binary image , the set difference is exclusively composed of connected components of or of its complement . The extension of connected operators for gray-level functions relies on the concept of partition [9], [10]. Let us recall that a partition of the space is a set of connected components which are disjoint and the union of which is the entire space. Each is called a partition class. Moreover, a partition is said to be finer than another partition if any pair of points belonging to the same class also belongs to a unique partition class . Consider now a binary image and define its associated partition as the partition made of the connected components of the binary sets and of their complement. The definition of connected operators can be expressed using associated partitions as follows. Theorem 2—Binary Connected Operators via Partition: A binary operator is connected if and only if, for any binary image , the associated partition of is finer than the associated partition of . The concept of gray-level connected operators can be introduced if we define a partition associated to a function. To this end, the use of flat zones was proposed in [9] and [10]. The set of flat zones of a gray-level function is the set of the largest connected components of the space where is constant (a flat zone can be reduced to a single point). The set of flat zones of a function is a partition, called the partition of flat zones and leads to the following definition. Definition 3—Gray-Level Connected Operators: An operator acting on gray-level functions is connected if, for any function , the partition of flat zones of is finer than the partition of flat zones of . Let us see how this definition implicitly means that the operator works on a structured representation of the image. B. Binary Antiextensive Connected Operators In the sequel, we restrict ourselves to the case of antiextensive operators ( ). Therefore, a binary antiextensive connected operator is an operator that can only remove connected components of . The filtering process can easily be explained if a tree representation of the image is used as shown in Fig. 1. The original image is composed of three connected components. It can be represented by a tree structure with four nodes: the root node represents the set of pixels belonging to the background , and represent the three connected components of the image. In this representation, the filtering process consists in analyzing each node by assessing the value of a particular criterion. Assume for example that the criterion consists in counting the number of pixels belonging to a node (area opening [3]). Then, for each node, the criterion value is compared to a given threshold and the node is removed if the criterion is lower than .In the example of Fig. 1, node is removed because its area is small. As a result, its pixels are moved to the background node (the connected component is removed). As can be seen, the tree links represent the pixels’ migration (toward the father) when a node is removed. All antiextensive binary connected operators can be described by this process, the only modification being the criterion that is assessed. C. Gray-Level Antiextensive Connected Operators As seen in Definition 3, the extension of connected operators to gray-level images uses the partition of flat zones. This extension can also be seen as a simple generalization of the tree representation to the gray-level case. The idea consists in creating the tree recursively by a study of the thresholded versions of the image at all possible gray levels. An example is presented in Fig. 2. The original image is composed of seven flat zones identified by a letter . The number following each letter defines the gray-level value of the flat zone. In our example, the gray-level values range from zero to two. In the first step, the threshold is fixed to the gray-level value zero. The image is binarized: all pixels at level (pixels of region ) are assigned to the root node of the tree . Furthermore, the pixels of gray-level value strictly higher than form two connected components that are temporarily assigned to two nodes: and . This creates the first tree (for gray levels [0, 1]). This procedure is the same as the one used for the binary image. In a second step, the threshold is increased by one: . Each node is processed as the original image. Consider, for instance, the node ; all its pixels at level remain unchanged and create the final node . However, pixels of gray-level values strictly higher than (here ) create two different connected components and are moved to two temporary child nodes and . The complete tree construction is done by iterating this process for all nodes at level and for all possible thresholds (from zero to the highest gray-level value). The algorithm can be summarized saying that, at each temporary node ,a “local” background is defined by keeping all pixels of graylevel value equal to (the “local” background itself may not be connected) and that the various connected components formed by the pixels of gray-level value higher than create the child nodes of the tree. In this procedure, some nodes may become empty. Therefore, at the end of the tree construction, the empty nodes
SALEMBIER et al.: ANTIEXTENSIVE CONNECTED OPERATORS 557 Fig. 2. Max-tree representations. Fig. 3. Connected operators with max-tree representations. are removed. The final tree is called a max-tree in the sense that it is a structured representation of the image which is oriented toward the maxima of the image (maxima are simply the leaves of the tree) and toward the implementation of antiextensive operators. Note that this description does not necessarily correspond to the actual implementation of the tree construction. For this purpose, an efficient algorithm is proposed in the Appendix. The filtering itself is similar to the one used for the binary case. A criterion is assessed for each node . Based on the value, the node is either preserved or removed. In this last case, the node’s pixels are moved toward its father’s node. At the end of the process, the output max-tree is transformed into a gray-level image by assigning the gray value to the pixels of . D. Connected Operators and Max-Tree Representation Based on the previous description, a general filtering scheme is illustrated in Fig. 3. It involves a first step of max-tree creation, the goal of which is to structure the pixels in a suitable way for the filtering process. The max-tree representation has also the advantage of leading to very efficient implementations of connected operators. The second step is the filtering itself, which analyzes each node and takes a decision on which node has to be preserved and which node has to be removed. Finally, the last step restores the filtered image by transforming the output max-tree into a gray-level image. The discussion of this paper will focus on antiextensive operators and maxtrees. By the duality , the same notions can be applied to extensive operators and min-trees. In the following, we describe the three steps of Fig. 3 with more details. III. MAX-TREE CREATION The objective of this step is to create the max-tree, that is the set of nodes and the links between the father and child nodes. As described in Section II-C, for each temporary node , the set of pixels belonging to the local background is defined and assigned to the max-tree node . This is the binarization step. Then, the set of pixels belonging to the complement of the local background, that is , are analyzed and its connected components create the temporary child nodes (which will be further analyzed). This is the connected components definition step. In the sequel, the binarization and the connected components definition steps are analyzed and some generalizations are proposed. A. Binarization The most natural way of defining the “local” background for each node at level consists in taking all pixels of gray-level value . Formally, the node is composed of the pixels of level of the temporary node , that is such that (1) where represents the gray-level value of the pixel . This binarization process extracts the flat zones of the image. This step is closely related to the definition of the basic entities on which the filter is going to act. Equation (1) means that the basic entities are characterized by a strictly flat graylevel value. However, in practice, “visual” entities may not be strictly flat because of noise or texture. To deal with such cases, less strict binarization techniques can be used. To this end, a useful criterion relies on the definition of a bound on the gray-level fluctuations. The corresponding “soft” binarization rule is the following: such that either or and neighbor of (2) A flat zone is composed of pixels with low gray-level fluctuations. The particular case corresponds to the classical situation where the flat zones are strictly flat. Figs. 4 and 5 illustrate the evolution of the flat zones as a function of . To judge intuitively this evolution, we show, on the left side of Fig. 4, images where each flat zone has been filled by its mean and, on the right side, the corresponding contours of the flat zones. When , the image on the left side is the original image and most flat zones involve one or two pixels (right image). Fig. 5 shows the reduction of the number of flat zones. Of course, this curve has a direct relation with the evolution of the max-tree complexity. The interest of this approach can be foreseen by looking at the flat zones corresponding to the water areas. If a “strict” binarization is used ( ), the water is represented by a very high number of small flat zones and will not be processed as a single entity. By contrast, if a “soft” binarization is used, these small flat zones are grouped together to form larger entities that
558 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 7, NO. 4, APRIL 1998 Fig. 4. Flat zones resulting from the “nonflat” binarization (2). Left: gray-level image where each flat zone has been filled with its mean. Right: contour of the flat zones. Upper left: Flat zones 1=0 . Middle left: Flat zones 1=4 . Bottom left: Flat zones 1=8 . Upper right: Contours 1=0 . Middle right: Contours 1=4 . Bottom right: Contours 1=8 . Fig. 5. Evolution of the number of flat zones of the image of Fig. 4. will be processed in a coherent way by the connected operator. Note, however, that the pixels assigned to each node of the max-tree do not have the same gray-level value. Therefore, the restitution step after the filtering cannot simply assign the graylevel to pixels belonging to the node . Let us postpone this discussion until Section V dealing with restitution issues. In the sequel (and until Section V), we assume that a “strict” binarization rule ( ) is used. Let us concentrate on the problem of connected components definition: once the “local” background (that is ) has been defined, its complement has to be analyzed to create the new temporary nodes at level (that is ). B. Connected Components Definition In the case of discrete images, the simplest approach consists in selecting a connectivity (4-, 6-, or 8-connectivity) and in labeling the set of pixels of the temporary node that does not belong to the “local background” following this connectivity rule. Note that, as the binarization, this step is very important because it implicitly defines the notion of objects that will be processed by the operator. The objective of this section is to discuss modifications of the connectivity and their influence on the resulting connected operator. Let us recall the connectivity definition. Definition 4—Connectivity Class: Aconnectivity class is defined on the subsets of a set when 1) and ; 2) for each family iof i i . It was shown in [16] that this definition is equivalent to the definition of a family of connected pointwise openings , associated to each point of . Let us recall the following result. Theorem 5—Connectivity Characterized by Openings: The definition of a connectivity class is equivalent to the definition of a family of openings such that: 1) ; 2) and and are either equal or disjoint; 3) and . Intuitively, the opening extracts the connected component of that contains . Based on this definition of the connectivity, a generalization was proposed in [16]. It relies on the definition of a new connected pointwise opening: if and if (3) where is an extensive dilation. This new operator is a connected pointwise opening and therefore defines a new connectivity. This connectivity is less “strict” than the usual ones in the sense that it considers that two objects that are close to each other (that is they touch each other if they are dilated by ) belong to the same connected component. This generalization can lead to interesting connected filters. However, in this paper we concentrate on a different issue: in practice, connected operators are known to present a drawback called “leakage” that results from the connection of different objects. These connections are created because there exist thin connected paths between large objects. A solution to this problem consists in breaking the thin connections of the binary connected components and in segmenting the components into a set of elementary shapes to be processed separately. As a result, the connected operator can take individual decision on each elementary shape. Ideally, the shapes should correspond to our perception of the main parts of the object. This approach
SALEMBIER et al.: ANTIEXTENSIVE CONNECTED OPERATORS 559 can be seen as the definition of a “strict” connectivity. To our knowledge, two attempts have been reported in the literature to define “strict” connectivities. •Segmentation by Openings [17]: Given a family of connected pointwise openings,, and an opening with a connected structuring element, a new family of connected pointwise opening, , can be created as follows: if and if (4) and as usual if . It can be shown that is actually a connected pointwise opening and therefore defines a connectivity. Intuitively, this connectivity considers that the connected components of a binary set are made of the connected components of its opening by . The points that are removed by the opening are considered as isolated points, that are connected components of size one. Even if this solution is theoretically sound, in practice it turns out that this way of segmenting the connected components leads to a loss of one of the main features of connected operators. In practice, connected operators are used because they can simplify while preserving the shape information of the remaining image components. Suppose now that we use an area opening of size larger than one with the connectivity defined by the connected pointwise opening of (4). The filter will eliminate all the isolated points (area equal to one) and all the small connected components resulting from the opening. The shape information of the remaining components will not be preserved because most of the time, this shape information relies on the set of isolated points. To solve this problem, we propose the following approach. •Segmentation by Watershed [6], [13]: The idea of this approach is to rely on classical morphological segmentation tools. Morphological segmentation generally involves two steps: marker extraction and watershed segmentation [18]. The marker extraction defines the interior of the regions that should be segmented and the watershed precisely defines the contours of these regions. The segmentation procedure is illustrated by Fig. 6. The original gray-level image can be seen in Fig. 6(a), and the set of binary connected components resulting from a thresholding at level 70 in Fig. 6(b) (note that different gray-level values have been assigned to each connected component). In this last figure, there is a very large connected component involving the two speakers, the screen in the background of the scene and the letters of the word “MPEG.” These objects are processed as single entity by the operator because there exist thin connections between them. —Marker Extraction: In the context of connected operators, this step defines the number of connected components created by the segmentation. A simple idea consists in using as markers the connected components of the ultimate erosion of , denoted by . However, in practice, a segmentation driven by the ultimate erosion creates a very large number of connected components. As an illustration, Fig. 6(g) shows the ultimate erosion of the binary components of Fig. 6(b). The number of connected components can be reduced by computing the union of with the erosion of with a structuring element of size [denoted by ]. The set of markers is defined by . The erosion merges some connected components of the ultimate erosion. In particular, if , the markers are the connected components of itself, (the connected components are not broken), whereas if , the set of markers is the ultimate erosion, . Fig. 6(d) presents the set of markers resulting from an erosion with a structuring element of size 3 3. —Watershed Segmentation: Once the markers are defined, the watershed algorithm propagates them to precisely define the shape of the connected components. In [6] and [13], it is proposed to use one of the classical tools for binary segmentation that is to rely on the opposite of the distance function to perform the propagation. This segmentation is geometric, since it only takes into account the shape of . More formally, let us define the transformation that assigns to the catchment basin of the function that contains taking into account the markers . Consider now the operator if and if (5) This transformation reduces to the classical connected pointwise opening when . For , it only creates a pseudoconnectivity. Indeed, in that case, all conditions of Theorem 5 are met except one: is not increasing and therefore not an opening. This is a drawback but, using the watershed as segmentation tool, our main concern is to segment the components of in a small number of regions and to keep as much as possible the contour information of . Moreover, in practice for small values of , this theoretical problem does not prevent the creation of useful operators. This segmentation is illustrated in Fig. 6(e) and (h) for the two sets of markers and . As can be seen, for a small value of [Fig. 6(e)] the segmentation corresponds well to various objects of the scene. This is, however, not the case for high values of . In particular,
560 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 7, NO. 4, APRIL 1998 (a) (b) (c) (d) (e) (f) (g) (h) (i) Fig. 6. Segmentation of binary components. (a) Original. (b) Binary components ( X ) : (c) Distance function ( 0 Dist x ) : (d) Marker (erosion of size 3), ( M 3 ( X )) : (e) Geometric segmentation, Marker M 3 ( X ) : (f) Gray-level segmentation, Marker M 3 ( X ) : (g) Marker (ultimate erosion), ( M 1 ( X )) : (h) Geometric segmentation, Marker M 1 ( X ) : (i) Gray-level segmentation, Marker M 1 ( X ) : Fig. 6(h) shows the presence of contours that are not related to the scene content (contours inside the screen or the speaker on the right side). In [13], a modification of this approach was proposed to increase the robustness in the case of large values of . The idea was to compute the distance function not on but on the result of a closing by reconstruction of . In the following, we propose an alternative approach that consists in using the gray-level information on the support of and not its shape. To this end, one can simply replace the distance function used in by the gradient of the image defined on the support of : , where denotes the gradient of the original function . The set of markers is the same as previously, but the segmentation is gray-level oriented (in the sequel, this approach is called gray-level segmentation). The result obtained with this approach are illustrated on Fig. 6(f) and (i) As can be seen, differences are minor for low values of but quite significant for larger values. As mentioned in Section II, once the max-tree has been created by recursive use of binarization and connected components definition steps, a criterion is assessed for each node. If the criterion value is below a given threshold the node is removed and its pixels are moved toward the father node. Fig. 7 illustrates examples of area filtering [3] with three notions of connectivity. The area criterion consists in measuring the number of pixels of each connected component. The filter is an area open-close, that is, an area opening followed by an area closing.1The classical area open-close (4-connectivity) can be seen in Fig. 7(b). This example illustrates a typical leakage problem of connected operators. Small objects like the letters of the “MPEG4” word should have been removed. This is however not the case for example for the “G” and the “4” because there are thin connections between these letters 1If area ( f ) denotes the area opening, its dual is a closing defined by ' area ( f )= 0 area ( 0 f ) .
SALEMBIER et al.: ANTIEXTENSIVE CONNECTED OPERATORS 561 (a) (b) (c) (d) (e) Fig. 7. Area open-close (size = 100 ) for various strict connectivities. (a) Original. (b) Area open-close with 4-connectivity. (c) Connectivity by opening (3 2 3) [17]. (d) Pseudoconnectivity by geometric seg. ( t =3) : (e) Pseudoconnectivity by gray level seg. ( t =3) : (a) (b) (c) Fig. 8. Area open-close (size = 100 ) for connectivities defined by segmentation. (a) Connectivity by opening (20 2 20). (b) Pseudoconnectivity by geometric seg. ( l = 20) . (c) Pseudoconnectivity by gray level seg. ( l = 20) : and the shirt of the man. Using the classical connectivity, the operator processes the shirt and the “G” and “4” as a single object and the connected operator reconstructs “too much.” Fig. 7(c) gives the result obtained by the “segmentation by opening” with a structuring element of size 3 3. As mentioned previously, this approach does not preserve the contour information. Finally, Fig. 7(d) and (e) present similar results but with the “geometric” and the “gray-level segmentation by watershed” ( ). For low values of , both approaches lead to very similar results. In both cases, the leakage problem has disappeared. Thin connections between components are broken and the final result corresponds more to a “natural” size-oriented simplification. The examples of Fig. 8 illustrate the difference between the various segmentation approaches for high values of the parameters. The segmentation by opening (20 20) shown in Fig. 8(a) is useless. Comparison between the geometric [Fig. 8(b)] and the gray level [Fig. 8(c)] segmentation reveals that the gray-level approach is more robust and introduces fewer “false” contours. In this section, we have shown how to create (pseudo)connectivities that are more strict than classical ones. This approach allows the reduction of the leakage problem while preserving the main feature of the connected operators. However, in practice, this approach has to be used with care because it is, in some sense, in contradiction with the basic principle of connected operators, since it introduces new contours in the image. From our experience, this is not a drawback in practice if small values of are used, that is if only thin connections are split. In this case, new contours are indeed introduced in the image, but at very specific locations corresponding generally to transitions between two different objects. Note finally that in this case, gray-level and geometric segmentation results are almost equivalent. IV. FILTERING Once the max-tree has been created, the filtering step analyzes each node by measuring a specific criterion and takes a decision on the elimination or preservation of the node. A. Classical Criteria As examples, let us briefly recall some classical criteria used for the opening by reconstruction, the area opening,
562 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 7, NO. 4, APRIL 1998 and the - operator. In this section, we assume that the node is analyzed and we denote by the set of pixels belonging to and all its descendant nodes (in Section II, this notion has been used to explain the max-tree creation and the corresponding set of pixels was stored in a temporary node called ). •Opening by Reconstruction [1]: This filter preserves a node if the binary erosion of the set of pixels included in by a structuring element of size is not the empty set. This operator has a size-oriented simplification effect: it removes the bright components smaller than the structuring element. By duality, a closing by reconstruction can be defined. Its simplification effect is similar to that of the opening but on dark components. •Gray-Level Area Opening [3]: This filter has been used in Section III. It is similar to the previous one except that it preserves the if the number of pixels of is larger than a limit . It has also a size-oriented simplification effect, but the notion of size is different from the one used in the opening by reconstruction. By duality an area closing can be defined. •-Operator: The idea is to preserve if this node has at least one nonempty descendant node at level ( such that ). The simplification effect of this operator is contrast-oriented in the sense that it eliminates image components with a contrast lower than . The - is an operator and not a morphological filter because it is not idempotent. By duality, the - operator can be defined. All these operators are extensively used in practice. A large set of examples can be found in particular in [2], [3], [10], [18]–[20], and in the references they contain. B. Nonincreasing Criteria The classical criteria and the resulting operators are increasing. In the lattice framework, an operator is said to be increasing if it does not modify the order between any pair of elements of the lattice . In the context of connected operators, this property is directly related to the criterion assessed for each node. Assume that the node is a child node of (that is ). Because of the tree structure, we have the following relations: and . If the criterion is increasing, we have also . Let us analyze the effect of having an increasing or a nonincreasing criterion on the max-tree representation and on the decision process. Consider a maximum of the image, that is a leaf node of the max-tree, and the sequence of all its ancestor nodes going down to the root node. In the example of Fig. 9, if we start by the maximum corresponding to , the sequence is . Consider now the sequence of the criterion values obtained by scanning successively all the ancestors of a maximum. In the example of Fig. 9, the criterion sequence starting from is and is represented as a curve (function of ) on the right side. Note that the parameter Fig. 9. Max-tree and criterion sequence for each local maximum. itself is decreasing because the nodes are scanned starting for the maximum and going down to the root. If the criterion is increasing, the criterion sequence is itself increasing and there is no problem defining the level where the criterion is higher than a given limit . In this case, all nodes such that are removed and the corresponding pixels are moved to the first ancestor node such that . If the criterion is nonincreasing, the criterion sequence may fluctuate around the value and the definition of the set of nodes to remove is less straightforward. Three rules have been reported in the literature [9], [10], [21] to deal with the nonincreasing case, as follows: 1) “Direct” Decision: This is the most straightforward approach that consists in considering that a node is preserved if and only if . The content of the nodes that are removed are merged with their nearest preserved ancestors. This solution is illustrated in Fig. 10(b). In this figure, we show on the upper level, a simple gray-level function (input) and the corresponding output function. Components with a criterion value higher than are shown in dotted line on the output function. Components with a criterion value lower than are not shown. On the lower level of the figure, we show the evolution of the criterion sequence and the corresponding nodes (and therefore components) to be preserved. The “direct” approach has the advantage of being simple; however, in practice it is not robust because the decisions are local and do not depend on the decision of neighboring nodes (in the case of an increasing criterion, the decision is also local but, because of the increasing property, the relation between the decisions on various levels is known). 2) “Min” Decision: A node is preserved if and if all its ancestors are also preserved. This rule preserves less nodes than the first one. It is illustrated in Fig. 10(a). 3) “Max” Decision: The last rule is the dual of the previous one: a node is removed if and if all its descendant nodes are also removed [see Fig. 10(c)]. From our practical experience, the min and max rules are generally more robust and lead to more coherent decisions. The direct decision is the less robust approach and gives noisy results (presence of isolated small connected components that should “intuitively” be removed but are not). However, this
SALEMBIER et al.: ANTIEXTENSIVE CONNECTED OPERATORS 563 (a) (b) (c) Fig. 10. Illustration of various decision rules in the case of nonincreasing criterion. (a) “Min” decision. (b) “Direct” decision. (c) “Max” decision. Fig. 11. Trellis construction for the decision in the case of a single branch tree. conclusion is highly influenced by the type of criterion and its “degree of nonincreasingness.” In [7], an improvement of the decision robustness is proposed. It consists in filtering the decision sequence, for example, with a median filter. This solution actually provides more robustness, however, in the following, a different solution is proposed. It turns out to be much more robust than any of the previous ones. It relies on a formulation of the decision process as an optimization problem. For each node , a binary decision, preserve or remove, has to be taken. Assume that a decision cost is assigned to each possible decision and to each node. In this case, the decision problem can naturally be seen as finding the set of lowest cost paths that go from the leaves of the tree down to the root node. Let us describe this approach in detail with a simple tree involving a single branch as shown in Fig. 11. First, assign to each node of the max-tree two states, and , describing the two possible decisions, “preserve” or “remove.” Second, a trellis is constructed, as shown in Fig. 11, by creating transitions linking the possible decisions of one node and of its father. Between and , there are four possible transitions: ,,, and . Furthermore, a cost is assigned to each transition. The same cost is assigned to the two transitions going to a preserve state. This cost should reflect the reliability of the preserve decision for that node. This reliability can be measured for example by the difference between the decision threshold and the criterion value (if the reliability is very high, the cost is very low). In the case of a transition emanating from a remove state and going to a remove state, the situation is similar and the value can be assigned as transition cost. This is, however, not the case for the transition emanating from a preserve state and coming to a remove state. Indeed, these transitions should be avoided because we want to define a level above which all nodes are removed and below which all nodes are preserved. We choose this strategy to get back to the situation where the criterion is indeed increasing. These transitions can be eliminated if an infinite cost is assigned to them. Now, the decision consists in finding in this trellis, the path of lowest cost that starts from the maximum and ends in the preserve state of the root node (at least, the root node should be preserved). The cost of a path is defined as the sum of the costs of its transitions. This formulation is a classical dynamic programming problem that can be very efficiently solved by the Viterbi algorithm [22]. Let us briefly describe this algorithm: assume that the two optimum (lowest cost) paths starting from the maximum and ending at and are known. Let us call Path and Path these two optimum paths. The definition of the two optimum paths ending at and can be easily defined by a local decision. For example, the optimum path ending in , that is Path , is defined by the following rule: If Cost Path Cost Cost Path Cost then Path Path else Path Path (6)
570 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 7, NO. 4, APRIL 1998 conclusions, if a fast implementation of the max-tree creation (as the one proposed in Fig. 22) is used and if the criterion can be computed recursively, the computation time devoted to the whole filtering process is of the order of a few seconds on a Sun-Sparc 10 (256 256 images). REFERENCES [1] J. C. Klein, “Conception et r´ ealization d’une unit´ e logique pour l’analyze quantitative d’images,” Ph.D. dissertation, Nancy Univ., France, 1976. [2] L. Vincent, “Morphological gray scale reconstruction in image analysis: Applications and efficient algorithms,” IEEE Trans. Image Processing, vol. 2, pp. 176–201, Apr. 1993. [3] , “Grayscale area openings and closings, their efficient implementation and applications,” in Proc. 1st Workshop on Mathematical Morphology and Its Applications to Signal Processing, J. Serra and P. Salembier, Eds., Barcelona, Spain, May 1993, pp. 22–27. [4] M. Grimaud, “A new measure of contrast: The dynamics,” in Proc. SPIE Visual Communications and Image Processing’92, San Diego, CA, July 1992, vol. SPIE 1769, pp. 292–305. [5] C. Vachier, Extraction de caract´eristiques, segmentation d’image et morhpologie math´ematique, Ph.D. dissertation, Paris School of Mines, France, 1995. [6] A. Oliveras and P. Salembier, “Generalized connected operators,” in Proc. Visual Communication and Image Processing, Orlando, FL, Mar. 1996, vol. 2727, pp. 761–773. [7] P. Salembier, A. Oliveras, and L. Garrido, “Motion connected operators for image sequences,” in Proc. EUSIPCO’96, Trieste, Italy, vol. II, pp. 1083–1086. [8] E. Breen and R. Jones, “An attribute-based approach to mathematical morphology,” in Proc. Int. Symp. Mathematical Morphology, P. Maragos, R. W. Schafer, and M. A. Butt, Eds. Atlanta, GA, May 1996, pp. 41–48. [9] J. Serra and P. Salembier, “Connected operators and pyramids,” in Proc. Conf. Image Algebra and Mathematical Morphology, San Diego, CA, July 1993, vol. 2030, pp. 65–76. [10] P. Salembier and J. Serra, “Flat zones filtering, connected operators and filters by reconstruction,” IEEE Trans. Image Processing, vol. 3, pp. 1153–1160, Aug. 1995. [11] J. Crespo, J. Serra, and R.W. Schafer, “Theoretical aspects of morphological filters by reconstruction,” Signal Process., vol. 47, pp. 201–225, 1995. [12] J. Serra, “Connectivity on complete lattices,” in Proc. Int. Symp. on Mathematical Morphology, P. Maragos, R. W. Schafer, and M. A. Butt, Eds., Atlanta, GA, May 1996, pp. 81–96. [13] P. Salembier and A. Oliveras, “Practical extensions of connected operators,” in Proc. Int. Symp. Mathematical Morphology,, P. Maragos, R. W. Schafer, and M. A. Butt, Eds., Atlanta, GA, May 1996, pp. 97–110. [14] J. Crespo, “Space connectivity and translation-invariance,” in Proc. Int. Symp.on Mathematical Morphology, P. Maragos, R. W. Schafer, and M. A. Butt, Eds., Atlanta, GA, May 1996, pp. 118–126. [15] F. K. Potjer, “Region adjacency graphs and connected morphological operators,” in Proc. Int. Symp. on Mathematical Morphology, P. Maragos, R. W. Schafer, and M. A. Butt, Eds., Atlanta, GA, May 1996, pp. 111–118. [16] J. Serra, Image Analysis and Mathematical Morphology, vol. II: Theoretical Advances. New York: Academic, 1988. [17] C. Ronse, “Set-theoretical algebraic approaches to connectivity in continuous or digital spaces,” J. Math. Imaging Vis., vol. 8, pp. 41–58, 1997. Also available at http://dpt-info.u-strasbg.fr/ ronse/. [18] F. Meyer and S. Beucher, “Morphological segmentation,” J. Vis. Commun. Image Represent., vol. 1, pp. 21–46, Sept. 1990. [19] P. Salembier and M. Kunt, “Size-sensitive multiresolution decomposition of images with rank order based filters,” in EURASIP Signal Process., vol. 27, pp. 205–241, May 1992. [20] P. Salembier, L. Torres, F. Meyer, and C. Gu, “Region-based video coding using mathematical morphology,” Proc. IEEE, vol. 83, pp. 843–857, June 1995. [21] H. Heijmans, “Theoretical aspects of gray level morphology,” IEEE Trans. Pattern Anal. Machine Intell., vol. 13, pp. 568–592, 1991. [22] A. J. Viterbi and J. K. Omura, Principles of Digital Communications and Coding, New York: McGraw-Hill, 1979. [23] R. C. Gonzalez and R. E. Woods, Digital Image Processing. Reading, MA: Addison-Wesley, 1992. [24] J. Serra, “Toggle mappings,” in From Pixels to Features, J. C. Simon, Ed. Amsterdam, The Netherlands: North Holland, 1989, pp. 61–72. Philippe Salembier (M’96) received the engineering degree from the Ecole Polytechnique, Paris, France, in 1983, the engineering degree in telecommunications from the Ecole Nationale Superieure des Telecommunications, Paris, in 1985, and the Ph.D. degree from the Swiss Federal Institute of Technology (EPFL), Lausanne, in 1991. From 1985 to 1989, he was with Laboratoires d’Electronique Philips, Limeil-Brevannes, France, working in digital communications and signal processing for HDTV. In 1989, he joined EPFL to work on image processing. He was a Post-doctoral Fellow at the Harvard Robotics Laboratory, Cambridge, MA, in 1991. At the end of 1991, after a stay at the Harvard Robotics Laboratory, he joined the Polytechnic University of Catalonia, Barcelona, Spain, where he teaches digital signal and image processing. His current research interests include image and sequence coding, image modeling, segmentation problems, video sequence analysis, mathematical morphology, and nonlinear filtering. Dr. Salembier is currently serving as an Area Editor of the Journal of Visual Communication and Image Representation and as an AdCom Officer of the European Association for Signal Processing (EURASIP) in charge of the newsletter. Albert Oliveras (M’82) received the Tech. Eng. degree in 1983 and the M.S. degree in computer science in 1989, both from the Universitat Polit´ ecnica de Catalunya (UPC) in Barcelona. From October 1989 to September 1992, he was Assistant Professor of computer architecture and technology, Computer Science Faculty, UPC. In October 1992, he joined the Signal Theory and Communications Department, UPC. His current research interests include nonlinear image and signal processing and mathematical morphology. Luis Garrido received the engineering degree in telecommunications in 1996 from Universitat Polit´ ecnica de Catalunya (UPC), Barcelona, Spain. He is currently pursuing the Ph.D. degree at the Image Processing Group, UPC, dealing with video sequence segmentation. His current areas of interest are graph-based segmentation, morphological filtering, and computer vision.