summer school · zakopane, poland pro cess: x is sifted through a series of siev es with increasing...

97

Upload: others

Post on 17-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Lecture Notes on

Granulometries, Segmentation, and Morphological Algorithms

Luc VincentXerox Desktop Document Systems9 Centennial Drive, Peabody MA 01960USA

[email protected]

Contents

I Granulometries: Algorithmsand Applications 3

1 Fast Opening Functions and Mor-phological Granulometries 31.1 Introduction . . . . . . . . . . . . . 31.2 Background, Previous Work . . . . 6

1.3 Linear Granulometries in BinaryImages . . . . . . . . . . . . . . . . 6

1.4 Granulometry Functions on Bi-nary Images . . . . . . . . . . . . . 8

1.5 Grayscale Granulometries . . . . . 12

1.6 Conclusion . . . . . . . . . . . . . 17

2 Fast Grayscale Granulometry Algo-rithms 172.1 Introduction, State of the Art . . . 202.2 Linear Granulometries . . . . . . . 21

2.3 Granulometries with Maxima ofLinear Openings . . . . . . . . . . 22

2.4 Conclusion . . . . . . . . . . . . . 24

II Watersheds and Segmenta-tion 28

3 Introduction, Morphological Seg-mentation 28

4 Binary and Grayscale Particle Seg-mentation 284.1 Introduction to Morphological

Segmentation . . . . . . . . . . . . 28

4.2 Maximal Balls, Skeletons, Ulti-mate Erosions . . . . . . . . . . . . 314.2.1 De�nitions . . . . . . . . . 314.2.2 Quench Function . . . . . . 344.2.3 Ultimate Erosion and Dis-

tance Function . . . . . . . 374.2.4 Skeleton by In uence Zones 42

4.3 Geodesic Transformations . . . . . 424.3.1 Introduction, Geodesic

Distances . . . . . . . . . . 424.3.2 Geodesic Dilations and

Erosions . . . . . . . . . . . 454.3.3 Reconstruction and Appli-

cations . . . . . . . . . . . . 454.3.4 Grayscale Reconstruction . 454.3.5 Binary Segmentation . . . . 48

4.4 Watersheds and Grayscale Seg-mentation . . . . . . . . . . . . . . 504.4.1 Deriving a General Seg-

mentation Approach . . . . 504.4.2 The Electrophoresis Example 564.4.3 Di�cult Segmentations,

Recent Developments . . . 58

5 Conclusions 62

III Morphological Algorithms 64

6 Introduction 646.1 Discrete images and grids, notations 656.2 The distance function . . . . . . . 656.3 Estimating the quality of a mor-

phological algorithm . . . . . . . . 656.4 Image structures and how to access

them . . . . . . . . . . . . . . . . . 69

Page 2: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

7 Parallel Algorithms 69

8 Sequential Algorithms 70

9 Loop and Chain Algorithms 75

10 Algorithms Based on Queues of Pix-els 81

11 Conclusion and Summary 88

2

Page 3: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Part I

Granulometries:

Algorithms and

Applications

This part is derived from \Fast Open-ingFunctions and Morphological Granu-lometries", Proc. SPIE Vol. 2300,Image Algebra and Morphological Im-age Processing V, San Diego, July1994, pages 253{267 (see [134]) and\Fast Grayscale Granulometry Algo-rithms", Proc. EURASIP WorkshopISMM'94, Mathematical Morphologyand its Applications to Image Process-ing, J. Serra & P. Soille Eds., KluwerAcademic Publishers, September 1994(see [133]).

1. Fast Opening Functions and Morpho-logical Granulometries

Abstract

Granulometries constitute one of the most use-ful and versatile sets of tools of morphological im-age analysis. They can be applied to a wide rangeof tasks, from feature extraction, to texture char-acterization, to size estimation, to image segmen-tation, etc. However, traditional granulometryalgorithms|involving sequences of openings orclosings with structuring elements of increasingsize|are prohibitively costly on non-specializedhardware. This problem has prevented granu-lometries from reaching a high level of popularityin the image analysis community.In this part, a comprehensive set of fast algo-

rithms for computing granulometries in binaryimages is �rst proposed: linear granulometries(i.e., granulometries based on openings with linesegments) constitute the easiest case, and arecomputed using image \run-length". The 2-Dcase (granulometries with square or \diamond"-shaped structuring elements, or granulometries

with unions of line-segments at di�erent orienta-tions) involves the determination of opening func-tions or granulometry functions. The grayscalecase is then addressed, and a new algorithm forcomputing grayscale linear granulometries is in-troduced. This algorithm is orders of magnitudefaster than any previously available technique.The techniques introduced in this part open upa new range of applications for granulometries,examples of which are described in the part.

1.1. IntroductionThe concept of granulometry was introduced

by G. Matheron in 1967 [65] as a new tool forstudying porous media. The size of the pores insuch media was characterized using series of open-ings with structuring elements of increasing size[100]. The theoretical study of these operationsled Matheron to propose the following de�nition:

De�nition 1 Let � = (��)��0 be a family of im-age transformations depending on a unique pa-rameter �. This family constitutes a granulome-try if and only if the following properties are sat-is�ed:

8� � 0; �� is increasing; (1)

8� � 0; �� is anti-extensive; (2)

8� � 0; � � 0; ���� = ���� = �max(�;�) (3)

Property (3) implies that for every � � 0, �� is anidempotent transformation. Therefore, (��)��0is nothing but a decreasing family of algebraicopenings [100]. Conversely, one can prove that forany convex set B, the family of the openings withrespect to �B = f�b j b 2 Bg, � � 0, constitutesa granulometry [66].More intuitively, suppose now that the trans-

formations considered are acting on discrete bi-nary images, or sets. In this context, a granulom-etry is a sequence of openings �n, indexed on aninteger n � 0. Each opening is smaller than theprevious one:

8X; 8n � m � 0; �n(X) � �m(X): (4)

The granulometric analysis of X with family ofopenings (�n)n�0 is often compared to a sifting

3

Page 4: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

process: X is sifted through a series of sieves withincreasing mesh size. Each opening (correspond-ing to one mesh size) removes more than the pre-vious one, until the empty set is �nally reached.The rate at which X is sifted is characteristic ofthis set and provides a \signature" of X with re-spect to the granulometry used. Denote by m(A)the measure of a set A (area or number of pixelsin 2-D, volume in 3-D, etc):

De�nition 2 The granulometric curve or pat-tern spectrum [61] of a set X with respect toa granulometry � = (�n)n�0 is the mappingPS�(X) given by:

PS�(X)(n) = m(�n(X))�m(�n�1(X)): (5)

Since (�n(X))n�0 is a decreasing sequence ofsets (�0(X) � �1(X) � �2(X) � � � �), it ispossible to condense its representation by in-troducing the concept of granulometry function[57, 136, 44]:

De�nition 3 The granulometry function oropening function G�(X) of a binary image X forgranulometry � = (�n)n�0 maps each pixel x 2X to the size of the �rst n such that x 62 �n(X):

G�(X)(x) = minfn > 0 j x 62 �n(X)g: (6)

For any n > 0, the threshold of G�(X) above avalue n is equal to �n(X):

�n(X) = fp 2 X j G�(X)(p) > ng:

The following property follows immediately andstates that the pattern spectrum can be obtainedas histogram of the granulometry function:

Proposition 4 The pattern spectrum PS�(X) ofX for granulometry � = (�n)n�0 can be derivedfrom the granulometry function G�(X) as fol-lows:

PS�(X)(n) = cardfp j G�(X)(p) = ng; (7)

where card stands for the cardinal (number of pix-els) in a set.

The concept of granulometry function is centralto the algorithms described in section 1.4. An

example of square granulometry function is shownin Fig. 1.The granulometries that have been described

so far are often referred to as granulometries byopenings. By duality, granulometries by closingcan also be de�ned [136]; the granulometric anal-ysis of a set X with respect to a family of closingsis strictly equivalent to the granulometric anal-ysis of XC (complement of X) with the familyof dual openings. Therefore, from now on, onlygranulometries by openings are considered. Sim-ilarly, these notions can be directly extended tograyscale images; in this context, the measure mchosen is the \volume" of the image processed,i.e. the sum of all its pixel values.The granulometric analysis of Fig. 1a with re-

spect to a family of openings with squares (aswas used for Fig. 1) is shown in Fig. 2. Fromthe observed pattern spectrum, the typical sizeof the beans (as size of the largest square a beancan contain) in this image can easily be derived.Granulometries therefore allow one to extract sizeinformation without any need for prior segmen-tation: the beans in this image are highly over-lapping, yet their size can be estimated withoutindividually identifying each bean.Granulometries have been used for a variety

of other image analysis tasks, including shapecharacterization and feature extraction (see forexample [144]), texture classi�cation (see [25]),and even segmentation (see for example [31] andFig. 3). Nonetheless, until recently, granulomet-ric analysis involved performing a series of open-ings and/or closings of increasing size, which isprohibitively expensive for most applications, un-less dedicated harware is used.In the next section, we �rst brie y review the

literature on granulometry algorithms. A com-prehensive set of fast binary granulometry algo-rithms is then proposed: section 1.3 is concernedwith the simple case of linear granulometries. Insection 1.4, more complex cases, such as granu-lometries with squares, are discussed. The cor-responding algorithms involve the determinationof granulometry functions, for which fast algo-rithms are proposed. Following prop. 4's result,pattern spectra are then derived by simple his-togramming,

4

Page 5: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b) (c)

Figure 1. (a) original binary image of co�ee beans, (b) square granulometry function of this image, inwhich dark regions correspond to higher pixel value (c) level lines of the granulometry function.

0

1000

2000

3000

4000

5000

6000

0 5 10 15 20 25 30

(a) (b)

Figure 2. (a) Successive openings of a Fig. 1 using squares of increasing size as structuring elements. (b)Corresponding granulometric curve, or pattern spectrum: the peak at size 20 is indicative of the typicalsize of the beans in original image.

5

Page 6: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Lastly, the grayscale case is considered in sec-tion 1.5 a new algorithm is introduced for com-puting linear grayscale granulometries. The algo-rithm is several orders of magnitude faster thanany previouly available technique. It makes ittherefore possible to use granulometries wherepreviously unthinkable. We illustrate this pointby using this new algorithm to e�ciently extractsize information directly from a grayscale image.

1.2. Background, Previous WorkThe literature on mathematical morphology is

not short of algorithms for computing erosionsand dilations, openings and closings, with variousstructuring elements, in binary and in grayscaleimages. Reviewing them would be beyond thescope of this part. But no matter how e�cientan opening algorithm is used, determining a pat-term spectrum using a sequence of openings isa very time-consuming task given the number ofoperations involved. Furthermore, since the sizeof the structuring element increases with n, sodoes the computation time of the correspondingopening. Even if we assume that the computationtime of �n(X) (n-th opening in the series) can bedone in constant time (which is not always truedepending on the structuring element and on theopening algorithm used), determining the patternspectrum up to size n using openings is still anO(n) algorithm.The few granulometry algorithms found in lit-

erature only deal with the binary case, and havein common the use of granulometry functions asan intermediate step. The algorithm proposed byYuan [145] for determining binary square granu-lometries consists in �rst determining the quenchfunction of the original set X . The quench func-tion maps each pixel p of the skeleton (medialaxis) SX of X to the size (radius) SX(p) of thecorresponding maximal square. An example isshown in Fig. 4 (See [124] for more details onthese concepts). In a second step, each pixelp of the skeleton is replaced by a square cen-tered at this pixel, with size SX(p), and gray-level SX(p) + 1. The pixelwise maximum of allthese squares provides the granulometry functionofX . This algorithm is faster than the brute forcemethod described in the previous paragraph, but

still requires a signi�cant amount of image scans.In addition, the more complicated the image orthe larger the objects in it, the longer this methodtakes.Suprisingly, a better algorithm can be found

in an earlier paper by La�y [57], in which the au-thor devotes a few lines to the description of asequential algorithm [88, 127] based on the dis-tance function [89, 20], and also using the gran-ulometry function as an intermediate step. Thisalgorithm still provides one of the most e�cientimplementations to date for binary granulome-tries with structuring elements such as squaresand hexagons. In section 1.4, this technique isfor the �rst time described in detail, and is ex-tended to other types of binary granulometries.The algorithm proposed in 1992 by Haralick et

al is interesting in that it allows in principle tocompute granulometry functions with respect toany family of homothetic elements1. However, forsimple structuring elements such as squares, thistechnique is not as e�cient as the one mentionedin the previous paragraph, because its elemen-tary steps (propagation and merging of lists of\propagators") are rather computationally inten-sive, therefore relatively slow.

1.3. Linear Granulometries in Binary Im-ages

Linear granulometries in binary images con-stitute the simplest possible case of granulome-tries. Let us for example consider the horizontalgranulometry, i.e., the granulometry by openingswith the (Ln)n�0 family of structuring elements,where:

Ln = � � � . . . � �| {z }n+1 pixels

(8)

From now on, we use the convention that the cen-ter of a structuring element is marked using athicker dot than is used for the other pixels. Notethat the location of the center of the structuringelements used has no in uence on the resultinggranulometry.Let us analyze the e�ect of an opening by Ln,

n � 0 on a discrete set X (binary image). The

1The base element does not even have to be convex!

6

Page 7: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) original image (b) segmented image

Figure 3. Segmentation of tri-phased binary texture using local granulometric moments (from [31]).

Figure 4. Quench function of Fig. 1a, dilated for clarity; dark skeleton pixels correspond to large valuesof the quench function.

7

Page 8: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

following notations are used from now on: theneighbors of a given pixel p in the square grid aredenoted N0(p), N1(p),. . . , N7(p), and the eightelementary directions are encoded in the followingway:

� 0

123

4

5 6 7

For a direction d 2 f0; 1; : : : ; 7g and k � 0, we

denote byN(k)d (p) the k-th order neighbor of pixel

p in direction d:

N(0)d (p) = p; and k > 0 =)

N(k)d (p) = Nd(N

(k�1)d (p)): (9)

The opposite of direction d is denoted �d. Forexample, if d = 3, then �d = 7.

De�nition 5 The ray in direction d at pixel p inset X is given by:

rX;d(p) = fN(k)d (p) j k � 0 and

80 � j � k;N(j)d (p) 2 Xg: (10)

With each pixel p 2 X , we also associate a runin direction d, de�ned as the union of the rays indirection d and in direction �d.

De�nition 6 The run in direction d at pixel p inset X is given by:

RX;d(p) = rX;d(p) [ rX; �d(p): (11)

The number of pixels in a run R will be calledlength of this run and denoted l(R).The following proposition is immediate:

Proposition 7 The opening of X by Ln, de-noted X �Ln, is the union of the horizontal runsRX;0(p) whose length is strictly greater than n:

X � Ln =[p2X

fRX;0(p) j l(RX;0(p)) > ng: (12)

Therefore, any horizontal run of length n is leftunchanged by all the openings with Lk, k < n,and is removed by any opening with Lk, k � n.Hence, the corresponding pattern spectrum PS0satis�es:

PS0(X)(n) = cardfp 2 X j l(RX;0(p)) = ng:(13)

An extremely e�cient 1-scan horizontal granu-lometry algorithm is easily derived from this for-mula:

Algorithm: horizontal binary granulometry� Initialize pattern spectrum: for

each n > 0, PS[n] 0

� Scan each line of image from left

to right.

� In this process, each time a run Ris discovered, do:

PS[l(R)] PS[l(R)] + l(R);

In applications where directional informationis of interest, this algorithm provides a very use-ful and e�cient way to extract size informationcharacterizing the image under study. Considerfor example Fig. 5a, which is a binary image oflamellar eutectics; In [95], M. Schmitt proposeda variety of methods for extracting the defectlines present in this image. Di�erent methodsused di�erent kind of information about this im-age, and some required a knowledge of the typicalwidth of the lamellae. This width can be accu-rately estimated by adapting the previous algo-rithm to the computation of linear granulome-tries at +45 degree orientation (direction perpen-dicular to the lamellae). The resulting patternspectrum is shown in Fig. 5b, and its peak at 3indicates that the typical width of the lamellae isof 3 pixels.

1.4. Granulometry Functions on BinaryImages

For non 1-D granulometries, the direct ap-proach described in the previous section becomesintractable. Consider for example the case of agranulometry (�n)n�0 where �n is a maximumof openings with the horizontal segment Ln andits vertical counterpart L?n . For each pixel, it be-comes necessary to know the size of the horizontalrun as well as the vertical run it belongs to.Linear granulometry functions are therefore the

required step. Given the horizontal and the verti-cal granulometry functions of X , the granulome-try function of X corresponding to the (�n)n�0 ofprevious paragraph is simply obtained as a pixel-wise maximum. More generally, the same is true

8

Page 9: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

0

2000

4000

6000

8000

10000

12000

14000

16000

18000

0 2 4 6 8 10 12 14 16

(a) (b)

Figure 5. Binary image of lamellar eutectics (a) and its granulometric curve using line segments at +45degrees orientation (b)

for any two granulometry functions, and the fol-lowing proposition can be stated:

Proposition 8 Let� = (�n)n�0 and = ( n)n�0 be two granu-lometries. Then, max(�;) = (max(�n; n))n�0is also a granulometry and for any set X:

Gmax(�;)(X) = max(G�(X); G (X)): (14)

Determining the linear granulometry functionof a binary image is a relatively straightforwardtask. Take for example the horizontal case: likein previous section, the principle of the granulom-etry function algorithm is to locate each horizon-tal run. But now, in addition, each run R getsalso tagged with its length l(R). This involvesscanning the black pixels of the image twice, andthe white pixels only once. The resulting algo-rithm, hardly more time consuming than the onedescribed in the previous section, is given below.

Algorithm: horizontal granulometry function

� Scan each line of original binary

image I from left to right:

� p first black pixel of

current line, or

end-of-current-line if line is

empty;

� while p < end-of-current-line,

do

� p first black pixel

Examples of linear granulometry functions areshown in Fig. 6 and in Fig. 7.The case of truly 2-D binary granulometry

functions is the next level up in complexity. In therest of this section, we �rst focus on granulome-try functions GS(X) based on openings with thehomothetics of elementary square S, then we dealwith the case of granulometry functions GD(X)based on the elementary \diamond" shape D.

S =� �

� ��; D =

� � �

(15)

Together with the linear case, these granulome-tries cover 99% of all practical needs.Like Haralick's algorithm [44], the �rst step of

the present one consists in computing what some

9

Page 10: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 6. Linear granulometry function of image 5(a), whose histogram directly provides the curve ofFig. 5(b).

(a) (b) (c)

Figure 7. (a) Horizontal granulometry function; (b) vertical granulometry functions. (c) Pointwisemaximum of these two images provides the granulometry function corresponding to maxima of openingswith vertical and horizontal line segments.

10

Page 11: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

authors have called a generalized distance func-tion [3, 45]. Let B be an arbitrary structuringelement containing its center. Let

nB = B �B � � � �B| {z }ntimes

denote the structuring element \of size n". Letalso "B denote the erosion by structuring elementB [100]:

"B(X) = X �B:

De�nition 9 The generalized distance functiondB(X) with respect to the family of structuringelements (nB)n>0 assigns to each pixel p 2 Xthe smallest k > 0 such that p 62 "kB(X):

dB(X)(p) = minfk > 0 j p 62 "kB(X): (16)

Generalized distance functions are determinedusing sequential algorithms that are straightfor-wardly derived from the original algorithm pro-posed by Rosenfeld [88, 89]. When the centerof the structuring element is in the bottom-rightcorner of element B (last pixel met in a raster-order scan of this element), the distance functiondB(X) can be computed in one single raster scan.In the case where B = S (see Eq. (15)), the

following algorithm can be proposed:

Algorithm: Generalized dist. func. with square S� Input: binary image I of set X

� Scan I in raster order;

� Let p be the current pixel;

� if I(p) = 1 (p is in X):

I(p) minfI(N4(p)); I(N3(p)); I(N2(p))g+1;

An example of generalized distance function re-sulting from this algorithm is shown in Figs. 8a{b. A way to interpret the result is to say that,for each pixel p, if one was to translate struc-turing element [dS(X)(p)]S so that its center co-incides with p, this translated element|denotedp + [dS(X)(p)]S|would be entirely included inX . However, p + [dS(X)(p) + 1]S 62 X . We cantherefore state the following proposition:

Proposition 10 The granulometryfunction GS(X) is obtained from dS(X) as fol-lows:

8p 2 X; GS(X)(p) = maxfdS(X)(q) j

p 2 (q + dS(X)(q)S)g: (17)

In algorithmic terms, we can compute GS(X) bypropagating the value dS(X)(p) of each pixel pover the square p+dS(X)(p)S, and then by takingthe pixelwise maximum of the values propagatedat each pixel.In the technique proposed by Haralick et al

[44], this propagation step is achieved via an anti-raster scan of the distance function image, inwhich, at each pixel, a list of propagated values ismaintained. In the particular case of square gran-ulometry functionGS(X), computing the value atpixel p as well as the list of propagated values atp, requires a merging of the lists of propagatedvalues at pixels N0(p), N6(p), and N7(p).This merging step turns out to be expensive,

and in the case of square granulometry functionGS(X), a less general, but much more e�cienttechnique can be proposed. This technique takesadvantage of the fact that square S can be de-composed into the Minkowski addition of the twoelementary line segments E1 and E2:

S =� �

� ��=� �

��

= E1 �E2 (18)

Therefore, the complex propagation step of thegranulometry function algorithm described in [44]can in fact be decomposed into two much simplerpropagations, with substantial speed gain. Thedistance function extraction step is followed bytwo linear propagation steps that are identical,except that one propagates distance values left-ward in each line, whereas the other one propa-gates values upward in each column.The algorithm for right-to-left propagation of

distance values is given below. Its principle isto propagate each pixel value I(p) to the leftI(p) � 1 times, or until a larger value v is found,in which case the list of propagated values is resetto this value. . . The algorithm maintains an arraypropag containing the number of times each valueremains to be propagated.

Algorithm: Left propag. of dist. values of dS(X)

11

Page 12: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

� Input: image I of the generalized

distance function dS(X);

� For each line of the image, do:

� Initializations: maxval 0(current maximal value

propagated);

� Scan line from right to left:

Let p be the current pixel;

If I(p) 6= 0:If I(p) > maxval:

maxval I(p);propag[I(p)] I(p);80 < i <=

maxval; propag[i] propag[i]� 1;maxval largest

i � maxval such that

propag[i] >= 0;I(p) maxval

A few implementation tricks can speed up com-putation by substantially reducing the number oftimes the entire array propag is scanned per scan-line. Their description would be beyond the scopeof this part. The resulting algorithm is quasi-linear with respect to the number of pixels in theimage, and is almost independent of object size(see Table. 1). Using again the co�ee bean imageas running example, the result of this propagationstep is shown in Figs. 8c{d, and the �nal granu-lometry function obtained after upward propaga-tion in each column is shown in Figs. 8e{f.This algorithm can be adapted for granulome-

try functions with any structuring element thatcan be decomposed as a Minkowski addition ofthe elementary line segments E1, E2, E3, and E4

(See Eqs. (18) and (19)). Furthermore, it extendsto the computation of hexagonal opening func-tions in the hexagonal grid [57].In square grids however, the elementary \dia-

mond" structuring element D cannot be decom-posed as Minkowski addition of elementary linesegments. The closest \approximation" is ob-tained with:

D =

� � �

6=

� � �

= E3 �E4; (19)

and does not contain the central pixel of D!

Therefore, starting from distance function dS(X)and using the propagation algorithm in theSouthwest-Northeast (SW-NE) direction, then inthe Southeast-Northwest (SE-NW) direction re-sults in an incorrect propagation function, as il-lustrated by Fig. 9. Correct \diamond" granu-lometry functions can nevertheless be obtainedwith this technique if SW-NE and SE-NW prop-agation steps are followed by a \hole-�lling" stepin which each pixel p such that

8i 2 f0; 2; 4; 6g; I(Ni(p)) = I(p) + 1

is given value I(p)+1. An example of such gran-ulometry function is shown in Fig. 10.Table 1 summarizes the speed of these granu-

lometry functions on the 256 � 256 co�ee beanimage used as running example. We chose notto compare these timings with those of tradi-tional opening-based algorithms. The speed ofthe latter algorithms can indeed vary tremen-dously depending on the quality of the implemen-tation. Note however that for this co�ee bean im-age, which has approximately 30000 black pixels,Haralick's algorithm [44] takes between 0.5s and0.6s to compute the square granulometry func-tion shown in Fig. 8e, on a Sparc Station 2. Thisworkstation being between two and three timesslower than a Sparc Station 10, we can concludethat the algorithm proposed in the present partis between three and four times faster.

1.5. Grayscale GranulometriesGrayscale granulometries are potentially even

more useful than binary ones, because they en-able the extraction of information directly fromgrayscale images. A number of theoretical re-sults have been published on them (see e.g. [52]);however, since until today, no e�cient techniquewas available to compute grayscale granulome-tries, they have not been used very much in prac-tice. In this section, we remedy this situation andintroduce a new algorithm for computing lineargrayscale granulometries. A follow-up to this partdescribes this algorithm in greater detail, and alsodeals with the case of truly 2-D grayscale granu-lometries [133].Like in section 2.2, let us for example deal with

the horizontal case. The structuring elements

12

Page 13: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b) (c)

(d) (e) (f)

Figure 8. Computation of granulometry function using square structuring elements. (a) generalizeddistance function; (b) level lines; (c) propagation of values from right to left; (d) level lines; (e) �nalgranulometry function; (f) level lines of granulometry function.

(a) Original shape (b) Distance function (c) SW to NE propagation(d) SE to NW propagation

Figure 9. When using \diamonds" as structuring elements, the two propagation steps of the granulometryfunction algorithm need to be followed by a \hole-�lling" step.

13

Page 14: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b) (c)

Figure 10. Computation of granulometry function using \diamond" structuring elements. (a) level linesof generalized distance function; (b) level lines of relief obtained after SW to NE propagation; (c) levellines of �nal granulometry function

Table 1Execution time of various granulometry function algorithms on the 256�256 co�ee bean image, measuredon a Sun Sparc Station 10 workstation.

Type of granulometry function Execution time

horizontal 0.018smax in 4 directions 0.207s

square 0.085s\diamond" 0.094s

14

Page 15: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

considered are the Ln's of equation (8). Let Ibe a discrete grayscale image.

De�nition 11 A horizontal maximum M oflength l(M) = n in grayscale image I is a

set of pixels fp;N(1)0 (p); N

(2)0 (p); : : : ; N

(n�1)0 (p)g

such that

8i; 0 < i < n; I(N(i)0 (p)) = I(p) and

I(N4(p)) < I(p); I(N(n)0 (p)) < I(p): (20)

The study of how such maxima are alteredthrough horizontal openings is at the basis of thealgorithm introduced here. The following propo-sition holds:

Proposition 12 Let M be a horizontal maxi-mum of I. Let pl 2 M and pr 2 M respectivelydenote the extreme left pixel and the extreme rightpixel of M . Let n = l(M) be the length of thismaximum. Then, for any p 2M :

8k < n; (I � Lk)(p) = I(p); (21)

for k = n; (I � Ln)(p) = maxfI(N4(pl));

I(N0(pr))g < I(p); (22)

8k > n; (I � Lk)(p) < I(p): (23)

Intuitively, this means that any opening of Iby a line segment Lk such that k < n leaves thismaximum unchanged, whereas for any k >= n,all the pixels of M have a lower value in I � Lkthan in I . Furthermore, we can quantify the ef-fect of an opening of size n on the pixels of thismaximum: the value of each pixel p 2 M is de-creased from I(p) to maxfI(N4(pl)); I(N0(pr))g.In granulometric terms, the contribution of max-imum M to the n's bin of the horizontal patternspectrum PS0(I) is:

n� [I(p)�maxfI(N4(pl)); I(N0(pr))g]:

This is illustrated by Fig. 11.In addition, the e�ect of the horizontal

opening of size n on M results in a new\plateau" of pixels being created at altitudemaxfI(N4(pl)); I(N0(pr))g. This plateau may ormay not be itself a maximum of I � Ln.Further to these remarks, the principle of the

introduced grayscale granulometry algorithm is

to scan the lines of I one after the other. Eachhorizontal maximumM of the current line is iden-ti�ed, and its contribution to PS0(I)(l(M)) is de-termined. If it turns out that after opening of sizel(M), the new plateau formed is still a maximum,the contribution of this maximum to the patternspectrum is computed as well. The process is it-erated until the plateau formed by opening is nolonger a maximum, or until it becomes equal tothe entire scanline considered. The next maxi-mum of the current line is then considered, etc.This process is illustrated by Fig. 12.At any time during this process, the left and

right pixels of each \maximal region" processedare stored, so that this region does not have tobe scanned again later. The resulting algorithmis therefore linear with respect to the number ofpixels in the image, and in the worst case, eachimage pixel is only scanned twice. In practice, theexecution time varies only slightly from image toimage, depending on the number and complexityof maximal regions found in each scanline.We compared the speed of this algorithm to

the traditional opening-based technique. For thislatter, a highly optimized opening algorithm wasused, which is linear with respect to the number ofpixels in the image, and whose speed is (almost)independent of the length of the line segment usedas structuring element. Both original 512 � 512weld images of Fig. 13 were used for this compar-ison. As illustrated by table 2, the new algorithmintroduced in this part is up to three orders ofmagnitude faster!The speed of this new algorithm opens up a

range of new applications for grayscale granu-lometries. Traditionally, the practical problemsgranulometries have been used to address dealtwith either texture discrimination, or feature ex-traction for object recognition. In the �rst case,either computation time was not an issue, or thediscrimination task could be performed o�-line.In the second case, granulometries were computedon very small images (e.g. characters), so thatcomputation time could remain reasonable.With the algorithm introduced in this section,

it becomes possible to use grayscale granulome-tries more systematically. These tools provideindeed an e�cient and accurate way to extract

15

Page 16: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

l(M) pixelsMaximum M

h

h'

Figure 11. Horizontal cross section of I with a maximumM . The shaded area, of volume (h�h0)� l(M)shows the local contribution of this maximum to the l(M)-th bin of the horizontal pattern spectrum.

i pixels

Maximum M

j pixels

k pixels

Contribution to bin i

Contribution to bin j

Contribution to bin k

Figure 12. How the contribution of the \maximal region" surrounding a maximum M is determined inthe computation of the pattern spectrum.

Table 2Execution time of traditional opening-based technique and of introduced algorithm for the computationof a grayscale granulometry with horizontal line segments. The 512� 512 images of Fig. 13 were used forthis comparison, done on a Sun Sparc Station 10.

Traditional (size 1 to 512) Traditional (size 1 to 30) New algo (size 1 to 512)

Weld image (a) 204s 13.0s 0.248sWeld image (b) 204s 12.7s 0.206s

16

Page 17: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

global size information directly from a grayscaleimage. Extracting this information is sometimesa goal in itself; but this size estimation can alsobe essential to calibrate the parameters of, e.g.,an image segmentation algorithm, thereby greatlyenhancing the robustness of this algorithm.Figs. 13a{b are used to illustrate how grayscale

granulometries can be used to estimate sizeinformation2. These �gures represent welds ata high magni�cation. The quality of these weldsis related to the size, shape, and organization ofthe light patterns observed in Figs. 13a{b. To es-timate the size of the typical patterns in each im-age, linear granulometries were used, both in thevertical and in the horizontal direction. The re-sulting pattern spectra are shown in Figs. 13c{d.First, one can observe that the horizontal granu-lometric curve is very similar to the vertical one;we conclude that the patterns in images 13a and13b do not have any preferential orientation. Sec-ond, the curves in Fig. 13c exhibit a well-markedpeak for size 4, whereas the peak of the curves inFig. 13d is found for size 12. We conclude thatthe typical width and height of the patterns inFigs. 13a and in Fig. 13b is of 4 pixels and 12pixels respectively.Another example of application is shown in

Fig. 14. Images 14a and 14b respectively showX-rays of a healthy lung and of a lung exhibit-ing signs of the \miner's disease". These twoimages look very di�erent from a texture pointof view, thought it would be hard for a segmen-tation algorithm to speci�cally extract the \ob-jects" that make image b di�erent from imagea. Essentially, the former image shows a verysmooth texture while the latter is scattered withwhite nodules, which makes the texture rougher.Grayscale granulometries are the instrument ofchoice to discriminate between these two typesof textures. To that end, M. Grimaud, authorof the original study, had used grayscale granu-lometries by openings and closings with squares.The resulting pattern spectra for both X-ray im-ages, shown in Fig. 14a, are extremely di�erentfrom one another. However, in order to e�ec-tively discriminate between these two images, ex-

2Images gracefully provided by DMS, CSIRO, Australia.

pensive grayscale granulometries with squares arenot necessary: using the algorithms introducedhere to extract horizontal grayscale granulomet-ric curves is just as e�ective, as shown in Fig. 14d,and is orders of magnitude faster.

1.6. ConclusionEven though the concept of granulometry was

introduced over 25 years ago, the computationtime required to extract granulometric curvesmade it impossible to use these curves for mostpractical applications. In this part, a comprehen-sive set of fast algorithms to compute granulome-tries in binary images was �rst described. Most ofthese algorithms use opening functions as an in-termediate step, and they are shown to be fasterthan any previously available method.A new algorithm for computing granulome-

tries of grayscale images using openings or clos-ings with linear structuring elements is also intro-duced. This algorithm is so much faster (up tothree orders of magnitude) than any previouslyavailable technique that it makes it possible touse grayscale granulometries on a \routine" basis.Examples of application show how these granu-lometries can be used to extract global size in-formation directly from a grayscale image. Thesegranulometries being one-dimensional, they canalso be successfully used on 1-D signals. In [133],this granulometry algorithm is generalized to thetrue 2-D case. It is expected these new algorithmswill greatly contribute to popularize the use ofgrayscale granulometries in the image and signalanalysis community.

2. Fast Grayscale Granulometry Algo-rithms

Abstract

Granulometries constitute an extremely usefulset of morphological operators, applicable to a va-riety of image analysis tasks. Traditional granu-lometry algorithms involve sequences of openingsor closings of increasing size, and are thereforevery slow on non-dedicated hardware. E�cienttechniques have been proposed to compute gran-ulometries in binary images, based on the con-cept of opening functions. In the present section,

17

Page 18: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

0

50000

100000

150000

200000

250000

300000

350000

0 5 10 15 20 25 30

HorizontalVertical

0

20000

40000

60000

80000

100000

120000

140000

0 5 10 15 20 25 30

HorizontalVertical

(c) (d)

Figure 13. Using linear grayscale granulometries to estimate object size without prior segmentation.Curve (c) clearly indicates that the typical width and height of the white patterns in image (a) is 4pixels. Similarly, curve (d) shows that the typical width/height of the patterns in (b) is 12.

18

Page 19: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) X-ray of healthy lung (b) X-ray of diseased lung

0

0.005

0.01

0.015

0.02

0.025

-20 -15 -10 -5 0 5 10 15 20

Healthy lungDiseased lung

0

0.002

0.004

0.006

0.008

0.01

0.012

-20 -15 -10 -5 0 5 10 15 20

Healthy lungDiseased lung

(c) Square granulometric curves (d) Linear granulometric curves

Figure 14. Example of texture di�erenciation using grayscale granulometries by openings and closings.The pattern spectra of (a) and (b) are completely di�erent, whether linear or square granulometries areused (original study due to M. Grimaud).

19

Page 20: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

a class of algorithms for computing granulome-tries in grayscale images is introduced. The mostadvanced among them are based on the new con-cept of opening tree. These algorithms are sev-eral orders of magnitude faster than traditionaltechniques, thereby opening up a range of newapplications for grayscale granulometries.

2.1. Introduction, State of the ArtIn a variety of image analysis problems, one is

interested in extracting the size distribution of the\objects" or \structures" present in an image. In1967, Matheron formally characterized meaning-ful size distributions by introducing the conceptof granulometry [65, 66]:

De�nition 13 A granulometry is a family ofopenings � = (��)��0 satisfying:

8� � 0; � � 0; � � � =) �� � ��: (24)

Performing the granulometric analysis of an im-age I with � consists in mapping each size �to a measure of the opened image ��(I). Sim-ilarly, anti-granulometries, or granulometries byclosings, can be de�ned as families of increasingclosings. For more details on granulometries, see[66].In the discrete case, a granulometry is a de-

creasing family of openings � = (�n)n�0, indexedon an integer parameter n. Denote by m(I) themeasure of a discrete image I : m(I) is the areaof I in the binary case3 (number of \on" pixels)and the volume of I in the grayscale case (sumof pixel values). The granulometric analysis of Iwith � results in a granulometric curve:

De�nition 14 The granulometric curve or pat-tern spectrum [61] of an image, I, with respectto granulometry � = (�n)n�0 is the mappingPS�(I) given by:

PS�(I)(n) = m(�n(I))�m(�n�1(I)); (25)

for each n > 0.

In practice, the most useful granulometries arebased on openings (or closings) with the homo-thetics of a simple convex structuring element

3In the binary case, it may be useful for some granulome-tries to de�ne m(I) as the number of connected compo-nents in I [27].

B. Typically, B is a line segment, a square, ora hexagon. In such cases, we talk about \lin-ear granulometries, \square granulometries", or\hexagonal granulometries" respectively. Granu-lometries based on maxima of openings with linesegments at di�erent orientations are also com-monly used.Until recently, determining a granulometric

curve involved computing a sequence of open-ings of increasing size, which is very time con-suming no matter how e�cient the opening al-gorithm. Even when �n(I) (n-th opening in theseries) can be computed in constant time (for a�xed image size), determining the pattern spec-trum using openings of size 1 through n is stillan O(n) algorithm. For most applications, this isprohibitively costly, unless specialized hardwareis used for computing the successive openings.Over the past few years, a number of algo-

rithms have been proposed for fast granulome-tries in binary images (see [57, 145, 44] and morerecently [134]). These algorithms typically in-volve as an intermediate step the extraction ofthe \opening" function of the binary image stud-ied [134]: this function maps each pixel with thesize of the �rst opening that removes it from theimage. It can be computed e�ciently for all clas-sic structuring element shapes, and the histogramof the resulting grayscale image provides the de-sired pattern spectrum. An example was shownearlier in Fig. 1.This section treats the case of grayscale gran-

ulometries, which has not been previously ad-dressed in literature. In section 2.2, a fast lin-ear grayscale granulometry algorithm is �rst de-scribed (this algorithm was already brie y men-tioned in [134]). Then, in section 2.3, the conceptof opening trees is introduced as a way to com-pactly encode all the successive linear openingsof a grayscale image. This concept is at the basisof another set of new algorithms for the fast com-putation of granulometries with maxima of lin-ear openings, as well as approximations of squaregranulometric curves. Timing results prove thatthe introduced algorithms are several orders ofmagnitude faster than traditional techniques.

20

Page 21: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

2.2. Linear GranulometriesIn this section, the case of granulometries using

openings with line segments is considered4. Forsimplicily, let us assume that the line segmentsused as structuring elements are horizontal (thealgorithm easily extends to any orientation). Theopening �n in the series is the opening with struc-turing element Ln:

Ln = � � � . . . � �| {z }n+1 pixels

(26)

Let us analyze the e�ect of an opening by Ln, n �0 on a grayscale image I . Denote by Nl(p) andNr(p) respectively the left and the right neighborsof a pixel p.

De�nition 15 A horizontal line segment S, oflength l(S), is a set of pixels fp0; p1; : : : ; pn�1gsuch that for 0 < i < n; pi = Nr(pi�1).

De�nition 16 A horizontal maximum M oflength l(M) = n in grayscale image I is a hor-izontal line segment fp0; p1; : : : ; pn�1g such that:

8i; 0 < i < n; I(pi) = I(p0) and

I(Nl(p0)) < I(p0); I(Nr(pn�1)) < I(p0):(27)

This notion is the 1-D equivalent of the classic re-gional maximum concept [59]. The study of howsuch maxima are altered through horizontal open-ings is at the basis of the algorithm introduced inthis section. Denote by I � B the opening of im-age I by a structuring element B. The followingproposition holds:

Proposition 17 Let M = fp0; p1; : : : ; pn�1g bea horizontal maximum of I. Let p 2M be a pixelof this maximum.

8k < n; (I � Lk)(p) = I(p); (28)

for k = n; (I � Ln)(p) = maxfI(Nl(p0));

I(Nr(pn�1))g < I(p):(29)

That is, any opening of I by a line segment Lksuch that k < n leaves this maximum unchanged,whereas for any k � n, all the pixels of M have

4The algorithm described in this section applies to 1-Dsignals as well.

a lower value in I � Lk than in I . Furthermore,we can quantify the e�ect of an opening of sizen on the pixels of this maximum: the value ofeach pixel p 2 M is decreased from I(p) tomaxfI(Nl(p0)); I(Nr(pn�1))g. In granulometricterms, the contribution of maximumM to the n-th bin of the horizontal pattern spectrum PSh(I)is:

n� [I(p)�maxfI(Nl(p0)); I(Nr(pn�1))g]: (30)

This is illustrated by Fig. 11.Additionally, the local e�ect of a hori-

zontal opening of size n on M is that anew \plateau" of pixels is created at altitudemaxfI(Nl(p0)); I(Nr(pn�1))g. This plateau Pcontains M , and may be itself a maximum ofI �Ln. If it is, we say that P is part of the maxi-mal region R(M) surrounding maximumM , andwe can now compute the contribution of P to thel(P )-th bin of the pattern spectrum, etc. Fol-lowing this principle, the proposed granulometryalgorithm works as follows on each image line:

Algorithm: horizontal granul. of an image line� for each maximum M of this line

(in any order) do:

� Adds contribution of this

maximum to l(M)-th bin of

pattern spectrum;

� Let P be the plateau of pixels

formed by opening of size l(M)of M; if P is itself a maximum

of I � Ll(M), computes its

contribution to bin l(P ) of

pattern spectrum;

� Iterate previous step until the

new plateau formed is no longer

a maximum;

� ``Mark'' the maximal region

around M as already processed;

Note that this algorithm is inherently recursive:once a maximal region R has been processed, allof its pixels are regarded as having the gray-levelthey were given by the last opening consideredfor R. In practice though, there is no need tophysically modify the values of all the pixels in

21

Page 22: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

R: keeping track of the �rst and last pixels of Ris su�cient, allowing the algorithm to e�cientlyskip over already processed maximal regions (seeFig. 15). Thanks to this trick, the algorithm onlyconsiders each image pixel twice in the worst case.This algorithmwas compared to the traditional

opening-based technique. For the latter, a fastopening algorithm was used, whose speed is pro-portional to the number of pixels in the image and(almost) independent of the length of the line seg-ment used as structuring element. As illustratedby table 3, the new algorithm described in thissection is three orders of magnitude faster.

2.3. Granulometries with Maxima of Lin-ear Openings

In order to deal with more complicated cases,we now introduce a technique that can be seen asa generalization of the concept of opening func-tions for the grayscale case. When performingopenings of increasing size of a binary image,each \on" pixel p is turned \o�" for an openingsize given by the value of the opening function atpixel p. In other words, the opening function en-codes for each pixel the successive values it takesfor increasing opening sizes (namely, a series ofof 1's followed by a series of 0's). Similarly, inthe grayscale case, as the size of the opening in-creases, the value of each pixel decreases mono-tonically. If each pixel was assigned the list ofvalues it takes for every opening size, then thecorresponding grayscale granulometry could beextracted straightforwardly.Unfortunately, even if it were possible to com-

pute such lists of values quickly, assigning oneto each image pixel would require far too muchmemory. A more compact representation needsto be designed, that takes into account the intrin-sic \redundancy" of opened images, characterizedby their large plateaus of pixels. If we again con-sider the linear case, an elegant solution can beproposed to both the problem of computing theselists of values, and the problem of storing themcompactly:Let M be a horizontal maximum of image I ,

with altitude (grayscale) h. We pointed out inthe previous section that a horizontal opening ofsize l(M) ofM takes all of its pixels down to a new

value h0. Beyond this, the following propositioncan easily be proved:

Proposition 18 Let n > 0, I a grayscale imagesuch that I = I � Ln�1. Then, for every pixel pin I:

(I � Ln)(p) < I(p)()

9M horiz maximum, l(M) = n and p 2M:(31)

Therefore, at opening n in the sequence, the onlypixels a�ected are those which belong to maximaof length n. Furthermore, all the pixels belong-ing to the same maximum M , l(M) = n, will bea�ected in the same way for any opening of sizegreater than or equal to n. The list of decreas-ing values we wish to associate with each pixelinM can therefore \converge" into one single listfor size n. For larger opening sizes, this list mayitself be merged with other lists, etc.Based on this principle, the algorithm intro-

duced here represents each image line as a treeT , which we call its opening tree. The leaves ofT are the image pixels, and the nodes are madeof pairs (h; n), where h is a grayscale value andn is an opening size. Every pixel that can bereached by going upwards in the tree startingfrom node (h; n) is such that its value for theopening of size n is h. Conversely, starting froma pixel p, successive pairs (h1; n1), (h2; v2),. . . ,(h1; vi),. . . , are reached by going down towardsthe root of the tree. By convention, for this pixel,(h0; n0) = (I(p); 0). These pairs satisfy:

8i > 0; hi > hi+1 and ni < ni+1: (32)

For n � 0, the value of the opening of size n of Iat pixel p is given by:

(I � Ln)(p) = hj ;

where j is such that nj � n < nj+1: (33)

Opening trees can be computed using an algo-rithm very similar to the one described in theprevious section. An example of opening tree isshown in Fig. 16.Opening trees provide a hierarchical descrip-

tion that can be used to compactly represent allthe horizontal openings of a grayscale image. Inthis respect, this notion is a grayscale equivalent

22

Page 23: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

i pixels

Maximum 1

j pixels

k pixels

Contribution to bin iContribution to bin jContribution to bin k

n pixels

m pixels

p pixels

q pixels

Maximum 2

Maximal region around maximum 1

0

2

4

6

89

13

...

Grayscale:

Figure 15. Illustration of horizontal grayscale granulometry algorithm for a line with two maxima. Inthis case, maxima were scanned from left to right. Processing maximum 1 results in bins i, j, and k of thepattern spectrum being incremented. While processing maximum 2, bins m and n are �rst incremented,then the algorithm skips over the already processed maximal region, and bins p and q are incremented.The maximal region around maximum 2 is the entire line.

(9, i)

(6, j)

(4, k)

(2, p)

(0, q)

(6, m)

(4, n)

Figure 16. Opening tree representation of the im-age line of Fig. 15. The leaves of this tree (�)correspond to the image pixels.

of the opening function mentioned earlier (seeFig. 1). One can prove that, in the worst case,the opening tree has one node per image pixel. Inpractice though, only between 0.3 and 0.9 nodesper pixel are needed depending on the complexityof the image processed.Any horizontal opening of I can be straightfor-

wardly derived from its opening tree. In addition,the horizontal pattern spectrum of I , PSh(I), canbe computed from T as follows:

Algorithm: horiz granul of I from its opening tree� initialize each bin of pattern

spectrum PSh(I) to 0;

� for each pixel p of I do:

� v I(p); (h; n) node

pointed at by p;

� while (h; n) exists, do:

PSh(I)(n) PSh(I)(n) + (v � h);v h; (h; n) next node

down in tree;

This algorithm is obviously less e�cient forhorizontal granulometries than the one intro-duced in the previous section. However, it easilygeneralizes to the computation of granulometriesusing maxima of linear openings in several ori-entations. For example, to determine the granu-lometric curve corresponding to maxima of hori-zontal and vertical openings, one �rst extracts thehorizontal opening tree T1 and the vertical open-ing tree T2. Then, for each pixel p, the techniqueconsists in descending the corresponding branchesof T1 and T2 simultaneously as follows:

Algorithm: granul of I from trees T1 and T2� initialize each bin of pattern

spectrum PS(I) to 0;

23

Page 24: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

� for each pixel p of I do:

� v I(p);

� (h1; n1) node of T1 pointed at

by p;

� (h2; n2) node of T2 pointed at

by p;

� while (h1; n1) and (h2; n2) exist,

do:

size max(n1; n2);while n1 � size and (h1; n1)

exists do:

(h1; n1) next node down

in T1;while n2 � size and (h2; n2)

exists do:

(h2; n2) next node down

in T2;PS(I)(size)

PS(I)(size) + (v �max(h1; h2));v max(h1; h2);

The same technique extends to any numberof opening trees. The whole granulometry algo-rithm (extraction of trees followed by computa-tion of the pattern spectrum from these trees) isonce again orders of magnitude faster than tradi-tional techniques, as illustrated by table 3. In thistable, a granulometry by maxima of linear open-ings at 4 orientations was computed. In terms ofmemory, the computation of this particular gran-ulometry requires, in the worst case, 1 pointer (4bytes) and 1 node (8 bytes) per pixel, for each ori-entation. This comes to a total of 48 bytes/pixel,i.e., a worst case scenario of 12 Megabytes for a512 � 512 image. This is a reasonable tradeo�given the speed of the algorithm, and is not astrain on modern systems.The algorithm given above can be eas-

ily adjusted to the computation of pseudo-granulometries by minima of linear openings (formore details, see [135]). Although minima ofopenings are not themselves openings [66], min-ima of openings with line segments of increasinglength constitute a decreasing family of imageoperators. The resulting pseudo-granulometriccurves often characterize the same image featuresas square granulometries5.

5The author wishes to thank Gaile Gordon for this useful

These pseudo square granulometries have beenvery successful as one of the feature sets used tocharacterize plankton in towed video microscopyimages [29]. As an illustration, Fig. 17 shows fourdi�erent imagettes of copepod oithona and theircorresponding pattern spectra, for a granulome-try using openings with squares. These curves areall relatively at, exhibiting a single well-markedmaximum, between size 5 and 10, which corre-sponds to the size of the body of the organisms.By contrast, the same granulometric curves forthe pteropods shown in Fig. 18 are entirely dif-ferent, climbing sharphy until a strong maximum,reached for a size between 10 and 15. Togetherwith other structural and shape-based features,these pattern spectra are used as input to a neu-ral network classi�er. The goal of the project isto be able to classify between 5 and 10 di�erentkinds of organisms with over 90% accuracy.

2.4. ConclusionIn this section, a novel class of algorithms was

introduced for e�ciently computing granulome-tries in grayscale images. These algorithms turnout to be several orders of magnitude faster thanany previously available technique. One of theirkey underlying concepts is that of opening tree:such structures are shown to provide a compactrepresentation for the successive openings of agrayscale image by line segments of increasingsize. They are at the heart of the algorithm pro-posed for grayscale granulometries with maximaof linear openings. In addition, opening trees pro-vide a way to extract pseudo-granulometries byminima of openings with line segments at di�er-ent orientations, which can be used to approx-imate square granulometries. These algorithmscan even be extended to the fast computationof granulometries by area openings and closings[130], as described in [135]. However, the e�-cient computation of exact grayscale granulome-tries with square openings remains an open prob-lem (no pun intended).Over the past few years, grayscale granulome-

tries have proved to be useful in a variety of imageanalysis tasks, including texture classi�cation [25]and picture segmentation [31]. However, these

insight.

24

Page 25: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b) (c) (d)

0

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 200

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 20

curve for (a) curve for (b)

0

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 200

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 20

curve for (c) curve for (d)

Figure 17. Pattern spectra of copepod oithona

25

Page 26: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b) (c) (d)

0

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 200

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 20

curve for (a) curve for (b)

0

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 200

0.005

0.01

0.015

0.02

0.025

0.03

0 5 10 15 20

curve for (c) curve for (d)

Figure 18. Pattern spectra of pteropods

26

Page 27: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Table 3Execution time of traditional opening-based techniques and of introduced algorithms for the computationof a horizontal grayscale granulometry (left) and a granulometry by maxima of linear openings in 4orientations (right). A complex 512 � 512 image was used for this comparison, done on a Sun SparcStation 10. Granulometries were computed for opening sizes 1 to 512.

horizontal in 4 orientationstraditional new improvement factor traditional new improvement factor

204s 0.206s 990 824s 2.78s 296

applications have often been handicapped by slowprocessing speeds. The e�ciency of the algo-rithms introduced in the present part not onlymakes it now possible to use granulometries ona routine basis, they also open new areas of ap-plication for these tools. For example, in [134],it was brie y shown how linear granulometriescan be used to directly extract global estimates ofobject size in grayscale images without the needfor any segmentation or binarization. Extractingsuch information is sometimes a goal in itself, butit can also be essential to calibrate the parame-ters of subsequent image analysis algorithms tobe applied, thereby greatly enhancing their ro-bustness. Undoubtedly, the family of algorithmsintroduced here will contribute to popularize theuse of granulometries for a growing number of im-age and signal analysis problems.

27

Page 28: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Part II

Watersheds and

Segmentation

This chapter is derived from \Mor-phological Segmentation for Texturesand Particles", in Digital Image Pro-cessing Methods, E. Dougherty Ed.,Marcel-Dekker, New York, 1994 (see[137]).

3. Introduction, Morphological Segmenta-tion

The present chapter concerns image segmen-tation via the methods of morphological imageprocessing. A generally accepted meaning of theword segmentation in the image processing com-munity is the decomposition of the image understudy into its di�erent areas of interest. Here, weshall take the perspective that there are essen-tially two kinds of segmentation: segmentation ofimages of texture and segmentation of images ofparticles.In texture segmentation, an image is parti-

tioned into regions, each of which is de�ned bysome set of features characteristic to the microimage structure within it, this structure typicallybeing viewed in terms of the small texture prim-itives composing it. Typical applications includesegmentation of vegetation types in aerial pho-tographs, segmentation of text and halftones indocument pages, medical imaging applications,etc.The second kind of segmentation is concerned

with images of particles (or objects), where textu-ral information is either not present, or cannot besimply used as a discriminating factor. The seg-mentation task consists of extracting the particlesfrom the image(s) under study. In other words,the goal is to partition the image in as many con-nected components as there are objects or regionsto extract, plus some background regions. Wedistinguish between binary and grayscale parti-cle segmentation: in the binary case, i.e. whenthe images under study are binary, the segmenta-

tion task consists in separating the overlappingparticles (e.g., see the co�ee beans example ofFig. 19a). In the grayscale case, the segmenta-tion task is equivalent to a contour extractionproblem (e.g., in Fig. 19b, the contours of theelectrophoresis spots have to be extracted as pre-cisely as possible).The chapter is primarily concerned with the

latter case: particle segmentation. We focus onwatershed segmentation, which has the advan-tages of being very general, usually accurate andfast, and applicable to both binary and grayscaleimages. A fair amount of morphological machin-ery is involved; subject to the space constraint ofthis chapter, we shall introduce the necessary ma-chinery, leaving detailed theoretical descriptionsto the literature [100, 102, 103]. Refer to [32] foran introductory account of the fundamentals ofmorphological image processing. Good introduc-tions to the �elds of mathematical morphologycan also be found in [27, 98] (note: these refer-ences are in French),

4. Binary and Grayscale Particle Segmen-tation

4.1. Introduction to Morphological Seg-mentation

As previously mentioned, the purpose of thissection is to show how morphology can be suc-cessfully applied to a wide range of object seg-mentation problems. In this section, segmenta-tion of an image refers to the task consisting inextracting from it the objects or particles of in-terest as precisely as possible. By region-contourduality, this is equivalent to dividing the image inobject regions and background regions.Segmenting an image I is more than simply

counting its objects and pointing at them in theimage: it also encompasses the extraction of theobjects' contours. However, as we shall repeatthroughout this section, the contour extractionstep usually requires the prior marking of the ob-jects to extract. By a marker of an object or setX , we simply mean a setM that is included in X .We also generally assume that markers have thesame homotopy as the set they are marking. Forexample, a marker of a connected set is usually

28

Page 29: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

connected itself, although this constraint can infact be loosened in many practical cases. More-over, markers are usually located towards the cen-tral part of the objects they mark.This marker extraction step is shown to be the

most important step in many complex segmenta-tion applications that are undertaken using mor-phology. Intuitively, this marking is an algorith-mic simulation of human behavior: when askedto show the objects present in an image, a hu-man does not start right away by precisely out-lining these objects. On the contrary, he or shewill �rst point at the objects, one after the other,thus marking them. This marking can be seen asa �rst estimate of the objects; it is then re�nedby outlining the object's contours. From an im-age analysis point of view, it is generally admit-ted that �nding object markers is a less di�culttask than directly extracting accurate contours.In this section, we show that going from markersto actual segmentation can be done automaticallyusing procedures that we will describe, and thatare mainly based on the watershed transforma-tion.In the binary case, segmentation refers to the

extraction of the connected components repre-senting objects of interest, as well as the separa-tion of the overlapping objects. For example, thebinary image shown in Fig. 19a represents co�eebeans. This image will be used throughout thissection to illustrate the e�ect of the morphologi-cal transformations we will be dealing with. Wecan count the beans present in the image by sim-ply extracting a connected marker for each beanand counting the number of markers. However,this is not su�cient if one wishes to perform mea-surements on each individual bean (area, perime-ter, elongation, etc). For this purpose, the beansneed to be segmented, i.e. separated from oneanother. In the following, binary segmentationmeans \separation of overlapping objects in a bi-nary image".This marker-based methodology will also pro-

vide a framework for grayscale segmentation.We will illustrate our approach on the ultra-classic image of 2-D electrophoresis gels shown inFig. 19b. On this image, we not only want to �ndall the dark spots, but also correctly outline them

in order to measure, e.g., their respective areas,the density of black under them, etc. In both thebinary and the grayscale segmentation cases, thewatershed transformation (see section 4.4) will beused to extract precise object outlines from mark-ers. We will talk about marker-driven watershedsegmentation.Note that in many simpler cases, there is no

need to apply this approach. For example, thetop-hat transformation originally proposed in [71]provides an excellent tool for extracting light(resp. dark) objects from an uneven background.Its relies on the fact that by grayscale opening,one removes from an image the light areas thatcannot hold the structuring element. Subtractingthe opened image from the original one yields animage where the objects that have been removedby opening clearly stand out, and that image canthen easily be thresholded (see Fig. 20).Archetypically, the structuring element used in

the opening step is a disk or a discrete approxi-mation of a disc. However, in�nite variations ofthis transformation can be derived. We may cite:

� using linear elements, one can speci�callyextract objects that are elongated in onedirection,

� using a closing instead of an opening andsubtracting the original image from theclosed one allows us to extract dark objectson a lighter background. In this case, wetalk about \black top-hat" as opposed tothe \white top-hat" (by opening).

� If the background contains a lot of thin andelongated objects, one can use maxima ofopenings (resp. minima of closings) withlinear elements, followed or not by grayscalereconstruction (see section 4.3.4), or areaopenings (resp. closings) [130].

An application is shown in Fig. 21: Fig. 21a isa scanning electron microscopy image where theballs in the lower right corner are to be extracted.These being compact and light compared to thebackground around them, they are removed by anopening of size 2 (see Fig. 21b). After subtractionof (b) from (a), i.e. top-hat (see Fig. 21c), these

29

Page 30: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

Figure 19. (a) binary image of co�ee beans that need to be separated; (b) grayscale image of 2-Delectrophoresis gel whose spots have to be extracted.

grayscale image

opened image

top-hat possible threshold

Figure 20. Peaks extracted via top-hat followed by thresholding.

30

Page 31: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

small balls stand out and this image can be easilythresholded into Fig. 21d. The desired balls (rightside) can now be extracted as the balls containedin the largest connected component of the dila-tion of Fig. 21d. The dilated image is shown inFig. 21e, and the resulting segmentation is shownin Fig. 21f.In the following, we concentrate on more com-

plex segmentation problems, where top-hats can-not provide satisfactory solutions. We �rst dealwith binary segmentation, and the tools and tech-niques we are lead to use turn out to be even moreuseful later, for grayscale segmentation. In sec-tion 4.2, we present the concepts of maximal ballsand skeletons and show how they can be used torobustly mark the centroid of overlapping objectsin binary images. To go further and, from thesemarkers, derive the desired binary segmentation,we need to make use of geodesic operators thatare de�ned in section 4.3. The grayscale versionof these operators is also very useful for grayscalesegmentation. Lastly, in section 4.4, we describethe watershed transformation in detail and showhow it uni�es both binary and grayscale segmen-tations. Its use is illustrated on the segmentationof images of 2-D electrophoresis gels.

Some reminders and notationsFrom this point on, we are only concerned with

the discrete case, i.e., our workspace is the dis-crete plane ZZ2. In this plane, a grid G providesthe neighborhood relationships between pixels.Commonly used grids are the square grid, forwhich a pixel p has either 4 (in 4-connectivity)or 8 neighbors (in 8-connectivity), as well as thehexagonal grid (6-connectivity). Two neighbor-ing pixels p and q form an edge of G. The gridG induces a discrete distance in ZZ2, the distancebetween two pixels being the minimal number ofedges required to join them.Discrete images are considered as mappings

from ZZ2 onto ZZ; grayscale images take their val-

ues in a range f0; 1; : : : ; Ng whereas binary im-ages can only take value 0 and 1. The informa-tion content of a binary image is contained in itspixels with value 1, and therefore, binary imagesare often regarded as sets. For this reason, thebinary transformations described in the following

are often de�ned as set transformations.

4.2. Maximal Balls, Skeletons, UltimateErosions

We have seen earlier that granulometric analy-ses allow one to extract size information about animage without the need to segment it. For exam-ple, consider the co�ee bean image X shown inFig. 19. Depending on the context, X shall eitherrefer to the image itself or to the set of its blackpixels. The granulometric analysis of this imagemay be undertaken using squares of increasingsizes, denoted S1, S2, etc: openings with the Si'sare thus performed for i = 1 to the �rst value nsuch that X � Sn = ;. At each step i, the area ofimage X � Si is determined.The (X � Si)0�i�n constitutes a decreasing se-

quence of sets, so that as shown in [136], one cansynthesize all the information contained in thissequence via a single function called the granu-lometry function.

De�nition 19 The granulometry function gXassociated with a set X and the family of con-vex and homothetic elements (Si)i�0 maps eachpixel of X to the �rst i such that x 62 X � Si:

gX : p 2 X 7�! minfi 2 IN; p 62 X � Sig: (34)

Alternatively, one can say that the granulome-try function maps each pixel of X to the maximali such that there exists a translation t(Si) of Sisatisfying p 2 t(Si) � X . The granulometry func-tion of our co�ee beans image is shown in Fig. 22.From these images, it becomes clear that our

co�ee beans can be described as the areas wherethe largest balls (in this particular case: squares)can be included. Therefore, to extract markers ofour beans, we shall start by looking at the imagezones where the \largest" balls can be extracted.

4.2.1. De�nitionsIn this section and the following, the notion

of ball directly stems from the distance beingused. For example, in the plane IR2 equippedwith the usual Euclidean distance, the balls arestandard discs. In the discrete plane ZZ

2, theballs are hexagons if the hexagonal grid is used(6-connectivity) or squares in square grids. Theunit size ball B (ball of radius 1) corresponds to

31

Page 32: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

a. original image b. opening of with disc of radius 2

c. corresponding top-hat d. threshold

e. dilation of d f. �nal result

Figure 21. Top-hat segmentation of SEM image.

32

Page 33: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

Figure 22. (a) Granulometry function of Fig. 19a with respect to a family of squares; (b) level lines ofthis function.

33

Page 34: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

either S1, H or S2 depending on whether 4-, 6-or 8-connectivity is used (see Fig. 23).Calabi's de�nition of the skeleton is based on

the following notion of maximal ball:

De�nition 20 A ball B included in X is said tobe maximal if and only if there exits no other ballincluded in X and containing B:

8B0 ball, B � B0 � X =) B0 = B: (35)

This concept is illustrated by Fig. 24, and thede�nition of the skeleton follows from it:

De�nition 21 (Skeleton by maximal balls)The skeleton S(X) of a set X � ZZ

2 is the set ofthe centers of its maximal balls:

S(X) = fp 2 X j 9r � 0;

B(p; r) is a maximal ball of Xg: (36)

The skeleton is an intuitive notion: the skele-ton of a ball is reduced to its center, that of aband yields a unit thickness line, etc. Examplesof skeletons of simple shapes are shown in Fig. 25.One can see why the skeleton is often called themedial axis transform: it provides a descriptionof sets in terms of lines of unit pixel thickness.Unfortunately, things are not as easy as they

look: in the continuous case (Euclidean planeIR2), e.g., the skeleton of two tangent discs isreduced to the two centers of these discs (seeFig. 26) instead of being a straight line joiningthese two points. In other words, the homotopyor connectivity of the original set is not necessar-ily preserved (see [102, chapters 11{12] for moredetails).In the discrete case, let us denote by nB the

ball of radius n in the considered connectivity:

nB = B �B � � � � �B| {z }n times

;

with B being equal to either S1, H , or S2.Lantu�ejoul proved that the skeleton by maximalballs can be obtained by the following formula:

S(X) =

+1[n=0

[(X nB)=((X nB) �B)]: (37)

In words, the skeleton by maximal balls can beobtained as the union of the residues of open-ings of X at all scales. Unfortunately, once again

the skeleton does not behave as one would hope:the direct application of formula (37) yields com-pletely disconnected skeletons, as illustrated byFig. 27.Extracting correct homotopic (connected)

skeletons from discrete binary images is thus not astraightforward matter. The literature on skele-tons is very abundant and we certainly do notintend to cover the extraction of connected skele-tons in this chapter. Let us just mention thatthe method recently proposed in [124] allows thevery e�cient computation of a connected skele-ton which is a minimal superset of the skeleton bymaximal balls. An example of a connected skele-ton computed in 8-connectivity using this methodis shown in Fig. 28a. Since the skeleton by maxi-mal balls is not necessarily of unit-pixel thickness,the connected skeleton of Fig. 28a is not either.For some applications, it can be of interest to usethinning techniques to reduce it to a single pixelthickness, as shown in Fig. 28b.

4.2.2. Quench FunctionLet us go back to our description of binary sets

in terms of maximal balls and see what more canbe said about these descriptions. By de�nition,to every pixel p in the skeleton, there correspondsa maximal ball. Let us denote by q

X(p) the radius

of this ball. We thus de�ne the quench function

De�nition 22 (Quench function)The quench function associates with every pixelp 2 S(X) the radius of the corresponding maxi-mal ball.

One of the most important results about thequench function is that its datum is su�cient toreconstruct the original set completely:

Theorem 23 A set X is equal to the union ofits maximal balls:

X =[

p2S(X)

(p+ qX(p)B): (38)

The quench function thus allows us to do losslessencoding of binary images, and it has been ex-tensively studied for image compression. Derivedversions of this concept equal in performance thefamous CCITT group 4 encoding scheme on somekinds of document images [21].

34

Page 35: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

S1 H S2

Figure 23. Unit size ball B in 4-, 6- and 8-connectivity respectively.

not amaximal ball

maximalballs

X

Figure 24. Concept of maximal ball in the Euclidean plane.

Figure 25. Skeleton of simple shapes in the Euclidean plane.

X

S(X)

Figure 26. In the continuous Euclidean plane, the skeleton of a connected set is not necessarily connected.

35

Page 36: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 27. Example of skeleton by maximal balls on the co�ee beans image, using the balls of the8-connected distance.

(a) (b)

Figure 28. (a) 8-connected skeleton; (b) thinned 8-connected skeleton.

36

Page 37: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

The quench function of our image of co�eebeans is presented Fig. 29a. Obviously, since thismapping is de�ned on the skeleton by maximalballs S(X), its support is not connected. How-ever, using the skeletonization technique brie ymentioned above [124], it is possible to re-connectthe skeleton by maximal balls and to extract theradii corresponding to pixels on the connectingarcs. This produces the connected quench func-tion shown in Fig. 29b.The other major interest of the quench func-

tion is the de�nition of the ultimate erosion. Wehave now a way to describe a set X as the unionof its maximal balls; in order to de�ne markersof our co�ee beans, i.e., of the convex blobs ofthe binary image under study, we look for thelargest among these maximal balls. Clearly, for agiven connected component C of X , (one of) thelargest maximal ball is (one of) the largest ballthat can be included in C, and its center marksan important object. However, if C is made oftwo overlapping objects, this crude method onlyallows us to mark one of them.Let us consider the simple case where X is

equal to the union of two overlapping discs. Asshown on Fig. 30, the skeleton ofX is the line seg-ment joining the centers of these two discs. Now,upon examination of the quench function, one cannotice that it exhibits two maxima, located at theexact centers a and b of our discs6. These max-ima therefore de�ne markers of our overlappingobjects, and their set constitutes the ultimate ero-sion of X :

De�nition 24 (Ultimate erosion) Theultimate erosion of a set X, denoted Ult(X), isthe set of the (regional) maxima of the quenchfunction q

Xof X.

At this point, we need to recall the de�ni-tion of maxima (also called regional maxima) forgrayscale images:

De�nition 25 (Regional maximum) Aregional maximum M of a grayscale image I is aconnected component of pixels with a given valueh (plateau at altitude h), such that every pixel in

6In this particular case, these maxima also happen to belocated on extremities of the skeleton, which is uncommon.

the neighborhood of M has a value strictly lowerthan h.

One should make a clear distinction between re-gional maxima and local maxima. A local maxi-mum is de�ned as follows:

De�nition 26 (Local maximum) A pixel p ofa grayscale image I is a local maximum if andonly if for every pixel q which is neighbor of p,I(p) � I(q).

Obviously, ifM is a regional maximum of I , then

p 2M =) p is a local maximum,

but the converse is does not hold, as we shall pointout shortly. Similarly, one can de�ne local andregional minima.The problem with de�nition 24 is that the

discrete quench function is de�ned on a non-connected support, so that its maxima are notreally de�ned! To get around this problem, wecan compute the maxima of the connected quenchfunction presented earlier (see Fig. 29b). Thethus extracted ultimate erosion of the co�ee-beans image is shown in Fig. 31a.We can see that this ultimate erosion provides

a reasonably good marking of our beans. We aretherefore close to reaching our �rst goal, namelythe extraction of one (connected) marker per ob-ject. There remain two points to address:

� the marking is still not perfect: some beansare multiply marked. How to reconnectsome markers in order to end up with onesingle marker per bean?

� How to extract ultimate erosions in a morestraightforward manner?

These two issues are addressed in the next sectionwith the introduction of the distance function.

4.2.3. Ultimate Erosion and DistanceFunction

In this section, we give a completely di�erentinterpretation of the utimate erosion. Let X be aset made of overlapping components. When per-forming iterative erosions of this set with respectto the unit size ball B, its components are pro-gressively shrunk and separated from the rest of

37

Page 38: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

Figure 29. Quench function (a) and connected quench function (b). Their supports have been dilated forclarity.

a b

X

qX

Maxima

a bS(X) ⇒

Figure 30. Skeleton of a set X , associated quench function qXand its maxima.

38

Page 39: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 31. Ultimate erosion of the co�ee beans image.

the set before they are completely removed by theerosion process. This is illustrated by Fig. 32.If, throughout this erosion process, we keep

aside each connected component just before it isremoved, it can be proved that the thus obtainedset is exactly the ultimate erosion of X . Giventwo sets A and B such that B � A, let us denoteby �A(B) the union of the connected componentsof A that have a non-empty intersection with B.This operator is called reconstruction and is morefully discussed in section 4.3. Our new ultimateerosion algorithm can now be expressed by thefollowing formula:

Ult(X) =[n2IN

[(X nB) n �XnB(X (n+ 1)B)]

The resulting ultimate erosion of the set of Fig. 32is shown inFig. 33.This method suggests yet another way to deter-

mine the ultimate erosion of a X . Indeed, thereis a morphological transformation which synthe-sizes all the information contained in the succes-sive erosions of a set X . This transformation iscalled the distance function and associates with

each pixel p of X the size of the �rst erosion of Xthat does not contain p:

De�nition 27 (Distance function) The dis-tance function distX associated with a set X isgiven by:

8p 2 X; distX(p) = minfn 2 IN j p 62 X nBg:

For each pixel p 2 X , distX(p) is the distancebetween p and the background, i.e., XC . The8-connected distance funtion of the co�ee beansimage is shown in Fig. 34.By de�nition, the regional maxima at altitude

h of the distance function are the connected com-ponents at altitude h of distX such that everyneighboring pixel is of altitude strictly smallerthan h. Any of these regional maxima are re-moved by a unit-size erosion. Indeed, if this wasnot true, there would exist pixels q located insidethe regional maximum and verifying distX(q) >h, which is absurd. These maxima thus belongto the ultimate erosion of X and the followingproposition can be derived:

Proposition 28 The ultimate erosion of a set X

39

Page 40: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

1. 2.

4.3.

5. 6.

Figure 32. Successive erosions of a set. Each component is separated from the rest of the set before it isremoved by the erosion process.

40

Page 41: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

X

Figure 33. Ultimate erosion of a set.

(a) (b)

Figure 34. 8-connected distance function of the co�ee beans image (a) and level lines of this function (b).

41

Page 42: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

is equal to the union of the regional maxima of thedistance function of X.

Since distance functions and regional maximacan be computed very e�ciently in discrete im-ages (see e.g. [129]), this last proposition providesthe best computational method for extracting ul-timate erosions. As a matter of curiosity, whathappens if we now extract the local maxima ofthe distance function? The following propositionholds:

Proposition 29 The skeleton by maximal ballsof a set X is equal to the set of local maxima ofits distance function.

The distance function is therefore at the ba-sis of a very large number of morphological al-gorithms. Later in this chapter, it will be usedconjunction with the watershed algorithm. Forcompleteness of this section, we shall also men-tion that after local and regional maxima, thecrest-lines of the distance function are of interest:following them allows us to extract the connectedskeleton of X (see Fig. 35). This forms the basisof a series of algorithms proposed by F. Meyer[102, chapter 13].We have now de�ned the morphological tools

that will allow us to obtain perfect bean markers.We saw on Fig. 31 that the ultimate erosion doesnot quite yield perfect markers of our beans: allbeans are marked, but some have multiple mark-ers. The disconnections are caused by our dicreteworkspace as well as small contour irregularitiesof the beans. For this particular image, a unitsize dilation would be good enough to-reconnectthe markers and end up with one single markerper bean. However, this might not work in thegeneral case: components of the ultimate erosionmarking the same co�ee bean may indeed be sep-arated by arbitrarily large distances.The method used instead relies upon the fact

that two components of the ultimate erosionmarking the same bean are pretty much on thesame \maximal zone" of the distance function.In fact, it is possible to go from one to the otheron the distance function by going down no morethan one level. Thus, if we subtract 1 from thedistance function at the location of all the com-

ponents of the ultimate erosion, we obtain a mod-i�ed distance function whose maxima are exactlythe desired bean markers, as illustrated in Fig. 36.

4.2.4. Skeleton by In uence ZonesThe last concept that we need to de�ne in this

section is that of skeleton by in uence zones, alsocalled SKIZ.

De�nition 30 Let X be a set made of n con-nected components (Xi)1�i�n. The in uencezone Z(Xi) of Xi is the locus of the points whichare closer to it than to any other connected com-ponent of X:

Z(Xi) = fp 2 ZZ2 j 8j 6= i; d(p;Xi) � d(p;Xj)g:(39)

The distance d used in this equation is the dis-crete distance induced by the grid we are using(4-, 6-, or 8-connectivity),The SKIZ is then de�ned as follows:

De�nition 31 (SKIZ) The SKIZ of set X, de-noted SKIZ(X), is the set of the boundaries of thein uence zones fZ(Xi)g1�i�n.

An example of skeleton by in uence zones isshown on Fig. 37a. Just as the skeleton fol-lows the crest-lines of the distance function, onecan view the SKIZ as folowing the valley-lines ofthe inverted distance function of the background(Fig. 37b).

4.3. Geodesic Transformations4.3.1. Introduction, Geodesic DistancesAt this point, we have achieved the �rst step of

our segmentation as outlined in section 4.1: themarker extraction. It now remains to make gooduse of these markers for the extraction of correctset boundaries. The idea is to de�ne each beanas the image region centered around its marker.Our intent is therefore to \grow" these markersback in the mask of the co�ee-beans image. Forthis purpose, we now need the notion of geodesicoperators introduced by C. Lantu�ejoul [55, 56].Contrary to classic \Euclidean" morphologi-

cal operations, geodesic ones do not operate onthe entire space, but on a �nite set X which iscalled the mask. They are based on the notion ofgeodesic distance:

42

Page 43: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 35. The skeleton follows the crest-lines of the distance function.

Figure 36. Final bean markers. For this image as well as for Fig. 31, the exact Euclidean distance functionwas used.

43

Page 44: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

Figure 37. SKIZ of a binary image; (b) the SKIZ follows the valley lines of the inverted distance functionof the background. This example was computed using Euclidean distance.

44

Page 45: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

De�nition 32 The geodesic distance betweentwo points x and y of X is the in�mum of thelength of the paths between x and y in X, if suchpaths exist:

dX(x; y) = inffl(Cx;y) j

Cx;y is a path between x and y inside Xg:(40)

If there are no such paths, we set dX (x; y) = +1.

This de�nition is illustrated by Fig. 38We call the geodesic ball of radius n and of cen-

ter p 2 X the set BX(p; n) de�ned by:

BX(p; n) = fp0 2 X; dX(p

0; p) � ng: (41)

4.3.2. Geodesic Dilations and ErosionsSuppose now that X is equipped with its as-

sociated geodesic distance dX . Given n � 0, weconsider the structuring function [102] mappingeach pixel p 2 X to the geodesic ball BX(p; n)of radius n centered at p. This leads to the def-inition of the geodesic dilation of a subset Y ofX :

De�nition 33 The geodesic dilation �(n)X (Y ) of

size n of set Y inside set X is given by

�(n)X (Y ) =

[p2Y

BX(p; n) =

fp0 2 X; 9p 2 Y; dX(p0; p) � ng: (42)

The dual formulation of the geodesic erosion ofsize n of Y inside X is the following:

"(n)X (Y ) = fp 2 Y j BX(p; n) � Y g =

fp 2 Y j 8p0 2 X=Y; dX(p; p0) > ng: (43)

Examples of geodesic dilation and erosion areshown in Fig. 39.As already mentioned, the result of a geodesic

operation on a set Y � X is always included inX , which is our new workspace. As far as imple-mentation is concerned, an elementary geodesicdilation (of size 1) of a set Y inside X is obtainedby intersecting the result of a unit-size dilationof Y (with respect to the unit ball B) with theworkspace X :

�(1)X (Y ) = (Y �B) \X: (44)

A geodesic dilation of size n is obtained by iter-ating n elementary geodesic dilations:

�(n)X (Y ) = �

(1)X (�

(1)X (: : : �

(1)X (| {z }

n times

Y ))): (45)

One can derive similar equations for geodesic ero-sions.

4.3.3. Reconstruction and ApplicationsOne can notice that by performing successive

geodesic dilations of a set Y inside a set X , itis impossible to intersect a connected componentof X which did not initially contain a connectedcomponent of Y . Moreover, in this successivegeodesic dilation process, we progressively \re-construct" the connected components of X thatwere initially marked by Y . This is shown inFig. 40.Now, the sets with which we are concerned are

�nite ones. Therefore, there exists n0 such that

8n > n0; �(n)X (Y ) = �

(n0)X (Y ):

At step n0, we have entirely reconstructed all theconnected components of X which were initiallymarked by Y . This operation is naturally calledreconstruction:

De�nition 34 (Reconstruction) Thereconstruction �X(Y ) of the (�nite) set X fromset Y � X is given by the following formula:

�X(Y ) = limn!+1

�(n)X (Y ): (46)

Fig. 41 illustrates this transformation.Some applications require that the various

markers remain unconnected (this is the case,for instance, of the binary segmentation problemwith which we are concerned). In such cases, thegeodesic in uence zones of the connected compo-nents of set Y inside X are used. Indeed, thenotions of in uence zones and of SKIZ presentedin section 4.2.4 easily extend to the geodesic case,as shown by Fig. 42.

4.3.4. Grayscale ReconstructionAt present, all the tools required for solving

our bean segmentation problem have been de-�ned. However for grayscale segmentation, we

45

Page 46: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Xy

x

C

z +∞

Figure 38. Geodesic distance in a set X .

X

(Y)δX

Y

X

(Y)εX

Y

Figure 39. Examples of a geodesic dilation and of a geodesic erosion of set Y inside set X .

46

Page 47: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

X

Y

Figure 40. Successive geodesic dilations of set Y inside set X .

Figure 41. Reconstruction of X (light set) from Y (dark set).

Figure 42. Example of geodesic SKIZ.

47

Page 48: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

will also need to extend the concept of geodesyto grayscale images.It has been known for several years that|at

least in the discrete case|any increasing trans-formation de�ned for binary images can be ex-tended to grayscale images [100, 141, 103]. Byincreasing, we mean a transformation such that

8X;Y � ZZ2; Y � X =) (Y ) � (X): (47)

In order to extend such a transformation to grayscale images I taking their values inf0; 1; : : : ; Ng, it su�ces to consider the successivethresholds Tk(I) of I , for k = 0 to N :

Tk(I) = fp 2 DI j I(p) � kg; (48)

where DI is the domain of image I . They aresaid to constitute the threshold decomposition ofI [64]. As illustrated by Fig. 43, these sets obvi-ously satisfy the following inclusion relationship:

8k 2 [1; N ]; Tk(I) � Tk�1(I):

When applying the increasing operation to eachof these sets, their inclusion relationships are pre-served. Thus, we can now extend to grayscaleimages as follows:

8p 2 DI ; (I)(p) =

maxfk 2 [0; N ] j p 2 (Tk(I))g: (49)

In the present case, binary geodesic reconstruc-tion is an increasing transformation in that it sat-is�es:

Y1 � Y2; X1 � X2; Y1 � X1; Y2 � X2 =)

�X1(Y1) � �X2(Y2): (50)

Therefore, following the threshold superpositionprinciple of equation (49), we de�ne grayscale re-construction as follows [132]:

De�nition 35 (Grayscale reconstruction)Let J and I be two grayscale images de�ned on thesame domain, taking their values in the discreteset f0; 1; : : : ; Ng and such that J � I (i.e., foreach pixel p 2 DI ; J(p) � I(p)). The grayscalereconstruction �I(J) of I from J is given by:

8p 2 DI ; �I(J)(p) = maxfk 2 [0; N ] j

p 2 �Tk(I)(Tk(J))g: (51)

Fig. 44 illustrates this transformation. Just likebinary reconstruction extracts those connectedcomponents of the mask which are marked,grayscale reconstruction extracts the peaks of themask which are marked by the marker-image.By duality, we are also able to de�ne the dual

grayscale reconstruction, or reconstruction by ero-sion:

De�nition 36 (Dual grayscale reconstruction)Let J and I be two grayscale images de�ned on thesame domain, taking their values in the discreteset f0; 1; : : : ; Ng and such that J � I (i.e., foreach pixel p 2 DI ; J(p) � I(p)). The grayscalereconstruction ��I(J) of I from J is given by:

8p 2 DI ; �I(J)(p) = N � �N�I(I � J):

4.3.5. Binary SegmentationLet us now use all these tools to design a power-

ful binary segmentation algorithm. Starting fromthe markers of our objects, i.e. from the ultimateerosion, our goal is to accurately outline these ob-jects. We could consider using the geodesic SKIZ,and de�ning each object as the geodesic in uencezone of its marker inside the initial set. Unfor-tunately, this is not a satisfactory algorithm. In-deed, as shown in Fig. 45, the separating linesthus de�ned between objects are poorly located.This is due to the fact that the altitudes of thedi�erent markers|i.e. the value associated withthem by the quench function|is not accountedfor by this method.The way to design a good segmentation

procedure|in taking the above altitudes intoaccount|is to use the geodesic SKIZ repeatedly.Let nm be the size of the largest nonempty ero-sion of X :

X nmB 6= ; and X (nm + 1)B = ;:

XnmB is obviously a subset of the ultimate ero-sion ofX . Denote this set byXnm . Now, considerthe erosion of size nm�1 ofX , i.e. X(nm�1)B.Obviously, the following inclusion relation holds:

Xnm � X (nm � 1)B:

Now, let Y be a connected component of X (nm � 1)B. There are three possible inclusionrelations between Y and Y \Xnm :

48

Page 49: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Grayscale image "Stack" of binary thresholds

Figure 43. Threshold decomposition of a grayscale image.

f

g

Figure 44. Grayscale reconstruction of mask f from marker g.

49

Page 50: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 45. Bad segmentation algorithm: geodesic SKIZ of the ultimate erosion of X inside X .

1. Y \ Xnm = ;: in this case, Y is anotherconnected component of Ult(X).

2. Y \ Xnm 6= ; and is connected: here, Y isused as a new marker.

3. Y \Xnm 6= ; and is not connected: in thislast case, the new markers are the geodesicin uence zones of Y \Xnm inside Y .

These three di�erent cases are shown on Fig. 46.LetXnm�1 be the set of markers produced after

this step. To summarize what we have just said,Xnm�1 is made of the union of:

� the geodesic in uence zones of Xnm insideX (nm � 1)B,

� the connected components of Ult(X) whosealtitude is nm � 1.

This procedure is then iterated at levels nm �2, nm � 3, etc. . . until level 0 is reached. In amore formal way, for every 0 < n < nm, let usintroduce the following notations:

(i) un(X) is the set of connected componentsof Ult(X) having altitude n:

p 2 un(X) , p 2 Ult(X) and distX(p) = n:

(ii) For every set Y � X , zX(Y ) designates the

set of geodesic in uence zones of the con-nected components of Y inside X .

The recursion formula between levels n and n�1can now be stated:

Xn�1 = zX(n�1)B

(Xn) [ un�1(X): (52)

It is illustrated by Fig. 47.The set X0 that is �nally obtained after apply-

ing this algorithm constitutes a correct segmen-tation of X . Fig. 48 presents an example of thisbinary segmentation algorithm. Applying thesenotions to the bean segmentation problem, we seein Fig. 49 that, whereas a geodesic SKIZ of ourmarkers results in improper separating lines, thesegmentation algorithm we just described yieldsan accurate segmentation of the beans.

4.4. Watersheds and Grayscale Segmenta-tion

4.4.1. Deriving a General SegmentationApproach

As presented in section 4.3.5, our morphologi-cal binary segmentation algorithm is rather com-plicated. In the present section, we give a muchmore intuitive approach to it. Consider the func-tion (grayscale image) �distX , where distX is the

50

Page 51: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Y Y Y

Figure 46. The three possible inclusion relations between Y and Y \Xnm .

Xn

Xn-1

Figure 47. How to obtain Xn�1 from Xn.

distance function introduced in section 4.2.3, andregard it as a topographic surface. The minimaof this topographic surface are located at the dif-ferent connected components of the ultimate ero-sion of X . Now, if a drop of water falls at a pointp of �distX , it will slide along the topographicsurface, following some steepest slope path, untilit �nally reaches one of its minima. We de�nethe catchment basin C(m) associated with a min-imum m of our topographic surface in the follow-ing way:

De�nition 37 (Catchment basin) The catch-ment basin C(m) associated with a (regional)minimum m of a grayscale image regarded as atopographic surface is the locus of the points psuch that a drop falling at p slides along the sur-face until it reaches m.

This de�nition is not very formal, but has theadvantage of being intuitive. In our example, thecatchment basins of the function �distX exactlycorrespond to the regions that were extracted by

the algorithm presented in section 4.3.5, as illus-trated by Fig. 50. The segmentation achievedin section 4.3.5 exactly corresponds to extract-ing the catchment basins of the opposite of thedistance function.In fact, the notion of catchment basin can be

de�ned for any kind of grayscale image. More-over, the algorithm of section 4.3.5 can be eas-ily adapted to the determination of the basins ofany grayscale image I : it su�ces to replace thesuccessive erosionsXnB|which correspond tothe di�erent thresholds of the distance functionof X|by the successive thresholds of I (for moredetails, refer to [140]). The crest-lines separat-ing di�erent basins are called watersheds lines orsimply watersheds.

De�nition 38 (Watersheds) The watersheds(lines) of a grayscale image I are the lines thatseparate the di�erent catchment basins of I.

These notions are illustrated by Fig. 51.

51

Page 52: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

1. 2.

4.3.

5. 6.

Figure 48. Correct binary segmentation algorithm presented in section 4.3.5.

52

Page 53: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) geodesic SKIZ (b) correct segmentation

Figure 49. Segmentation of co�ee beans from their markers.

Watersheds stand out as a powerful morpho-logical crest-line extractor. It is therefore mostinteresting to apply the watershed transforma-tion to gradient images: indeed, the contours ofa grayscale image can be viewed as the regionswhere the gray levels exhibit the fastest varia-tions, i.e., the regions of maximal gradient. Theseregions are the crest-lines of the gradient. This re-mark is illustrated by Fig. 52 and is at the basis ofthe use of watersheds for grayscale segmentation,as described and illustrated in [8, 5, 136, 140].Note that in morphology, the word gradient

refers to an operation associating with each imagepixel the modulus of its gradient|in the classicalsense of the word. Most of the time, the gradientknown as Beucher's gradient [100] is used, whichis obtained as the algebraic di�erence of a unit-size dilation and a unit-size erosion of I :

grad(I) = (I �B)� (I B):

Nonetheless, depending on the type of image con-tours to be extracted, other gradients may be ofinterest: directional gradients, asymmetric gradi-

ents, regularized gradients, etc [84].The watershed transformation always provides

closed contours and constitutes a very general ap-proach to contour detection. However, it can veryrarely be used directly on gradient images with-out resulting in dramatic over-segmentations: theimage gets partitioned in far too many regions,i.e., the correct contours are lost in a large num-ber of irrelevant ones! This problem is mainlydue to noise in the data: noise in the originalimage results in noise in its morphological gra-dient, this in turn causing it to exhibit far toomany regional minima. This directly translatesinto far too many catchment basins, i.e., over-segmentation!Several approaches have been proposed in lit-

erature to overcome this over-segmentation: forexample, some techniques remove arcs of the wa-tersheds based on an integration of the gradient'sgray values along them. Others take the dualpoint of view and merge adjacent regions (i.e.,catchment basins here) when the gray level of theoriginal image over them is comparable. None

53

Page 54: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Minima

Catchmentbasins

Original image Distance function

Separation of theoverlapping components

Figure 50. Interpretation of binary segmentation in terms of catchment basins of the opposite of thedistance function.

Minima

Watersheds

Catchmentbasins

Figure 51. Regional minima, catchment basins, and watershed lines.

54

Page 55: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

I

grad(I)

Crest-lines of thegradient = contours

"object", light on a darkbackground in the present case

Figure 52. Principle of grayscale segmentation via watersheds of the gradient.

55

Page 56: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

of these techniques is satisfactory in that it isvery di�cult to incorporate to them knowledgespeci�c to the collection of images under study.Besides, they go against the point of view pre-sented at the beginning of this section, claimingthat marker extraction should be the �rst step ofevery segmentation.Therefore, the morphological approach to this

problem consists in making use of image-speci�cknowledge (e.g., size, shape, location or bright-ness of the objects to extract) to design robustobject marking procedures [136, 140, 9]. Thisstep of the segmentation can be completely dif-ferent from one problem to another. Not onlymust each object be uniquely marked, the back-ground also needs its own marker(s). In a secondstep, this binary image of markers is used, not toguide region-merging or arc-removal algorithms,but on the contrary, to modify the gradient imageon which watersheds are computed.More precisely, let I denote the original

grayscale image, J = grad(I) its morphologicalgradient, and let M denote the binary image ofmarkers. The \modi�cation" of J should resultin a grayscale image J 0 with the following char-acteristics:

� its only regional minima are exactly lo-cated on the connected components of M(M is the set of \imposed" minima);

� its only crest-lines are the highest crest-lines of J that are located between the im-posed minima.

The watersheds of J 0 are thus the highest crest-lines of grad(I) that separate our markers. Hence,they are the optimal contours corresponding toset of markersM and gradient J .The actual computation from J and M of an

image J 0 with these characteristics has been clas-sically achieved using a three-step process [136]:

1. Set to hmin any pixel of J that is locatedon a marker, hmin being chosen such that8p; hmin < J(p). This results in a new im-age J�:

8p; J�(p) =

�hmin if M(p) = 1J(p) otherwise.

2. Create the following grayscale image M�

8p; M�(p) =

�hmin if M(p) = 1hmax otherwise,

where hmax is chosen such that 8p; J(p) <hmax.

3. UseM� to remove all the unwanted minimaof J� while preserving its highest crest-linesbetween markers. This is done using thedual grayscale reconstruction operation ��:

8p; J 0(p) = ��J�(M�): (53)

This process is illustrated by Fig. 53. The water-sheds of the resulting image J 0 provide the desiredsegmentation.The whole procedure presented above is often

referred to as marker-driven watershed segmen-tation. It is extremely powerful in a number ofcomplex segmentation cases, where it mostly re-duces the segmentation task to (1) the choice ofa gradient and (2) the extraction of object mark-ers (this latter task can itself be very complex insome cases).

4.4.2. The Electrophoresis ExampleLet us illustrate this segmentation paradigm

on the two-dimensional electrophoresis image ofFig. 54a (see also [4, 136]). The standard morpho-logical gradient of this image is shown in Fig. 54b.As mentioned above, if we simply compute thewatersheds of Fig. 54b, the result is clearly dis-appointing (See Fig. 54c). Indeed, the gradientexhibits a large number of minima, mainly due tothe presence of noise in the original image. Nev-ertheless, one can notice that all the spots aremarked by these minima and hence all the correctcontours are present in Fig. 54c. The watershedsimply produces over-segmentation.Avoiding over-segmentation requires the prior

extraction of correct spot markers. Since thespots constitute the dark part of the image, theyshould be interpreted as the image minima. Yet,the direct extraction of the initial image's min-ima is not a satisfactory solution, as illustrated byFig. 54d: once again, many of these mimina are

56

Page 57: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

J

hmin

M

hmin

J*

1. Grayscale image J and marker-image M 2. Construction of image J *

3. Construction of image M* 4. First steps of dual reconstruction of J * from M*

hmin hmin

hmax

6. Final modified image J'

hmin

5. Dual reconstruction of J * from M* (cont.)

hmin

M*

Figure 53. Use of dual grayscale reconstruction to \impose" a set M of minima to a graycale image J .

57

Page 58: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

due to acquisition noise in our data. Here how-ever, �ltering image 54a (with a morphological�lter called an alternating sequential �lter (ASF),see [102, chapter 10] or [103]) is su�cient to pro-duce an image whose minima correctly mark thespots (See Figs. 54e-f).In fact, this marker extraction step is followed

by binary watershed segmentation in order to cutmarkers like the upper-right corner one, whichclearly should mark two di�erent spots. The �nalimage of object markers is shown in Fig. 55a. Asconcerns the background marker, it is extractedas the set of the highest crest-lines of the originalimage that separate the spot markers. This is thebest way to assure that it will be located on thelightest areas of the image and separate all theobject markers. Its determination is done in asimilar way as gradient modi�cation (see Eq. 53and Fig. 53). It is shown in Fig. 55b.Both sets of markers are then combined in a

�nal marker image, shown in Fig. 55c. It is usedto modify the gradient of Fig. 54b, this result-ing in Fig. 55d. The watersheds of the latter im-age provide the desired segmentation, as shownin Figs. 55e-f.The result is in accordance with our expecta-

tions: each spot has a unique contour which islocated on the in exion points of the initial lu-minance function|i.e. the original image. Giventhe extracted set of markers, we found the op-timal gradient crest-lines, i.e. the best possiblesegmentation for these markers and, to a lesserextent, this gradient.

4.4.3. Di�cult Segmentations, Recent De-velopments

Hierarchical watershed segmentations

The method described in the previous sectioncan be applied to a wide range of problems, aslong as the preliminary marker extraction stepcan be performed with su�cient accuracy. How-ever, in some di�cult segmentation cases, it isimpossible to �nd markers of the regions or ofthe objects to extract, since these objects or re-gions are not themselves well de�ned. This kindof situation often occurs, for instance, with re-mote sensing images, where the large variety ofzones (�elds, roads, houses, towns, lakes, etc, un-

der di�erent lighting conditions) makes it almostimpossible to design robust marking procedures.In this latter case, region-growing types of tech-

niques (see beginning of section 4.4.1) may pro-vide an appropriate solution. In fact, a few mor-phological region-growing techniques based onthe watershed transformation have recently beenproposed and seem very promising:

� In the �rst one, \raw" watershed segmenta-tion is applied to the gradient of the originalimage, thus resulting in an over-segmentedimage of catchment basins. Each catchmentbasin C is assigned a uniform gray-level cor-responding, for example, to the mean gray-level of the pixels of the original image overC. In a second step, this \mosaic image"is regarded as a graph (the dual adjacencygraph, see Fig. 56), and morphological oper-ations are performed on this graph [120] inorder to merge adjacent regions with com-parable gray-levels. In fact, graph-gradientsand graph-watersheds can themselves be it-eratively applied to the original adjacencygraph. This results in an image pyramidcontaining a hierarchy of contours at di�er-ent resolutions [121].

� Starting again from an over-segmented\mosaic" of catchment basins (resemblingFig. 54c), some methods introduced byS. Beucher process the adjacency graph ofthe watershed arcs. Catchment basins arehierarchically merged via recursive removalof these contour elements in the graph [6].

� Lastly, in [90], Ph. Salembier and J. Serraapproach the problem of general image seg-mentation via a combination of �lters andwatersheds that is started at coarse scalesand progressively re�ned into more andmore detailed segmentations. Their ap-proach is therefore a region-splitting one,as opposed to the previous region-growingapproaches.

Obviously, the watersheds are of enormous inter-est for complex segmentation problems, and theabove solutions are barely starting to explore theextraordinary possibilities of this tool.

58

Page 59: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) original image (b) gradient of original image

(c) watersheds of gradient (d) minima of original image

(e) AS-�ltered image (f) minima of �ltered image

Figure 54. Segmentation of electrophoresis gels (1)

59

Page 60: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) �nal spot markers (b) background marker

(c) complete set of markers (d) modi�ed gradient

(e) watersheds of modi�ed gradient (f) overlayed result

Figure 55. Segmentation of electrophoresis spots (2)

60

Page 61: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 56. Mosaic image and associated adjacency graph.

Segmentation of Intricately OverlappingParticles

In binary segmentation, the marking by ulti-mate erosion has its limitations [136]: it is onlye�cient if, on the one hand, the components ofthe set X under study are \su�ciently blobby",and on the other hand, if they do not overlaptoo much. For instance, when X is composed oftwo overlapping discs, they are both marked byultimate erosion if and only if their centers arelocated on either sides of the radical axis (SeeFig.57).However, there exist more sophisticated mark-

ing tools. Among them, let us mention a transfor-mation called conditional bisector (see [72, page55] or [113]), in which the marking is no longerrelated to the maxima of the quench function butto the extrema of its derivative. For � 2 [0; �=2],X 2 IR2, and assuming that the skeleton S(X) iscontinuously di�erentiable, the �-conditional bi-sector of X can be de�ned as follows:

De�nition 39 The �-conditional bisector of X,denoted CB�(X) is the set of points of S(X)where the derivative of the quench function q

X

along the skeleton is within [� tan(�); tan(�)].

An e�cient algorithm for computing discrete ap-proximations of CB�(X) for any � has been pro-posed in [113]. It is extremely useful for marking\sharp" portions of sets.Similarly, when the set to be segmented is made

up of elongated particles, it may be of interest to

mark their extremities. This can be achieved ei-ther via techniques based on geodesic ultimateerosions or by means of the maxima of the prop-agation function [60, 95].Let us illustrate how the conditional bisector

can be used to solve a complex binary segmenta-tion application. Fig. 58a is a binary image of across section of vitreous �bers. These �bers areoverlapping and need to be separated. A veryacceptable marking of these �bers was proposedin [111] (Fig. 58b), resulting in the �rst water-shed segmentation shown in Fig. 58c. However,since some intricately overlapping �bers were notmarked, they are not separated in Fig. 58c (theseparticles are pointed at by arrows).In order ot mark them, a �=6-conditional bi-

sector was used (see Fig. 58d). Not only doesit mark these �bers, it also marks some \necks"between �bers. The latter are eliminated as cross-ing the separating lines of Fig. 58c (see Fig. 58e).Now, since some of the resulting markers are stillslightly disconnected, a connection technique de-scribed in [41, 113] was used: Fig. 58e is dilatedby a unit size disc, resulting in Fig. 58f. The lat-ter image is then skeletonized with the constraintthat the pixels of Fig. 58e belong to the resultingskeleton (see [124] for more details on constrainedskeletons). This results in Fig. 58g. Adding tothis image the markers of Fig. 58b yields the �nalmarker-image shown in Fig. 58h. At this stage,a new watershed segmentation provides the (al-most) perfect result of Fig. 58i.

61

Page 62: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Radical axis

Figure 57. These two discs overlap too much to be both marked by ultimate erosion

5. Conclusions

This chapter dealt with the segmentation ofimages of particles, and showed that adequatecombinations of simple morphological operationscan lead to powerful segmentation algorithms: westarted from elementary operations and progres-sively constructed a set of more and more elab-orate tools that �nally lead to watersheds andgrayscale reconstruction. As illustrated on nu-merous examples, they are extremely powerfuloperations for binary and grayscale object seg-mentation problems. In addition, throughout thischapter, we attempted to derive a general philos-ophy of object segmentation using mathematicalmorphology. The outcome of this can be summa-rized in just two words: markers and watersheds.The examples presented have each illustrated

a di�erent aspect of this morphological approachto segmentation. However, in no way are theseexamples full-size applications! There is practi-cally no trivial segmentation problem, and witheach new problem, comes a load of new di�cultiesto overcome: this leads to new ways to combineexisting operations, or even to completely newtransformations. The above segmentation philos-ophy should only be considered as a guideline forthe image analyst and should not put any con-straints on his or her creativity. In this way, eachnew application will lead to new advances andthe �eld of morphology will keep progressing andbeing continually enriched with new operations.

62

Page 63: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) original image (b) �rst marking (c) watershed segmentation

(d) �6 -conditional bisector (e) elimination of \neck" markers (f) dilation with unit square

(g) connection of markers in (e) (h) �nal markers (i) watershed segmentation

Figure 58. Use of conditional bisector and watersheds for the segmentation of binary images of glass�bers.

63

Page 64: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Part III

Morphological

Algorithms

This chapter is derived from \Mor-phological Algorithms", in \Mathe-matical Morphology in Image Pro-cessing", E. Dougherty Ed., Marcel-Dekker, New York, 1992, pages 255{288 (see [129]).

6. Introduction

This chapter is concerned with the e�cient im-plementation of \low-level" morphological trans-formations [66, 100]. The quali�er \low-level"used here means that we deal with the imple-mentation of transformations which serve as ele-mentary bricks when solving practical image anal-ysis problems. This does not mean that thesetransformations are simple, or cannot be decom-posed into simpler ones: on the contrary, someof the operations considered in this chapter (e.g.,skeletons, watersheds, propagation functions) arecomplex, both to de�ne and to compute! How-ever, from a user's perspective, these transfor-mations share the characteristics of being eas-ily and intuitively understandable: for example,watersheds extract from a gray-level image thecrest-lines which are located between the minima,top-hat transformations extract thin and light (ordark) regions, skeletons reduce binary shapes totheir medial axes, etc.Solving a moderately complex image analysis

application by morphological methods often in-volves the concatenation of several tens or hun-dreds of low-level transformations [136]. This isthe reason why each of these elementary bricksshould be implemented as e�ciently as possible.This task can be approached via various algo-rithmic techniques, the majority of which shallbe described in this chapter. Each category oftechniques is characterized by its advantages anddrawbacks, and illustrated using transformationsfor which it is particularly suited. For more de-tails, see [92, 123, 99].

The present section is �rst concerned with thenotations that will be used throughout the chap-ter. A particular transformation, the distancefunction, is also recalled, since it is used as a \leit-motiv" to illustrate how the described families ofalgorithms work. The characteristics one expectsmorphological algorithms to be equipped with arethen brie y discussed.Section 7 is devoted to the most classical mor-

phological algorithms, namely the parallel ones.As explained below, these algorithms turn out tobe rather ine�cient on conventional computers.A �rst step towards the implementation of fastmorphological algorithms was made by introduc-ing the sequential methods. They are presentedand illustrated in Section 8.Although sequential techniques serve very well

for the computation of transformations suchas distance function, granulometry function orgeodesic reconstruction (see Section 8), they re-main ine�cient in many cases, since they involvenumerous scannings of the entire image. To getrid of this problem, new scanning techniques havebeen introduced: the algorithms relying on themare such that, throughout the computation of agiven morphological transform, only those pixelslikely to be modi�ed are taken into account. Suchalgorithms are based on contours and can be di-vided up into two families: the chains and loopspropagation algorithms [92], which constitute thetopic of Section 9 and the queue algorithms [123],discussed in Section 10. Both families have beenrecently introduced in the morphology world andconstitute one of the best possible choices for im-plementing complex transformations on conven-tional computers. Not only do these methods leadto faster algorithms, they are also extremely ex-ible and usually produce more accurate results.We shall illustrate their use by the computationof such transformations as propagation functions,Euclidean distance functions, skeletons and wa-tersheds. Lastly, the conclusion summarizes thequalities and drawbacks of these categories of al-gorithms and provides some guidelines as to whatmethods should be used for a given purpose.

64

Page 65: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

6.1. Discrete images and grids, notationsIn the following, we consider binary and

grayscale images I as mappings from a rectan-gular domain DI � ZZ

2 into ZZ. A binary imagemay take only values 0 and 1, and is often re-duced to the set of its feature pixels, i.e., pixelswith value 1. Many of the algorithms describedbelow extend to n-dimensional spaces, but for thesake of simplicity, they will always be presentedfor 2-D images.The underlying grid G � ZZ

2 � ZZ2 de�nes the

neighborhood relations between pixels. G is usu-ally a square grid (of 4- or 8-connectivity) or ahexagonal one (see Fig. 59). NG(p) denotes theset of the neighbors of a pixel p 2 ZZ

2 accordingto grid G:

NG(p) = fq 2 ZZ2 j (p; q) 2 Gg:

The discrete distance associated with G is de-noted dG: dG(p; q) is the minimal length of thepaths of G connecting p to q.In the present chapter, we mostly use the

hexagonal grid (6-connectivity). Indeed, the dis-crete distance it induces, called hexagonal dis-tance and denoted d6, is more isotropic than thecity-block distance d4 or the chessboard distanced8, respectively induced by the square grid in 4-and 8-connectivity [20]. More importantly: thehexagonal grid is a triangulation and thus satis-�es the digital Jordan property [92, page 61] ac-cording to which every nondegenerate simple loopseparates the digital plane ZZ2 into two di�erentconnected components. As illustrated by Fig. 60,this is not true for square grids and causes endlesspractical di�culties. For example, when dealingwith square grids, consistency makes it often nec-essary to use 8-connectivity for the objects and4-connectivity for the background (or vice-versa)[123]. For these reasons, morphologists often pre-fer the hexagonal grid. Its elementary vectorsare denoted ~u0, ~u1,. . . ,~u5 and are illustrated byFig. 61. Note however that all the algorithms de-scribed below extend to any kind of discrete grid.The algorithms themselves are described in a

pseudo-code which bears similarities to C andPascal. It makes use of a certain number of key-words and symbols which are summarized in Ta-ble 4. Some shortcuts like:

Repeat until stability f. . .

or

For every pixel p0 in NG(p) f. . .

will also be used. Instructions speci�c to the typeof image scanning used by the algorithm beingdiscussed will be introduced as needed.

6.2. The distance functionThroughout the chapter, a particular transfor-

mation called the distance function [89, 20] isused to illustrate the four families of algorithmsdescribed. This transformation is indeed verytypical and gives rise to several di�erent imple-mentations. The distance function distX of a setX � ZZ

2 associates with each pixel of X its dis-tance to the background:

distX

�X �! ZZ

p 7�! minfdG(p; q) j q 62 Xg(54)

The distance function dI of a binary image I isequivalent to that of its set of feature pixels, i.e.,pixels with value 1. In addition, we put conven-tionally: 8p 2 DI ; I(p) = 0 ) distI(p) = 0. Anexample of distance function is shown in Fig. 62.

6.3. Estimating the quality of a morpho-logical algorithm

The performance of a morphological algorithmmay be de�ned using three main criteria: speed,accuracy and exibility.

SpeedThis is a crucial issue in the �eld of image anal-

ysis. Indeed, on the one hand, an application pro-gram is often designed to be used routinely, eitheron a large amount of data (e.g., in medicine), ordaily (e.g., in quality control). It is then unac-ceptable for the execution time to be larger thana speci�ed upper bound. On the other hand,even during the solution of a given image anal-ysis problem, many di�erent possibilities have tobe considered; for each of them, many transfor-mations have to be used, often repeatedly, withparameter adjustments, �lter modi�cations, etc.It is therefore extremely important for the im-age analyst to have fast algorithms at his or herdisposal: it considerably speeds up this develop-ment step and even enables to explore ideas which

65

Page 66: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

Figure 59. Square (a) and hexagonal (b) digital grids. The former one can be considered either in 4- or8-connectivity.

Table 4Symbols and keywords of the pseudo-code used for algorithm descriptions.

=, 6=, <, >, �, � Comparisons of values Assignmentf, g Beginning and end of group of instructions; End of instruction=?, ?= Beginning and end of commentsIf, then, else Logical testsFor. . . to; While; Repeat until Classical loopstrue, false Logical values

66

Page 67: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

(c)

Figure 60. Square grids of 4- or 8-connectivity do not satisfy the digital Jordan property, in contrast withthe hexagonal grid (c). Indeed, the simple nondegenerate loop drawn in (a) (4-connectivity) separates thediscrete plane into three connected components whereas that of (b) (8-connectivity) does not separateanything!

� �

� � �

� �

~u0~u1~u2

~u3~u4 ~u5

Figure 61. The 6 elementary vectors of the hexagonal grid.

67

Page 68: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) original image (b) distance function (c) level lines of this function

Figure 62. Example of hexagonal distance function.

could not be considered otherwise. For example,until recently, the use of the watershed transfor-mation [30, 8] was impossible in practice becauseof its prohibitive computation time. However, theappearance of the most recent specialized archi-tectures (e.g., the Quantimet 570 of Leitz) andalgorithms [123, 140] (see Section 10) has movedit to one of the highest ranking of morphologicalsegmentation tools.

AccuracyAn algorithm should of course give results

that are as accurate as possible. In fact,most of the time, the result is expected tobe totally exact. However, the de�nition ofsome transformations|like skeletons (see Sec-tion 10))|is sometimes not well adapted to thediscrete framework. The algorithms for comput-ing such transformations should then be designedto produce results \as close as possible" to thecontinous one. Morphological algorithms are alsoexpected to avoid some of the aberrations associ-ated with the use of discrete grids, like the \conee�ect" (see Fig. 63.b). Lastly, one often triesto compute morphological transformations in anisotropic fashion. This involves resorting to dis-crete distances d closer to the Euclidean one thandG (see Section 9).

FlexibilityBy exibility, we mean any of the following:

� the algorithm is adaptable to other grids,

� it works in both the Euclidean and geodesic[56] cases,

� it allows one to produce several transformsclose to one another,

� it is adaptable to several metrics.

Flexible algorithms are very interesting in thatthey spare the energy of the programmer and re-duce the implementation costs.

However, most algorithms cannot be extremelyfast, accurate and exible at the same time. Im-proving one of these characteristics is generallydone to the detriment of the two remaining ones.For example, increasing the accuracy of an algo-rithm mostly requires additional tests and com-putations which a�ect its speed. . . On the otherhand, morphological operations are not imple-mented in the same way on two di�erent comput-ers: on specialized architectures, complex trans-formations like skeletons and watersheds will beimplemented using built-in thinning and thicken-ing capabilities. However, such algorithms wouldbe terribly slow on classical computers, wheretheir execution times could be close to a coupleof hours!

68

Page 69: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

p

q

(a) (b)

Figure 63. Some di�culties in discrete spaces: (a) there exist several paths of minimal length betweentwo pixels; (b) the set of the pixels which are equidistant to two given connected components may be athick area: here, according to the hexagonal distance, all the bold pixels (gray area) are equidistant tothe two black ones!

6.4. Image structures and how to accessthem

The most common data structure to representand process binary and grayscale images is thetwo-dimensional array of pixels, all of which areeither 1, 8 or 16 bits. This type of structure isvery simple and enables a fast access to the neigh-bors of a given pixel, no matter what discrete gridis used. Several attempts have been made in mor-phology to manipulate images stored using di�er-ent data structures, e.g., quadtrees and octrees[91, 11], interval coding [81], structures stemmingfrom computational geometry, like polygons [82],etc. However, as explained in [123, page 22], noneof these structures is really adapted to the imple-mentation of morphological transformations.This is the reason why, in the following, we only

consider images stored as arrays of pixels. Wealways assume that the number of bits per pixelis su�cient and we do not account for edge e�ects.Indeed, as explained in [123, chapter 2], they areusually easy to cope with by giving to the pixelsof the frame a particular value, usually 0, �1 or+1. Here, the images under study are consideredto be de�ned in the entire space ZZ2 and to takevalue 0 outside of their de�nition domain, unlessotherwise mentioned. Additionally, special datastructures like loops or queues will be used tomanipulate these arrays of pixels e�ciently.

7. Parallel Algorithms

This category of algorithms is the most com-mon and classical one in the �eld of morphology.A parallel algorithm typically works as follows:given an input image I , the pixels of I are scannedand the new value of the current pixel p is deter-mined from that of the pixels in a given neigh-borhood N(p) of p. In doing this, the followingconstraint is satis�ed:

The new pixel values are written in anoutput image J di�erent from I.

J is then copied into I , and additional imagescannings are performed until a given criterionis ful�lled, or until stability is reached.Since I is di�erent from J , its pixels can actu-

ally be scanned in an arbitrary order. In partic-ular, one can imagine parallelizing the processingon some image parts, or even on all pixels, asis done by some specialized architectures. Here-after, a \parallel scanning" is introduced by a sen-tence like:

For every pixel p of DI , do f. . .

The parallel algorithm to determine the distancefunction of a binary image I in grid G is givenbelow in a pseudo-code.

Algorithm: parallel distance function

69

Page 70: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

� Input: I, binary image

� Output: J, gray image defined on

DI; J 6= I.

� Repeat until stability fFor every pixel p 2 DI f

=? actual parallel

scanning ?=If I(p) = 1 then

J(p) minfI(q); q 2 NG(p)g+ 1;g Copy image J in I;

g

This algorithm is illustrated on Fig. 64. One iseasily convinced that the number of scannings itrequires is proportional to the largest computeddistance. More generally, parallel algorithms usu-ally require a large number of complete imagescannings, sometimes several hundred! There-fore, although these algorithms are particularlysuited to some architectures, they are de�nitelynot adapted to conventional computers.The basic parallel algorithms (dilations, ero-

sions, distance function, etc) easily extend toany grid and to n-dimensional images [39], buthere again, prohibitive execution times limit theirpractical interest. Moreover, the parallel compu-tation of some more complex transformations likeskeletons [24] and skeletons by in uence zones(SKIZ) [53] is usually achived via iterations ofparallel thinnings or thickenings. These opera-tions involve structuring elements [100], i.e., pixeltemplates used as probes (see Golay's alphabet[40]). This is the reason why their adaptationto other grids requires cumbersome neighborhoodanalyses. This remark is even more true whenit comes time to extend these algorithms to n-dimensional data! Furthermore, although someof them can bring Euclidean distances into play[143], in many cases, the very local way paral-lel algorithms work leads to approximative trans-forms (e.g., for skeletons).

8. Sequential Algorithms

In an attempt to reduce the number of scan-nings required for the computation of an imagetransform, sequential or recursive algorithms have

been proposed [88]. They rely on the followingtwo principles:

� the image pixels are scanned in aprede�ned order, generally raster(left to right and top to bottom) oranti-raster,

� the new value of the current pixel,determined from the values of thepixels in its neighborhood, is writtendirectly in the same image, so thatit is taken into account when deter-mining the new values of the as yetunconsidered pixels.

Note that here, unlike for parallel algorithms, thescanning order is essential. A number of transfor-mations which can be obtained sequentially aredescribed in [57]. In the following, a sequentialscanning will be introduced by:

Scan DI in raster order fLet p be the current pixel; . . .

To compute a distance function sequentially, araster scanning followed by an anti-raster one aresu�cient [89]: out of the original binary image I ,the raster scanning creates an intermediate gray-level image, whose highest values are located inthe lower left part of the connected components ofI . Each feature pixel p of I is assigned the lengthof (one of) the shortest path P between p and thebackground, with the following constraint: everypath element xy of P has either a strictly positivevertical component (i.e., xy is pointing upwards)or a zero vertical component and a positive leftcomponent. This is why a second scanning, ofanti-raster type, is necessary to get from I 0 anactual distance function. This algorithm is givenbelow for the hexagonal distance:

Algorithm: sequential distance function

� input: I, binary image; =?Distance function is computed

directly in I ?=

70

Page 71: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

X

Figure 64. Successive steps involved in the parallel computation of a distance function.

71

Page 72: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

� Scan DI in raster order fLet p be the current pixel;

If I(p) 6= 0 then I(p) minfI(p+~u1)+1; I(p+~u2)+1; I(p+~u3)+1g;g

� Scan DI in anti-raster order fLet p be the current pixel;

If I(p) 6= 0 then

I(p) minfI(p); I(p+ ~u4) + 1; I(p+ ~u5) +1; I(p+ ~u0) + 1g;g

In all cases, the above algorithm only requirestwo image scannings. In comparison with the par-allel one, its thus constitutes a clear improvement!This is even more true since this sequential dis-tance function algorithm has been integrated intothe chip PIMM1 described in [50]. In fact, se-quential algorithms often constitute one of thebest possible choices. Some of the operationsthe implementation of which they are best suitedfor are mentioned below. In addition, sequen-tial algorithms such as the distance function oneare easily extended to n-dimensional spaces [19]and can be adapted to better discrete distances[20, 28].

Granulometry function, grayscale dilationsand erosionsLet I be a discrete binary image and let

(Bn)n�0 be a family of structuring elements suchthat the Bn's are the homothetics of a given con-vex set B. The following equations hold:

B0 = f~ogB1 = B

8n � 1; Bn+1 = Bn �B;(55)

� denoting the Minkowski addition. Let also Cdenote the morphological opening with respect tostructuring element C [102]. The granulometryfunction of I with respect to (Bn), denoted hereby g(I), associates with each pixel p 2 DI thesmallest integer k such that Bk(p) = 0. In otherwords:

g(I)

�DI �! ZZ

p 7�! minfk 2 ZZ+ j Bk(p) = 0g(56)

Just like the distance function of a binary im-age I is the \pile" of its successive erosions, thegranulometry function is nothing byt the pile ofits successive openings with respect to the Bn's.This means that by thresholding g(I) at value k,one simply gets the binary opening of I with re-spect to element Bk�1. The histogram of g(I)provides the granulometric analysis of I . Thus,although this transformation is not very excitingfrom a theoretical point of view, its great inter-est comes from the fact that it is possible to ob-tain it very quickly by using sequential methods.For example, the granulometry function shown inFig. 65 was obtained in three seconds on a Mac-intosh II. A very similar algorithm can be used todetermine grayscale dilations and erosions by theBn's.

Morphological shadowingThis is another case where sequential methods

outperform all other techniques. The shadow-ing of a grayscale image is realized through di-lation by a ray of the 3-D space ZZ2 � ZZ. Thisis often interesting for visualization purposes andcan be e�ciently implemented thanks to a recur-sive algorithm described in [122]. An example ofmorphological shadowing of a distance function isshown in Fig. 66. One can notice in this examplethat the crest-lines of the distance function havebeen highlighted, thereby leading to a family ofmethods for computing skeletons.

Geodesic reconstructionIn geodesic morphology [56], a transformation

called reconstruction turns out to be of immenseinterest. Given two (binary or grayscale) im-ages f and g such that g � f (i.e., for ev-ery pixel p, g(p) � f(p)), the reconstructionRf (g) of f from g is obtained by dilating ggeodesically under f until stability is reached.f is called the mask image whereas g is themarker. More precisely, denote by B the elemen-tary ball of the grid being used. For example,B is hexagon H in 6-connectivity, 5-pixel squareS1 in 4-connectivity or 9-pixel square S2 in 8-connectivity (see Fig. 23). Let �B stand for thedilation with respect to B and ^ be the pointwiseminimum. The reconstruction of f from g is ob-

72

Page 73: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 65. A binary image and its corresponding granulometry function with respect to a family ofsquares.

(a) original binary image (b) distance function with arti�cial shadowing

Figure 66. Shadowing of the distance function of a binary shape.

73

Page 74: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

tained by iterating the following operation untilstability is reached:

g �B(g) ^ f: (57)

In the binary case, reconstructing f from g al-lows us to extract those connected componentsof binary image f which contain at least a pixelof g [136]. This extends to the grayscale case interms of peaks: as illustrated by Fig. 67, onlythose peaks of f that are marked by g are pre-served through reconstruction. From Eq. (57), itis straightforward to derive a parallel algorithmfor binary and grayscale reconstruction, but itis particularly ine�cient on standard equipment.Here, it is much preferable to resort to a se-quential algorithm [57, 123]: like the sequentialdistance function algorithm previously described,the present one works by propagating informationdownwards in a raster scanning and then upwardsin an anti-raster scanning. Here however, as ex-plained later, these raster and anti-raster scan-nings have to be iterated until stability is reached(see Fig. 69). This algorithm is described belowfor the hexagonal case. It works for both thegrayscale and the binary case and usually onlyrequires around 10 complete image scannings:

Algorithm: sequential reconstruction

� Mask: I, binary or gray image

� Marker: J, image defined on domain

DI =? Reconstruction is computed in

marker-image J ?==? Note: we assume that

8p 2 DI ; J(p) � I(p) ?=

� Repeat until stability fScan DI in raster order f

Let p be the current pixel;

J(p) (maxfJ(p); J(p+ ~u1); J(p+ ~u2); J(p+ ~u3)g)^I(p);gScan DI in anti-raster order f

Let p be the current pixel;

J(p) (maxfJ(p); J(p+ ~u4); J(p+ ~u5); J(p+ ~u0)g)^I(p);

gg

As mentioned earlier, reconstruction is a par-ticularly powerful morphological tool. Its severalbinary applications (�ltering, hole �lling, etc) arerather well-know, but it is even more useful in thegrayscale case [136, 123]. For example, to extractthe maxima of an image I , it su�ces to recon-struct I from I � 1. By algebraic di�erence be-tween I and the reconstructed function, one getsthe desired maxima. Alternatively, the exampleof Fig. 68 illustrates the use of grayscale recon-struction for picture segmentation: Fig. 68.a isan image of blood vessels in the eye in which mi-croaneurisms have to be detected. They are smallcompact light spots which are disconnected fromthe network of the (light) blood vessels. To ex-tract them, the �rst step is to perform a seriesof openings of Fig. 68.a with respect to segmentsof di�erent orientations. These segments are cho-sen to be longer than any possible aneurism, sothat the aneurisms are removed by any such open-ing. On the other hand, since the blood vesselsare elongated and light, there will be at least oneorientation at which they are not completely re-moved by opening. After taking the supremumof these di�erent openings, one gets Fig. 68.b,which is still an algebraic opening of Fig. 68.a[102]. It is used as marker to reconstruct theblood vessels entirely. Fig. 68.c is the result ofthe grayscale reconstruction of Fig. 68.a fromFig. 68.b. Since the aneurisms are disconnectedfrom the blood vessels, they have not been recon-structed! Thus, by algebraic di�erence betweenFig. 68.a and Fig. 68.c, followed by thresholding,the microaneurisms shown in Fig. 68.d are easilyextracted.

The above reconstruction algorithm also under-scores some typical drawbacks of sequential algo-rithms. For example, in the binary case, when themask is a \rolled-up" particle, the number of im-age scannings required for its reconstruction maybe very important, as illustrated by Fig. 69. How-ever, only the values of a few pixels are actuallymodi�ed after each scanning!

74

Page 75: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

f

g

Figure 67. Grayscale reconstruction of f from g.

For this reason, a further step in the designof e�cient morphological algorithms consists inconsidering only the pixels whose value may bemodi�ed. A �rst scanning is used to detect thepixels which are the process initiators and aretypically located on the boundaries of the objectsor regions of interest. Then, starting from thesepixels, information is propagated only in the rel-evant image parts. The categories of algorithmsdescribed in the next two sections rely on theseprinciples. They both require a random access tothe image pixels as well as to the neighbors of agiven pixel.

9. Loop and Chain Algorithms

These methods were proposed in 1988 byM. Schmitt [92] and are based on the followingsimple remark:

in a metric space (E; d), the boundaryof the dilation �(X) of a set X by anisotropic structuring element is a curvewhich is parallel to the boundary of X.

This is illustrated by Fig. 70. Hence, if one isable to determine quickly the curves parallel toa given one, the calculation of isotropic dilationscan be e�ciently realized. This process can thenbe used to compute a large number of other mor-phological transformations which can be de�nedfrom isotropic dilations in an incremental fash-ion. Among others, distance functions, which arenothing but \piles" of erosions, are attainable thisway.

The �rst step of these algorithms therefore con-sists in a tracking of the contours of the image Iunder study and in their encoding as Freemanloops [34]. A loop L is a data structure made of:

1. an origin pixel OrL,

2. a length l(L),

3. a list of l(L) integers of the segment [0; 5],coding the elementary vectors ~u0, ~u1, . . . ,~u5 of the hexagonal grid.

The two extremities of a loop coincide. An ex-ample of a loop and of its encoding is shown inFig. 71.Given a loop L coding the boundary of a set

X � ZZ2, the dilated loop �L|coding the bound-

ary of �(X)|is determined by means of rewritingrules. These rules allow one to derive from twosuccessive contour elements of L a certain num-ber (between 0 and 5) of contour elements of �L.The dilated loop is thus obtained from L in lineartime with respect to l(L). In the hexagonal case,there are exactly six rewriting rules (up to the sixrotations), which are illustrated by Fig. 72. Rulenumber 4 may seem useless, but is in fact essen-tial as soon as two successive dilations have beenperformed [92].Now, once the dilated loops are determined,

they must be written in the image and the corre-sponding pixels have to be given the appropriatevalue. For example in the case of a binary dila-tion, the pixels corresponding to the dilated loopshave to be assigned value 1. In fact, while theloops are written in the original image, one can

75

Page 76: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Microaneurisms

(a) (b)

(c) (d)

Figure 68. Use of grayscale reconstruction for image segmentation: (a) original image blood vessels, (b)supremum of openings by segments, (c) reconstructed image, (d) microaneurisms obtained by substracting(c) from (a) and thresholding the result.

76

Page 77: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

X

Y

1. 2. 3.

4. 5. 6.

Figure 69. The sequential computation of a binary reconstruction in a rolled up mask may involve severalcomplete image scannings: here, the hatched zones represent the pixels which have been modi�ed aftereach step.

Boundary of

Boundary of= curve parallel to the boundary of

X

δ(X)

Isotropic dilation

X

δ(X)

X

Figure 70. The boundary of the dilated set �(X) is parallel to the boundary of X .

77

Page 78: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

PL

l(L) = 25

Or P=L

Directions: 4,3,5,5,4,3,0,0,1,3,2,1,0,0,5,0,0,2,2,1,2,4,3,4,3,

Figure 71. Example of a loop and of its encoding.

Rule 0 :

Rule 1 :

Rule 2 :

Rule 3 :

Rule 4 :

Rule 5 :

Figure 72. Rewriting rules allowing to determine �L from L.

78

Page 79: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

detect if some of them intersect. For example,it may well happen that two loops coming fromtwo di�erent connected components intersect af-ter a dilation step, as illustrated by Fig. 73. Insuch cases, the overlapping parts become uselessand can be cut. The remaining loop parts arecalled chains: they are nothing but loops whoseextremities do not coincide, and are manipulatedexactly as loops by using the rewriting rules ofFig. 72. They can well be cut again at furthersteps. An example of a chain dilation is shown inFig. 74. The succession of operations described inthis paragraph is referred to as adjustment. Moreprecisely, during this adjustment step, one onlykeeps the chain or loop parts which are locatedin a given mask (set of pixels having a certainvalue) and gives them the appropriate value.As an illustration, let us consider again the case

of the hexagonal distance function. To determineit, we iterate dilations and adjustments of thechains until stability is reached. After each step,the value given to pixels in the \adjusted" chainsis incremented by 1.

Algorithm: distance function by chains and loops

� input: I, binary image; =?Distance is directly computed in I?=

� Track the contours of IC

(complement image) and encode them

as loops;

� dist 2; =? variable

containing the current distance ?=

� Repeat until there remain chains or

loops fDilate the chains and the loops;

Adjust them in the mask

fp 2 DI j I(p) = 1g, giving the

corresponding pixels value dist;dist dist+ 1;

g

Like almost all the algorithms relying on thischain propagation principle, the above one onlyrequires two image scannings: one for the contour

tracking step plus one scanning of the feature pix-els only in the propagation step (in fact here, toavoid an additional scanning, the algorithm is de-signed to yield distI + 1).Chains and loops algorithms are thus extremely

fast. Moreover, after the initial contour trackingis achieved, loops and chains may well be propa-gated inside a given mask: for this reason, thepresent methods are particularly suited to thecomputation of binary geodesic transformations[92]. In this framework, they are the fastest tech-niques available.

Propagation functionThe previous remark is particularly true for

the propagation function of a simply connectedset, where chain propagation methods provide theonly known e�cient algorithm [93, 60]. Recallthat the propagation function p

Xassociates with

each pixel of a connected set X its geodesic dis-tance to the farthest pixel of X :

pX

�X �! ZZ

+

p 7�! supfdX(p; q) j q 2 Xg:(58)

The algorithm for computing pX is detailed in [92]for the hexagonal case. It basically works throughthe determination of a supremum of geodesic dis-tance functions, each of these being obtained viachain propagations. This transformation is illus-trated by Fig. 75 in the case of a 4-connectedsquare grid. It has a very large number of prac-tical applications, ranging from the extraction ofextremities and geodesic centers [92] to the deter-mination of anti-skeletons [94].

Euclidean distance function and applica-tionsChains and loops algorithms are exible in that

they can also be adapted to better distances: forexample, the dodecagonal one can be obtainedby modifying the rewriting rules of Fig. 72 [92,pages 86{89]. But it is even possible to adaptthese algorithms to actual Euclidean distance[125]: the idea is to modify the chain and loopstructure as well as the rewriting rules of Fig. 72in such a way that Euclidean distances are con-veyed in the image by theses structures. Previ-ous algorithms were of sequential type and only

79

Page 80: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Loop partsto be eliminated

Figure 73. After dilation, certain loop parts must be eliminated: this is the adjustment step, in whichchains are created. Here, the original (two) loops are located around the gray areas, and the parts of thedilated loops to be cut are drawn in a bold stroke.

Dilated chain

Original chain

Figure 74. Dilation of a chain. Note that a loop has been created here, which will be eliminated duringthe adjustment step.

Figure 75. Level lines of the 4-connected propagation function of a binary image.

80

Page 81: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

yielded more isotropic distances [20] or approxi-mations of Euclidean distance functions [28]. Anexample of exact Euclidean distance function isshown in Fig. 76.The same technique extend to the determina-

tion of Euclidean skeletons [75] and skeletons byin uence zones [53]. Additionally, Delaunay tri-angulations [82, 18], Gabriel graphs [38] and rel-ative neighborhood graphs [115] can be derivedfrom these methods, and obtained in arbitrary bi-nary pictures [123, 125]. Examples can be foundin the chapter of the present book entitled \GraphMorphology in Image Analysis" [47].

Morphological transformations with arbi-trary structuring elementsOther extensions of the present loop based

methods include e�cient algorithms for comput-ing binary dilations, erosions, openings and clos-ings with structuring elements of arbitrary sizeand shape [126]. Here, chains and loops are nolonger propagated in the image. Instead, the in-volved structuring element is encoded appropri-ately and propagated along the loops represent-ing the set to be dilated or eroded. Combining anerosion and a dilation step allows us to determineopenings and closings equally well, as illustratedby Fig. 77.

To summarize, chains and loops are particu-larly e�cient for the computation of binary mor-phological transformations and give rise to theinteresting extensions described above. Unfortu-nately, they are not easy to adapt from one gridto another. Furthermore, they do not extend tomultidimensional spaces. In these respects, thealgorithms based on queues of pixels which arediscussed below are much more general.

10. Algorithms Based on Queues of Pixels

In this section, we again satisfy the principleaccording to which only the \interesting" imagepixels are considered at each step. The imageunder study is regarded as a graph whose ver-tices are the pixels, and whose edges are pro-vided by the discrete grid G. Then, instead ofloops and chains, we make use of a queue ofpixels to perform breadth-�rst scannings of this

graph. This idea has already proved to be partic-ularly interesting in image analysis and morpho-logy [118, 123].A queue is a First-In-First-Out (FIFO) data

structure, which means that the pixels which are�rst put into it are those which can �rst be ex-tracted. In other words, each new pixel includedin the queue is put on one side whereas a pixelbeing removed is taken from the other side (seeFig. 78). In practice a queue is simply a largeenough array of pointers to pixel, on which threeoperations may be performed:

� �fo add(p): puts the (pointer to)pixel p into the queue.

� �fo �rst(): returns the (pointerto) pixel which is at the beginning ofthe queue, and removes it.

� �fo empty(): returns true if thequeue is empty and false otherwise.

The implementation of our distance functionusing this queue and the above operations is ac-complished as follows:

Algorithm: distance function using a queue of pixels

� input: I, binary image; =?Distance function is computed in Idirectly ?=

� For every pixel p 2 DI, do f=? detection of the

pixels to be initially put on the

queue ?=If I(p) = 1 and

9p0 2 NG(p); I(p0) = 0 f�fo add(p);I(p) 2;

gg

� While �fo empty() = false fp �fo �rst();For every p0 2 NG(p) f

If I(p0) = 1 f

81

Page 82: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 76. Comparison between hexagonal and Euclidean distance function.

Figure 77. Binary opening and closing by an arbitrary (and weird!) structuring element.

82

Page 83: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

P0 P1 P2 P3 P4 P5 P6

First pixel to be extracted

New pixelsadded

Figure 78. How a queue of pixels works.

I(p0) I(p) + 1;�fo add(p0);

gg

g

Here again, this algorithm actually yieldsdistI+1, a trick which avoids an additional imagescanning.Like the methods described in the previous sec-

tion, queue based algorithms are extremely e�-cient, in both the non-geodesic and the geodesiccases. The simplicity of the above distance func-tion procedure is also interesting, and this charac-teristic is shared by most FIFO algorithms. Theyare thus more suited than the chain propagationones to the development of procedures for com-puting complex transformations like grayscale re-construction (for an e�cient alternative to thesequential algorithm described in Section 8, see[123, chapter 6]), skeletons and watersheds. Thelatter two are brie y described and illustrated be-low.Moreover, contrary to the chain propagation

algorithms, the present ones are extremely easyto adapt from one grid to another, since it suf-�ces to modify the function that generates theneighbors of a given pixel. Similarly, their exten-sion to n-dimensional images and even to graphsis straightforward. They have been used to im-plement a large number of morphological trans-formations on graphs [120], which have alreadybeen used in physical applications [138, 49] andare expected to be of great interest for complexpicture segmentation tasks [121]. Several ideasand algorithms about mathematical morphology

on graphs can be found in [119] or in chapter\Graph Morphology in Image Analysis", in thepresent book [47].

SkeletonsThe skeleton transformation is widely used in

morphological image processing. It was intro-duced by Blum in 1961 as the medial axis trans-formation [15]. The de�nition he proposed isbased on the concept of grass�re: assuming agrass�re starting from the boundary of a setX � ZZ

2 is propagating within it a uniform speed,the skeleton S(X) of X is the set of the pixelswhere di�erent �refronts meet. This is illustratedby Fig. 79. A more formal de�nition of the skele-ton was then proposed by Calabi [24], based onthe notion of maximal ball: the skeleton of Xis de�ned as the locus its maximal balls for theused metrics. One can show that this skeletoncan be obtained as the set of local maxima of thedistance function of X [123, 124].Unfortunately, a well-known result is that the

skeleton by maximal balls, sometimes called thetrue skeleton, is not necessarily connected eventhough the original set is! However, to be usefulin practice, skeletonization needs to be a homo-topic transformation [100]: roughly speaking, itneeds to preserve the number of connected com-ponents and the number of holes in the originalset, as well as the inclusion relationships betweenthese components and holes. The practical prob-lem with the implementation of skeletons consiststherefore in extracting an object of unit-widthwhich would be as close as possible to the skeletonby maximal balls, while preserving the homotopyof the original set. The �rst class of methods

83

Page 84: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

X

S(X)

grassfire

Figure 79. The skeleton can be viewed as the locus of the pixels where two �refronts stemming from theobjects boundaries meet.

proposed in the literature are part of what wereferred to in this chapter as parallel algorithms(see Section 7). They consist in removing suc-cessive peels of the set by means of homotopicthinnings until stability is reached [100]. For ex-ample, with hexagonal connectivity one gener-ally performs homotopic thinnings with respectto structuring elements L shown in Fig. 80 [40].The main drawbacks of these techniques are theirine�ciency and the fact that the resulting ob-jects, though homotopic and of unit width, havenot much in common with skeletons by maximalballs!Sequential algorithms based on the crest-lines

of the distance function have also been proposed[74, 76]. They are more e�cient than the previousones (they work in a �xed number of images scan-nings), produce accurate results and can even beextended to Euclidan distances [75]. However, asexplained in [124], these algorithms require cum-bersome neighborhood analyses and their exi-bility is rather poor. Other methods proposedin the literature include computational geometrybased algorithms [82] as well as contour-basedtechniques [2, 142]. They are among the moste�cient methods, but are very complex, have lit-tle exibility and only allow the determination ofone given type of skeleton (see [123]).Based on the above remarks, the skeleton algo-

rithm detailed in [124] makes use of homotopicpeelings, crest points and contours: more pre-

cisely, starting from the boundaries of X , suc-cessive peelings are realized until stability (i.e.,one-pixel thickness) is reached. These peelings|or grass�re propagation process|are e�cientlyimplemented via a queue of pixels. At every step,the current pixel p may be removed (i.e., givenvalue 0) if and only if one of the following condi-tions is ful�lled:

1. p does not belong to the skeleton by maxi-mal balls. In other words, p is not a crest-point (local maximum) of the distance func-tion.

2. Removing p does not modify the homotopylocally.

The �rst condition assures the accuracy of the re-sult in that it will be a superset of the skeletonby maximal balls. The second one means that theresulting object is homotopic; the local homotopycheckings are realized via specially designed look-up tables [124]. In this skeletonization process,the pixels belonging to the skeleton by maximalballs play the role of anchor points: the �refrontsstemming from the boundaries of X tend to an-chor themselves on these particular points. Anexample of skeletonization based on these princi-ples is shown in Fig. 81.Like every FIFO algorithm, the present one is

particularly e�cient since only the feature pixelsare considered during the �re propagation step.

84

Page 85: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Figure 80. The two-phase structuring element L and its 6 rotations.

(a) original image (b) distance function (c) level lines of this function

(d) skeleton by maximal balls (e) propagation of the �refront (f) �nal skeleton

Figure 81. Construction of the standard skeleton.

85

Page 86: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

For example, the skeletonization process illus-trated by Fig. 81 takes less than one second on aSun Sparc Station 1. The resulting skeletons arealso more accurate than with most other meth-ods: they are skeletons by maximal balls to whichconnecting arcs of unit thickness have been addedfor homotopy preservation.The algorithm works in the Euclidean case as

well as in the geodesic one. Most interestingly,it allows us to calculate a whole range of di�er-ent skeleton-like transformations whose compu-tation is hardly possible otherwise: this is simplyachieved by using di�erent sets of anchor points.For example, by taking as anchor points the re-gional maxima of the distance function instead ofits local maxima, one gets an object referred toin the literature as the minimal skeleton. Simi-larly, an empty set of anchor points results in a\homotopic marking" of the set. Using as anchorpoints only the local maxima of elevation greaterthan n yields a smoother skeleton called skeletonof order n [124]. Any of these skeletons can thenbe post-processed via prunings, themselves real-ized via FIFO algorithms. Fig. 82 shows a sampleof these possibilities. To summarize, the presentqueue-based skeleton algorithm is particularly ef-�cient, accurate and exible.

WatershedsIn the last decade, increasing attention has

been put on the watershed trasformation as atool for image segmentation [30, 8, 6, 140]. Itis de�ned for grayscale images via the notion ofa catchment basin: let us regard the image un-der study as a topographic relief (where the gray-level of a pixel stands for its altitude) on which itis raining on. A drop of water falling at a pointp ows down along a steepest slope path until itis trapped in a minimum m of the relief. Theset C(m) of the pixels such that a drop fallingon them eventually reachesm is called catchmentbasin associated with the minimumm. The set ofthe boundaries of the di�erent catchment basinsof an image constitute its watersheds. These no-tions are demonstrated in Fig. 83.Here again, numerous techniques have been

proposed to determine watersheds in digital pic-tures. The major ones are reviewed in [123, 140].

One of the most interesting algorithms, originallyproposed by Beucher, consists of \inverting" thewatershed de�nition. Consider that the minimaof the image|regarded here as a 3-D surface|have been pierced and that this image is slowlyimmersed into a lake. The water progressively oods the di�erent catchment basins, and at somepoint, water originating from two di�erent min-ima will merge, thereby connecting the corre-sponding catchment basins. We prevent this byerecting dams at every place where connectionwould otherwise occur. Once the surface is totallyimmersed, the set of dams thus built correspondsto the watersheds of the initial image.This immersion and dam erection process can

now be simulated by an algorithm. The most e�-cient algorithm described in the literature makesuse of FIFO breadth-�rst scanning techniques forthe actual ooding of the catchment basins [140].A labelling of the catchment basins is also used,which automatically prevents the connection oftwo di�erent basins. It has been shown that theresults provided by this technique are more accu-rate that those of any other method. For exam-ple, the cone e�ect of Fig. 63.b is always avoided.Furthermore, just like almost all other FIFO al-gorithm, the present one extends to any grid andany dimension in a straightforward manner.This algorithm dramatically reduces the com-

putation times required for extracting water-sheds. On conventional computers, previous ap-proaches typically needed up to a couple of hours!The present one takes around 5 to 10 seconds ona Macintosh II, for a 256� 256 image, thus open-ing the door to powerful segmentation methodsin inexpensive software-based systems.Let us conclude this section by an example of

application of the present algorithm. We considerhere Fig. 84.a: it is part of a series of successiveimages of the same scene, and the problem is torecover the motion of the camera. One of theapproaches taken to solve this motion estimationproblem consists of decomposing the images intoregions and to match these regions over successivetime frames [36]. Performing this decompositionby means of watershed techniques turns out toprovide meaningful regions, which are then eas-ily matched from one image to the next one [37].

86

Page 87: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) original image (b) standard skeleton (c) minimal skeleton

(d) homotopic marking (e) pruned skeleton (16 iterations) (f) skeleton of order 16

Figure 82. Various kinds of skeletons which may be e�ciently determined using algorithms based onqueues of pixels [124]. This example was produced using the hexagonal grid.

Minima

Watersheds

Catchmentbasins

Figure 83. Minima, catchment basins and watersheds.

87

Page 88: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Following the methodology described in [136], thewatershed tool is applied to the morphologicalgradient of the original image (Fig. 84.c). In fact,to avoid oversegmentation, the watersheds of thegradient are constrained by a marker image. Themarkers are connected components of pixels be-longing to each of the regions to be extracted,and are obtained in this case from the intensity\domes" and \basins" of the original image (seeFig. 84.b). The result of this constrained wa-tershed transformation is the highest watershedlines of the gradient which are located betweentwo markers (Fig. 84.d). The entire segmenta-tion process takes approximately 5 seconds on aSun Sparc Station 2.

11. Conclusion and Summary

Table 5 summarizes the qualities and draw-backs of the families of algorithms which havebeen brie y reviewed in this chapter. Now, inpractice, what algorithm should be chosen to im-plement a given transformation in a given envi-ronment? Of course, there is no absolute answerto this question. However, the following guide-lines can be proposed:

� Parallel algorithms should generally beavoided, unless running on specialized ar-chitectures.

� Sequential algorithms constitute one of thebest choices to implement grayscale recon-structions, grayscale dilations and erosionswith some structuring elements, and gran-ulometry functions.

� Chain and loop methods should be chosenwhenever binary transformations are con-cerned. They are indeed the fastest in thiscase, particularly for geodesic operations(reconstruction, geodesic distance function,hole �lling, labelling, etc), and provide theonly known e�cient propagation functionalgorithm.

� FIFO algorithms will be preferred in allother cases, and in particular in the fol-lowing ones: geodesic transformations in

square grids, n-dimensional or graph mor-phology, complex transformation like skele-tons, SKIZ and watersheds.

Clearly, the last two families are going to be-come increasingly important in the future. Re-gardless of accuracy and exibility considerations,chain or queue algorithms are often faster on con-ventional computers than parallel algorithms onspecialized hardwares! Now, a few years after theintroduction of the parallel morphological algo-rithms, the �rst specialized hardwares were builton these principles. Between the publication ofthe sequential distance function algorithm (1968)and its �rst hardware implementation (1989),more than twenty years have elapsed. Let us hopethat we will not have to wait twenty more years tosee the �rst hardware realizing queue based mor-phological operations. Indeed, this would proba-bly allow us to compute complex morphologicaltransformations in just several hundredths of asecond.

88

Page 89: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

(a) (b)

(c) (d)

Figure 84. Example of a watershed segmentation: (a) original image, (b) marker image, (c) gradientimage, (d) �nal segmentation obtained via watersheds of the gradient controlled by the markers.

89

Page 90: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

Table 5Respective qualities of the various families of algorithms.

Family of algorithms speed accuracy (ifappropriate)

adaptationto othergrids

developmentease

hardwareimplementation

parallel x xx xx xxx xxxxsequential xx xx xx xx xxx

loops and chains xxxx xxx x xxx xqueues xxx xxx xxxx xxxx x

90

Page 91: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

REFERENCES

1. A. Aho, J. Hopcroft, and J. Ullman. DataStructures and Algorithms. Addison-Wesley,1985.

2. C. Arcelli, L. Cordella, and S. Levialdi. Fromlocal maxima to connected skeletons. IEEETrans. Pattern Anal. Machine Intell., 2:134{143, 1981.

3. G. Bertrand and X. Wang. An algorithm fora generalized distance transformation basedon Minkowski operations. In 9th Inter-national Conference on Pattern recognition,pages 1163{1167, Rome, Nov. 1988.

4. S. Beucher. Analyse automatique des gelsd'electrophor�ese bi-dimensionnels et mor-phologie math�ematique. Technical report,Ecole des Mines, CGMM, Paris, 1982.

5. S. Beucher. Watersheds of functions andpicture segmentation. In IEEE Int. Conf.on Acoustics, Speech and Signal Processing,pages 1928{1931, Paris, May 1982.

6. S. Beucher. Segmentation d'Images et Mor-phologie Math�ematique. PhD thesis, Ecoledes Mines, Paris, June 1990.

7. S. Beucher, J.-M. Blosseville, and F. Lenoir.Tra�c spatial measurements using video im-age processing. In SPIE Vol. 848, IntelligentRobots and Computer Vision, pages 648{655,Cambridge MA, 1987.

8. S. Beucher and C. Lantu�ejoul. Use ofwatersheds in contour detection. In In-ternational Workshop on Image Process-ing, Real-Time Edge and Motion Detec-tion/Estimation, Rennes, France, 1979.

9. S. Beucher and F. Meyer. The morpholog-ical approach to segmentation: the water-

shed transformation. In E. R. Dougherty, ed-itor, Mathematical Morphology in Image Pro-cessing, pages 433{481. Marcel-Dekker, Sept.1992.

10. S. Beucher and L. Vincent. Introduction auxoutils morphologiques de segmentation. InTraitement d'Images en Microscopie �a Bal-ayage et en Microanalyse par Sonde Elec-tronique, pages F41{F43. ANRT, Paris, Mar.1990.

11. I. Bloch. Morphologie math�ematique etrepr�esentation d'images par arbres. Technicalreport, Ecole des Mines, CMM, Paris, 1987.

12. D. S. Bloomberg. Connectivity-preservingmorphological image transformations. InSPIE Vol. 1606, Visual Communications andImage Processing, Boston MA, Nov. 1991.

13. D. S. Bloomberg. Image analysis usingthreshold reductions. In SPIE Vol. 1568, Im-age Algebra and Morphological Image Pro-cessing II, pages 38{52, San Diego CA, July1991.

14. D. S. Bloomberg and P. Maragos. General-ized hit-miss operations. In SPIE Vol. 1350,Image Algebra and Morphological Image Pro-cessing I, San Diego CA, July 1990.

15. H. Blum. An associative machine for dealingwith the visual �eld and some of its biologi-cal implications. In E. Bernard and M. Kare,editors, Biological Prototypes and SyntheticSystems, pages 244{260. Plenum Press, NewYork, 1962. Proc. second Annual BionicsSymposium, Cornell University, 1961.

16. H. Blum. A transformation for extractingnew descriptors of shape. In W. Wathen-Dunn, editor, Symposium on Models for thePerception of Speech and Visual Form, pages362{380, Cambridge MA, Nov. 1964. MITPress.

17. H. Blum. Biological shape and visual sci-ence (part i). Journal of Theoretical Biology,38:205{287, 1973.

18. J.-D. Boissonat. Shape reconstruction fromplanar cross-sections. Technical report, IN-RIA, Le Chesnay, France, 1986.

19. G. Borgefors. Distance transformations inarbitrary dimensions. Comp. Vis., Graphicsand Image Processing, 27:321{345, 1984.

91

Page 92: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

20. G. Borgefors. Distance transformations indigital images. Comp. Vis., Graphics and Im-age Processing, 34:334{371, 1986.

21. J. Brandt and V. Algazi. Lossy encoding ofdocument images using the continuous skele-ton. In SPIE Vol. 1818, Visual Communica-tions and Image Processing, Boston MA, Nov.1992.

22. E. J. Breen and D. H. Monro. An evalua-tion of priority queues for mathematical mor-phology. In J. Serra and P. Soille, editors,EURASIP Workshop ISMM'94, Mathemati-cal Morphology and its Applications to ImageProcessing, pages 249{256, Fontainebleau,France, Sept. 1994. Kluwer Academic Pub-lishers.

23. J. Bresenham. An incremental algorithm fordigital plotting. In ACM National Confer-ence, 1963.

24. L. Calabi andW. Harnett. Shape recognition,prairie �res, convex de�ciencies and skeletons.Technical Report 1, Parke Math. Lab. Inc.,One River Road, Carlisle MA, 1966.

25. Y. Chen and E. Dougherty. Texture clas-si�cation by gray-scale morphological granu-lometries. In SPIE Vol. 1818, Visual Com-munications and Image Processing, BostonMA, Nov. 1992.

26. S. H. Collins. Terrain parameters directlyfrom a digital terrain model. The CanadianSurveyor, 29(5):507{518, 1975.

27. M. Coster and J.-L. Chermant. Pr�ecisd'Analyse d'Images. CNRS Ed., Paris, 1985.

28. P. Danielsson. Euclidean distance map-ping. Comp. Graphics and Image Processing,14:227{248, 1980.

29. C. S. Davis, S. M. Gallager, and A. R. Solow.Microaggregations of oceanic plankton ob-served by towed video microscopy. Science,257:230{232, Jan. 1992.

30. H. Digabel and C. Lantu�ejoul. Iterative algo-rithms. In J.-L. Chermant, editor, 2nd Euro-pean Symposium on Quantitative Analysis ofMicrostructures in Material Science, Biologyand Medicine, pages 85{99, Stuttgart FRG,1978. Riederer Verlag.

31. E. Dougherty, J. Pelz, F. Sand, and A. Lent.Morphological image segmentation by local

granulometric size distributions. Journal ofElectronic Imaging, 1(1), Jan. 1992.

32. E. R. Dougherty. An Introduction to Mor-phological Image Processing. SPIE Press,Bellingham, WA, Feb. 1992.

33. E. R. Dougherty, editor. Mathematical Mor-phology in Image Processing. Marcel-Dekker,New York, 1992.

34. H. Freeman. On the encoding of arbitrarygeometric con�gurations. IEEE Transactionson Computers, C10:260{268, 1961.

35. F. Friedlander. A sequential algorithm for de-tecting watersheds on a gray level image. InActa Stereologica Vol. 6/III, pages 663{668,Caen, France, Sept. 1987. 7th InternationalCongress For Stereology.

36. C.-S. Fuh and P. Maragos. Region-based op-tical ow estimation. In IEEE Int. ComputerVision and Pattern Recog. Conference, pages130{135, San Diego CA, 1989.

37. C.-S. Fuh, P. Maragos, and L. Vincent.Region-based approaches to visual motioncorrespondence. Technical report, HRL, Har-vard University, Cambridge, 1991. Submittedto PAMI.

38. K. Gabriel and R. Sokal. A new statistical ap-proach to geographic variations analysis. Sys-tematic Zoology, 18:259{278, 1969.

39. S. Gesbert, V. Howard, D. Jeulin, andF. Meyer. The use of basic morphologicaloperations for 3-d biological image analysis.Transactions of the Royal Microscopical So-ciety, 1, 1991.

40. M. Golay. Hexagonal pattern transforms.IEEE Trans. on Computers, 18(8), 1969.

41. G. G. Gordon and L. Vincent. Applicationof morphology to feature extraction for facerecognition. In SPIE/SPSE Vol. 1658, Non-linear Image Processing III, pages 151{164,San Jose CA, Feb. 1992.

42. M. Grimaud. A new measure of contrast:Dynamics. In SPIE Vol. 1769, Image Alge-bra and Morphological Image Processing III,pages 292{305, San Diego CA, July 1992.

43. R. Haralick and L. Shapiro. Survey: Im-age segmentation techniques. Comp. Vis.,Graphics and Image Processing, 29:100{132,1985.

92

Page 93: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

44. R. M. Haralick, S. Chen, and T. Kanungo.Recursive opening transform. In IEEE Int.Computer Vision and Pattern Recog. Con-ference, pages 560{565, Champaign IL, June1992.

45. R. M. Haralick and L. G. Shapiro. Computerand Robot Vision. Addison-Wesley, 1991.

46. H. Heijmans. Morphological Image Opera-tors. Academic Press, Boston, 1994.

47. H. Heijmans and L. Vincent. Graph morpho-logy in image analysis. In E. R. Dougherty,editor, Mathematical Morphology in ImageProcessing, pages 171{203. Marcel-Dekker,Sept. 1992.

48. E. Isaac and R. Singleton. Sorting by addresscalculation. Journal ACM, 3:169{174, 1956.

49. D. Jeulin, L. Vincent, and G. Serpe. Propa-gation algorithms on graphs for physical ap-plications. JVCIR, 3(2):161{181, June 1992.

50. J.-C. Klein and R. Peyrard. PIMM1, an im-age processing ASIC based on mathematicalmorphology. In IEEE's ASIC Seminar andExhibit, pages 25{28, Rochester NY, 1989.

51. D. E. Knuth. The Art of Computer Pro-gramming, Vol. 3: Sorting and Searching.Addison-Wesley, 1973.

52. E. J. Kraus, H. Heijmans, and E. R.Dougherty. Gray-scale granulometries com-patible with spatial scalings. Signal Process-ing, 34:1{17, 1993.

53. C. Lantu�ejoul. Issues of digital image process-ing. In R. M. Haralick and J.-C. Simon, ed-itors, Skeletonization in Quantitative Metal-lography. Sijtho� and Noordho�, Groningen,The Netherlands, 1980.

54. C. Lantu�ejoul. Geodesic segmentation. InMulticomputers and Image Processing Algo-rithms and Programs, pages 111{124. Aca-demic Press, 1982.

55. C. Lantu�ejoul and S. Beucher. On the use ofthe geodesic metric in image analysis. Jour-nal of Microscopy, 121:39{49, Jan. 1981.

56. C. Lantu�ejoul and F. Maisonneuve. Geodesicmethods in quantitative image analysis. Pat-tern Recognition, 17(2):177{187, 1984.

57. B. La�y. Recursive algorithms in mathe-matical morphology. In Acta StereologicaVol. 6/III, pages 691{696, Caen, France,

Sept. 1987. 7th International Congress ForStereology.

58. F. Leymarie and M. D. Levine. Snakes andskeletons. Technical Report TR-CIM-89{3,McGill University, Montr�eal, Jan. 1989.

59. F. Maisonneuve. Extrema r�egionaux: Algo-rithme parall�ele. Technical Report 781, Ecoledes Mines, CGMM, Paris, 1982.

60. F. Maisonneuve and M. Schmitt. An e�cientalgorithm to compute the hexagonal and do-decagonal propagation function. In 5th Euro-pean Congress For Stereology, pages 515{520,Freiburg im Breisgau FRG, Sept. 1989. ActaStereologica. Vol. 8/2.

61. P. Maragos. Pattern spectrum and multiscaleshape representation. IEEE Trans. PatternAnal. Machine Intell., 11(7):701{716, July1989.

62. P. Maragos and R. Schafer. Morphological�lters|part i: their set-theoretic analysis andrelations to linear shift-invariant �lters. IEEETrans. on Acoustics, Speech and Signal Pro-cessing, 35(8):1153{1169, Aug. 1987.

63. P. Maragos and R. Schafer. Morphologi-cal �lters|part ii: their relations to me-dian, order-statistics, and stack �lters. IEEETrans. on Acoustics, Speech and Signal Pro-cessing, 35(8):1170{1184, Aug. 1987.

64. P. Maragos and R. Zi�. Threshold superpo-sition in morphological image analysis. IEEETrans. Pattern Anal. Machine Intell., 12(5),May 1990.

65. G. Matheron. El�ements pour une Th�eorie desMilieux Poreux. Masson, Paris, 1967.

66. G. Matheron. Random Sets and Integral Ge-ometry. John Wiley and Sons, New York,1975.

67. G. Matheron. Examples of topological prop-erties of skeletons. In J. Serra, editor, Im-age Analysis and Mathematical Morphology,Volume 2: Theoretical Advances. AcademicPress, London, 1988.

68. G. Matheron. Filters and lattices. InJ. Serra, editor, Image Analysis and Math-ematical Morphology, Volume 2: TheoreticalAdvances. Academic Press, London, 1988.

69. G. Matheron. On the negligibility of theskeleton and the absolute continuity of ero-

93

Page 94: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

sions. In J. Serra, editor, Image Analysis andMathematical Morphology, Volume 2: The-oretical Advances. Academic Press, London,1988.

70. G. Matheron. Estimating and Choosing.Springer Verlag, 1989.

71. F. Meyer. Contrast feature extraction. InJ.-L. Chermant, editor, Quantitative Analy-sis of Microstructures in Material Sciences,Biology and Medicine, Stuttgart, FRG, 1978.Riederer Verlag. Special issue of PracticalMetallography.

72. F. Meyer. Cytologie Quantitative et Mor-phologie Math�ematique. PhD thesis, Ecoledes Mines, Paris, 1979.

73. F. Meyer. Skeletons in digital spaces. InJ. Serra, editor, Image Analysis and Math-ematical Morphology, Volume 2: TheoreticalAdvances. Academic Press, London, 1988.

74. F. Meyer. Skeletons and perceptual graphs.Signal Processing, 16(4):335{363, 1989.

75. F. Meyer. Digital Euclidean skeletons. InSPIE Vol. 1360, Visual Communications andImage Processing, pages 251{262, Lausanne,Switzerland, Oct. 1990.

76. A. Montanvert. Contribution au Traitementde Formes Discr�etes. Squelettes et Codagepar Graphe de la Ligne M�ediane. PhD the-sis, Universit�e Scienti�que, Technologique etM�edicale de Grenoble, France, 1987.

77. A. Montanvert, P. Meer, and A. Rosenfeld.Hierarchical image analysis using irregulartesselations. IEEE Trans. Pattern Anal. Ma-chine Intell., 13(4):307{316, Apr. 1992.

78. L. Najman and M. Schmitt. A dynamichierarchical segmentation algorithm. InJ. Serra and P. Soille, editors, EURASIPWorkshop ISMM'94, Mathematical Morpho-logy and its Applications to Image Processing,Fontainebleau, France, Sept. 1994. KluwerAcademic Publishers.

79. D. Paglerioni. Distance transforms: Proper-ties and machine vision applications. Comp.Vis., Graph. Im. Proc.: Graphical Models andImage Processing, 54(1):56{74, Jan. 1992.

80. T. Peli,L. Vincent, and V. Tom. Morphology-basedalgorithms for target detection/segmentation

in ir imagery. In SPIE Vol. 1957, Issues inAutomatic Target Recognition, Orlando, FL,Apr. 1993.

81. L. Piper and J.-Y. Tang. Erosion and dilationof binary images by arbitrary structuring el-ements using interval coding. Pattern Recog-nition Letters, pages 201{209, Apr. 1989.

82. F. Preparata and M. Shamos. ComputationalGeometry: an Introduction. Springer Verlag,1985.

83. C. Richardson and R. Schafer. A lower boundfor binary structuring element decomposi-tions. IEEE Trans. Pattern Anal. MachineIntell., 1990. (to appear).

84. J.-F. Rivest, P. Soille, and S. Beucher.Morphological gradients. In SPIE/SPSEVol. 1658, Nonlinear Image Processing III,pages 139{150, Feb. 1992.

85. C. Ronse and H. Heijmans. The algebraicbasis of mathematical morphology. part II:Openings and closings. Comp. Vis., Graph,and Im. Proc.: Image Understanding, 54:74{97, 1991.

86. A. Rosenfeld. Connectivity in digital pic-tures. Journal of the ACM, 17(1):146{160,1970.

87. A. Rosenfeld and A. Kak. Digital Image Pro-cessing. Academic Press, New York, 1976.

88. A. Rosenfeld and J. Pfaltz. Sequential oper-ations in digital picture processing. J. Assoc.Comp. Mach., 13(4):471{494, 1966.

89. A. Rosenfeld and J. Pfaltz. Distance func-tions on digital pictures. Pattern Recognition,1:33{61, 1968.

90. P. Salembier and J. Serra. Morphologicalmultiscale image segmentation. In SPIEVol. 1818, Visual Communications and Im-age Processing, Boston, MA, Nov. 1992.

91. H. Samet. The quadtree and other related hi-erarchical data structures. ACM ComputingSurveys, 16(2):87{260, 1984.

92. M. Schmitt. Des Algorithmes Morphologiques�a l'Intelligence Arti�cielle. PhD thesis, Ecoledes Mines, Paris, Feb. 1989.

93. M. Schmitt. Geodesic arcs in non-euclideanmetrics: Application to the propagation func-tion. Revue d'Intelligence Arti�cielle, 3(2):43{76, 1989.

94

Page 95: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

94. M. Schmitt. The anti-skeleton: some theo-retical properties and application. In SPIEVol. 1360, Visual Communications and Im-age Processing, Lausanne, Switzerland, Oct.1990.

95. M. Schmitt. Variations on a theme in bi-nary mathematical morphology. Journal ofVisual Communication and Image Represen-tation, 2(3):244{258, Sept. 1991.

96. M. Schmitt. On two inverse problemsin mathematical morphology. In E. R.Dougherty, editor, Mathematical Morphologyin Image Processing. Marcel-Dekker, Inc.,1992.

97. M. Schmitt and J. Mattioli. Shape recog-nition combining mathematical morphologyand neural networks. In SPIE: Application ofArti�cial Neural Network, Orlando, Florida,Apr. 1991.

98. M. Schmitt and J. Mattioli. MorphologieMath�ematique. Masson, Paris, 1994.

99. M. Schmitt and L. Vincent. MorphologicalImage Analysis: a Practical and AlgorithmicHandbook. Cambridge University Press, (toappear in 1997).

100.J. Serra. Image Analysis and MathematicalMorphology. Academic Press, London, 1982.

101.J. Serra. Introduction to mathematical mor-phology. Comp. Vis., Graphics and ImageProcessing, 35:283{305, 1986.

102.J. Serra, editor. Image Analysis and Math-ematical Morphology, Volume 2: TheoreticalAdvances. Academic Press, London, 1988.

103.J. Serra and L. Vincent. An overview of mor-phological �ltering. Circuits, Systems andSignal Processing, 11(1):47{108, Jan. 1992.

104.F. Shih and H. Wu. Optimization onEuclidean distance transformation usinggrayscale morphology. Journal of VisualCommunication and Image Representation,3(2):104{114, 1992.

105.M. Skolnick. Application of morphologi-cal tranformations to the analysis of two-dimensional electrophoretic gels of biologicalmaterials. Comp. Vis., Graphics and ImageProcessing, 35(3):306{332, Sept. 1986.

106.D. D. Sleator and R. E. Tarjan. Self-adjustingbinary search trees. Journal of the Associ-

ation for Computing Machinery, 32(3):652{686, July 1985.

107.P. Soille. Morphologie Math�ematique: duRelief �a la Dimensionalit�e|Algorithmes etM�ethodes. PhD thesis, Universit�e Catholiquede Louvain, 1992.

108.P. Soille and M. Ansoult. Automated BasinDelineation from DEMs Using MathematicalMorphology. Signal Processing, 20:171{182,1990.

109.S. R. Sternberg. Parallel architecture for im-age processing. In 3rd Int. IEEE Compsac,Chicago, 1979.

110.S. R. Sternberg. Grayscale morphology.Comp. Vis., Graphics and Image Processing,35:333{355, 1986.

111.H. Talbot. Binary image segmentation usingweighted skeletons. In SPIE Vol. 1769, ImageAlgebra and Morphological Image ProcessingIII, pages 393{403, San Diego, CA, 1992.

112.H. Talbot. Analyse Morphologique de Fibres.PhD thesis, Ecole des Mines, Paris, Oct. 1993.

113.H. Talbot and L. Vincent. Euclidean skele-tons and conditional bisectors. In SPIEVol. 1818, Visual Communications and Im-age Processing, pages 862{876, Boston, MA,Nov. 1992.

114.H. Tamura. A comparison of line thinning al-gorithms from digital geometry viewpoint. In4th Int. Joint Conf. on Pattern Recognition,pages 715{719, Kyoto, Japan, Nov. 1978.

115.G. T. Toussaint. The Relative NeighborhoodGraph of a �nite planar set. Pattern Recog-nition, 12:1324{1347, 1980.

116.C. Vachier and L. Vincent. Valuation of im-age extrema using alternating �lters by re-construction. In SPIE Vol. 2568, Neural,Morphological, and Stochastic Methods in Im-age and Signal Processing, pages 94{103, SanDiego, CA, July 1995.

117.R. Van den Boomgaard. Mathematical Mor-phology: Extensions Towards Computer Vi-sion. PhD thesis, University of Amsterdam,Amsterdam, Mar. 1992.

118.L. van Vliet and B. J. Verwer. A contourprocessing method for fast binary neighbour-hood operations. Pattern Recognition Let-ters, 7:27{36, Jan. 1988.

95

Page 96: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

119.L. Vincent. Mathematical morphology ongraphs. In SPIE Vol. 1001, Visual Communi-cations and Image Processing, pages 95{105,Cambridge, MA, Nov. 1988.

120.L. Vincent. Graphs and mathematical mor-phology. Signal Processing, 16:365{388, Apr.1989.

121.L. Vincent. Mathematical morphology forgraphs applied to image description and seg-mentation. In Electronic Imaging West 89,pages Vol. 1, pp. 313{318, Pasadena, CA,1989.

122.L. Vincent. Morphological shading and shad-owing algorithm. In Herm�es, editor, PIXIM89, Computer Graphics in Paris, pages 109{124, Paris, 1989.

123.L. Vincent. Algorithmes Morphologiques �aBase de Files d'Attente et de Lacets: Ex-tension aux Graphes. PhD thesis, Ecole desMines, Paris, May 1990.

124.L. Vincent. E�cient computation of varioustypes of skeletons. In SPIE Vol. 1445, Medi-cal Imaging V, pages 297{311, San Jose, CA,1991.

125.L. Vincent. Exact euclidean distance functionby chain propagations. In IEEE Int. Com-puter Vision and Pattern Recog. Conference,pages 520{525, Maui, HI, June 1991.

126.L. Vincent. Morphological transformations ofbinary images with arbitrary structuring el-ements. Signal Processing, 22(1):3{23, Jan.1991.

127.L. Vincent. New trends in morphological al-gorithms. In SPIE/SPSE Vol. 1451, Nonlin-ear Image Processing II, pages 158{169, SanJose, CA, Feb. 1991.

128.L. Vincent. Recent developments inmorphological algorithms. In 8th Inter-national Congress For Stereology, pagesVol. 11/Suppl 1, pp. 521{532, Irvine, CA,Aug. 1991. Acta Stereologica. invited con-ference.

129.L. Vincent. Morphological algorithms. InE. R. Dougherty, editor, Mathematical Mor-phology in Image Processing, pages 255{288.Marcel-Dekker, Inc., New York, Sept. 1992.

130.L. Vincent. Morphological area openings andclosings for grayscale images. In NATO Shape

in Picture Workshop, pages 197{208, Drieber-gen, The Netherlands, Sept. 1992.

131.L. Vincent. Grayscale area openings and clos-ings: their e�cient implementation and ap-plications. In EURASIP Workshop on Math-ematical Morphology and its Applications toSignal Processing, pages 22{27, Barcelona,May 1993.

132.L. Vincent. Morphological grayscale recon-struction in image analysis: Applications ande�cient algorithms. IEEE Transactions onImage Processing, 2(2):176{201, Apr. 1993.

133.L. Vincent. Fast grayscale granulometry al-gorithms. In J. Serra and P. Soille, editors,EURASIP Workshop ISMM'94, Mathemati-cal Morphology and its Applications to ImageProcessing, pages 265{272, Fontainebleau,France, Sept. 1994. Kluwer Academic Pub-lishers.

134.L. Vincent. Fast opening functions andmorphological granulometries. In SPIEVol. 2300, Image Algebra and Morphologi-cal Image Processing V, pages 253{267, SanDiego, CA, July 1994.

135.L. Vincent. Grayscale granulometries: Fastalgorithms and new image analysis applica-tions. manuscript, to be published, June1994.

136.L. Vincent and S. Beucher. The morpho-logical approach to segmentation: an intro-duction. Technical report, Ecole des Mines,CMM, Paris, 1989.

137.L. Vincent and E. R. Dougherty. Morpholog-ical segmentation for textures and particles.In E. R. Dougherty, editor, Digital ImageProcessing Methods, pages 43{102. Marcel-Dekker, New York, 1994.

138.L. Vincent and D. Jeulin. Minimal paths andcrack propagation simulations. In 5th Euro-pean Congress For Stereology, pages 487{494,Freiburg im Breisgau FRG, Sept. 1989. ActaStereologica. Vol. 8/2.

139.L. Vincent and B. Masters. Morphologi-cal image processing and network analysisof corneal endothelial cell images. In SPIEVol. 1769, Image Algebra and Morphologi-cal Image Processing III, pages 212{226, SanDiego, CA, July 1992.

96

Page 97: Summer School · Zakopane, Poland pro cess: X is sifted through a series of siev es with increasing mesh size. Eac h op ening (corresp ond-ing to one mesh size) remo v es more than

Summer Schoolon Morphological Image and Signal Processing

27-30 September, 1995Zakopane, Poland

140.L. Vincent and P. Soille. Watersheds in dig-ital spaces: an e�cient algorithm based onimmersion simulations. IEEE Trans. PatternAnal. Machine Intell., 13(6):583{598, June1991.

141.P. Wendt, E. Coyle, and N. Gallagher. Stack�lters. IEEE Transactions on AcousticsSpeech and Signal Processing, 34(4):898{911,Aug. 1986.

142.Y. Xia. Skeletonization via the realizationof the �re front's propagation and extinctionin digital binary shapes. IEEE Trans. Pat-tern Anal. Machine Intell., 11(10):1076{1086,1989.

143.H. Yamada. Complete euclidean distancetransformation by parallel operations. In 7thInternational Conference on Pattern Recogni-tion, pages 69{71, Montreal, 1984.

144.P.-F. Yang and P. Maragos. Morphologicalsystems for character image processing andrecognition. In IEEE International Confer-ence on Acoustics, Speech, and Signal Pro-cessing, pages V.97{100, Minneapolis, MN,Apr. 1993.

145.L.-P. Yuan. A fast algorithm for size anal-ysis of irregular pore areas. In SPIE/SPSEVol. 1451, Nonlinear Image Processing II,pages 125{136, San Jose, CA, Feb. 1991.

97