28
COMPUTER GRAPHICS AND IMAGE PROCESSING 20.3 19-346 (1982) A Generalized Distance Transformation of a Line Pattern with Gray Values and Its Applications JUN-ICHIROTORIWAKI,MASAHIKOTANAKA,*' ANDTERUO FUKUMURA* School of Information and Computer Science, Toyohushi University of Technology, l-l, Hibari-ga-oka, Tenpaku-cho, Toyohashi, 440, Japan, and *Department of Information Science, Facul(v of Engineering. Nagoya lJniversi[v, Furo-cho, Chikusa-ku, Nagoya, 464, Japan Received June 29, 198 I ; revised December 14, 198 1 The distance transformation of a line pattern (DTLP) is discussed. The DTLP is a transformation of a binary pattern developed for extracting useful features to analyze and recognize a given pictorial data. The basic type (BDTLP) has already been reported; a modification and a generalization of the BDTLP is presented. The modified DTLP (MDTLP) is derived by defining an inhibited edge point among the edge points of an input line pattern. By applying the MDTLP, information on the length of a line pattern is concentrated on the inhibited edge point instead of the center point as in the case of the BDTLP. The generalized DTLP (GDTLP) is a parallel iterative local operation applied to a line pattern with gray values. whose execution is controlled by the BDTLP or the MDTLP performed on another picture plane containing a binarized version of an input line pattern. It enables one to process a line pattern with arbitrary gray values on it as well as a binary pattern. Experimental results are shown concerning the application of the GDTLP to the processing of ridge and ravine lines extracted from a digitized map data. An application of the type II MDTLP to the extraction of information on the loop structure of a line pattern is also presented with illustrative examples. I. INTRODUCTION It remains a difficult problem in the area of image understanding and recognition to extract from digitized pictorial data the features or cues useful for understanding a given picture, although a large number of reports have been published about low level operations. Parallel processing of pictorial data has recently become more important because of the vast amount of data to be processed and the increasing possibility that the system could be implemented by inexpensive hardware. In spite of a wide variety of existing techniques, however, parallel processing algorithms for line-pattern analysis are not so numerous. The relaxation method can be used for enhancing linelike components in a gray-level picture [ 11, and giving labels to explain a set of incomplete curve segments in a consistent way [2], but it has not been applied to the feature extraction of a line pattern. There exist a few other operations, such as the classification of a pixel or the assignment of the directional code for a line pattern, which can be implemented in a parallel form and have been widely used in various image processing systems [3,4]. However, a line pattern has been regarded as the final output of a sequence of parallel processing procedures. Usually the resultant output is converted into a list of coordinate values or a chain-code sequence and then processed by standard list processing (or symbol string analysis) techniques. Since parallel processing is adopted for the preprocessing, however, it is reasonable to require that the ensuing line pattern also be processed in a parallel form. ‘Present address: Hitachi Co., Ltd. 319 Copyright 0 1982 by Academic Press. Inc. All rights of reproduction in any form reserved.

A generalized distance transformation of a line pattern with gray values and its applications

Embed Size (px)

Citation preview

Page 1: A generalized distance transformation of a line pattern with gray values and its applications

COMPUTER GRAPHICS AND IMAGE PROCESSING 20.3 19-346 (1982)

A Generalized Distance Transformation of a Line Pattern with Gray Values and Its Applications

JUN-ICHIROTORIWAKI,MASAHIKOTANAKA,*' ANDTERUO FUKUMURA*

School of Information and Computer Science, Toyohushi University of Technology, l-l, Hibari-ga-oka, Tenpaku-cho, Toyohashi, 440, Japan, and *Department of Information Science,

Facul(v of Engineering. Nagoya lJniversi[v, Furo-cho, Chikusa-ku, Nagoya, 464, Japan

Received June 29, 198 I ; revised December 14, 198 1

The distance transformation of a line pattern (DTLP) is discussed. The DTLP is a transformation of a binary pattern developed for extracting useful features to analyze and recognize a given pictorial data. The basic type (BDTLP) has already been reported; a modification and a generalization of the BDTLP is presented. The modified DTLP (MDTLP) is derived by defining an inhibited edge point among the edge points of an input line pattern. By applying the MDTLP, information on the length of a line pattern is concentrated on the inhibited edge point instead of the center point as in the case of the BDTLP. The generalized DTLP (GDTLP) is a parallel iterative local operation applied to a line pattern with gray values. whose execution is controlled by the BDTLP or the MDTLP performed on another picture plane containing a binarized version of an input line pattern. It enables one to process a line pattern with arbitrary gray values on it as well as a binary pattern. Experimental results are shown concerning the application of the GDTLP to the processing of ridge and ravine lines extracted from a digitized map data. An application of the type II MDTLP to the extraction of information on the loop structure of a line pattern is also presented with illustrative examples.

I. INTRODUCTION

It remains a difficult problem in the area of image understanding and recognition to extract from digitized pictorial data the features or cues useful for understanding a given picture, although a large number of reports have been published about low level operations. Parallel processing of pictorial data has recently become more important because of the vast amount of data to be processed and the increasing possibility that the system could be implemented by inexpensive hardware. In spite of a wide variety of existing techniques, however, parallel processing algorithms for line-pattern analysis are not so numerous. The relaxation method can be used for enhancing linelike components in a gray-level picture [ 11, and giving labels to explain a set of incomplete curve segments in a consistent way [2], but it has not been applied to the feature extraction of a line pattern. There exist a few other operations, such as the classification of a pixel or the assignment of the directional code for a line pattern, which can be implemented in a parallel form and have been widely used in various image processing systems [3,4]. However, a line pattern has been regarded as the final output of a sequence of parallel processing procedures. Usually the resultant output is converted into a list of coordinate values or a chain-code sequence and then processed by standard list processing (or symbol string analysis) techniques. Since parallel processing is adopted for the preprocessing, however, it is reasonable to require that the ensuing line pattern also be processed in a parallel form.

‘Present address: Hitachi Co., Ltd. 319

Copyright 0 1982 by Academic Press. Inc. All rights of reproduction in any form reserved.

Page 2: A generalized distance transformation of a line pattern with gray values and its applications

320 TORIWAKI, TANAKA, AND FUKUMURA

The authors proposed a family of parallel processing algorithms for a line pattern called a DTLP (distance transformation on a line pattern) [5, 61. DTLP is a transformation of a binary line pattern by which the value at each l-pixel in an input pattern is changed into the distance measured along a line from that pixel to a suitably chosen edge point. The hierarchical description of a line pattern is derived by assigning a level determined by the type I DTLP to each branch [6]. This idea can be applied to analyze a medial axis or a thinned figure in the course of the thinning operation [7].

This paper presents a modification and generalization of DTLP with several applications. The modified DTLP (MDTLP) is derived in Section 3.3 by defining an inhibited edge point among the edge points of an input line pattern. When the wave-propagation analogy is used as in [.5] and [6], no wave starts at the inhibited edge point. Such modification makes it possible to concentrate the information on the length of a line pattern on the inhibited edge instead of the center point of an input line pattern. The generalization of DTLP discussed in Section 3.4 is more important because it enables us to process a line pattern with a gray value (gray picture) as well as a binary picture. The generalized DTLP (GDTLP) is a parallel iterative local operation performed on a plane (propagating information plane) containing a line pattern with gray values. Execution of this operation is controlled by another parallel local operation performed on the other plane (control inforrna- tion plane) containing a binarized version of an input picture. The DTLP reported previously or the MDTLP is used as the control information. Many different processings can be derived within this framework of combining the control informa-, tion and the propagating information by employing various types of the processing for both planes. Three types of GDTLP, the total-sum type, the maximum-input type, and the minimum-input type, are defined in the paper.

Examples of their applications to real pictorial data are given in Section 4.1. They include the analysis of a ridge line and a ravine line automatically extracted from digitized terrain elevation data. Part of a ridge-line structure of which the average elevation is highest is extracted by the maximum-input type GDTLP. The stream number system in [8] and the same kind of results as in [9] are obtained by the total-sum type GDTLP with MDTLP as the control information.

The MDTLP associated with the type II DTLP has interesting features that can be effectively used to extract information on the loop structure of a line pattern. In Section 4.2, fundamental properties of the type II MDTLP are shown. and the methods for finding primitive loops and eliminating loops without splitting original connected components are presented with a few illustrative examples. The results obtained here reveal that the type II DTLP is remarkably useful in analyzing the structure of a line pattern from a viewpoint quite different from the type I DTLP.

2. OUTLINE OF THE DISTANCE TRANSFORMATION ON A LINE PATTERN (DTLP)--INFORMAL DESCRIPTION

We shall first give an informal description of the distance transformation algo- rithm discussed in the paper. As was presented in [6], the basic distance transforrna- tion on a line pattern (BDTLP) is the transformation of a binary line pattern by which the value at each l-pixel (pixel of value 1) in an input picture is changed into the distance measured along a line pattern from that pixel to a suitably chosen edge point. There are two ways to determine the distance: to measure the distance along

Page 3: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 321

the longest path including the point to be considered in a line pattern, and to measure it along the shortest path.

In such a case as shown in Fig. 1, for example, the longest path through P is sPv. Therefore the smaller of the two lengths d, and d, is given to P (Fig. lb). On the other hand, the shortest path passing through P is tPu. In this case the smaller of d; and d; is given to P (Fig. lb). The former is called type I DTLP and the latter, type II DTLP. Identical processing is done at every pixel on a line pattern.

This transformation is formally described by an iterative local parallel algorithm C[O], C[l], C[2], . . . which will be presented in Section 3. In Fig. 2A we show how this algorithm works. First, a picture G(O) is set equal to an input picture F. By applying the operator C[O] to G(O), the picture G(l) is obtained in which only the distance value at the edge point is determined as 1. A suitable mark is given to these edge points to show that their distance values have already been determined.

In the second picture G (2) obtained by applying the operator E[ I] to G(‘) distance values of pixels adjacent to edge points are determined as 2. These points are marked in the same way. By repeating the procedure, the distance values are calculated point by point from all edge points along a line pattern. The way in which the fronts of the determined distance values proceed along a line pattern can be compared to the propagation of a wave on a line pattern, propagating at a constant velocity along the line pattern, starting from all the edge points at the same time.

There are two kinds of behavior of such waves at a branching point. In the first, the latest wave can enter into the branching point; that is, the distance value of the branching point cannot be determined until all but one of the adjacent points have been given their distance values, as shown in (e)-(g) of Fig. 2A. In the second, the

a b

FIG. 1. Illustration of the BDTLP

Page 4: A generalized distance transformation of a line pattern with gray values and its applications

322 TORIWAKI, TANAKA, AND FUKUMURA

---+m------ r. LD

-

-.. v-.7 ID

-&

-- m

-- -&

Page 5: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 323

Page 6: A generalized distance transformation of a line pattern with gray values and its applications

324 TORIWAKI, TANAKA, AND FUKUMURA

wave arriving first goes into the branching point; thus the distance value at the branching point is determined as soon as one of adjacent points has been assigned its distance value, as observed in (h) and (i) of Fig. 2A.

As was shown in [5] and [6], the picture becomes invariant for all operations f [k ] such that k is greater than a certain finite value N. All distance values have been determined at this stage. It should be noted that the mark showing that the distance has been determined is unnecessary because the number of iterations also provides information on the distance values already determined by that stage.

Now let us consider what happens if we forbid the wave on a line pattern to start at one of the edge points. Assume, for example, that the wave starts only at the top and the left edges in Fig. 2A. The result is shown in Fig. 2B. The forbidden edge point works as if it were the root of the tree structure. All waves propagate toward this inhibited edge; therefore all information carried by the waves can be collected to the forbidden edge point. We will call this type of DTLP the modified DTLP or the limited edge point DTLP (LEP-DTLP) of types I and II.

The BDTLP and the LEP-DTLP can be applied to line patterns with gray values on them by using the following procedure. Let us consider the input pattern F = (A,} (f,, denotes a gray value at a pixel (i, j)) as shown in Fig. 2C. First we generate the binary version FB of this input pattern by replacing all positive values by 1. The figure Fa is the same as the one in Fig. 2A.

Then we generate two picture sequences (FB(ot = Fa, Fb’), FL’), . . I } and (G “‘) -- F, G(l), G’*‘, . . . } by the following operation. The first sequence is obtained by applying the BDTLP to F,, and so is exactly the same as the one in Fig. 2A. The k th picture G (k) = (g!k)> in the second sequence is calculated from the (k - 1)st picture G’k-1) = {g,, ck - I);/ by the following rule. If the wave on a line pattern in FB proceeds to a pixel (i, j) from an adjacent pixel ( p, q) at the k th iteration (in the k th picture G(“‘) for the first time, the gray value at the pixel (i, j) of the picture Gck’ is equal to the sum of gray values at the pixels (i, j) and ( p, q) of the previous picture Gck - I), that is, ,I$~’ = g&h -I) + g,, (k-‘) Otherwise, the gray values are kept un- . changed, that is, g(k) = g,‘,” ‘). By this operation, all the gray values of pixels the wave has visited ze accumulated and stored at a local maximum point of the BDTLP performed on the binarized input picture Fu. At a branching point where more than one wave comes in, the maximum of the carried values is sent out to the remaining exit (maximum-input type). If we employ the limited edge point DTLP instead of the BDTLP above, we obtain the sequence shown in Fig. 2D.

Another example is shown in Fig. 2E, where the input pattern F has the value 1 at all edge points (except an inhibited edge) of the same binary pattern F, as that in Fig. 2B. (Note that Fa is not a binary version of the picture F in this case.) Suppose that the LEP-DTLP shown in Fig. 2B is applied to the picture FB and that density values on the picture F are sequentially accumulated along a line pattern in FB according to the propagation of the wave on it. At a branching point, all gray values carried by incoming waves are added to the gray value on the branching point and sent to a neighboring pixel that has not been visited by any wave. The accumulated value is stored in a pixel at which the wave arrives last, that is, in the inhibited edge point. This is an extremely simple example prepared for illustration; a significant application will be shown in Section 4.1 (see also Fig. 7).

The examples shown in Fig. 2C-E are considered as a two-plane system, which will be called the generalized distance transformation on a line pattern (GDTLP).

Page 7: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 325

One of those two planes stores a line figure (or part of a line figure) with gray values, and the other has a binary line pattern (usually a binarized version of a line pattern to be processed). We call the former a propagation information plane (PIP) and the latter a control information plane (CIP). The BDTLP or the LEP-DTLP applied to the CIP controls propagation of the wave on a given line pattern. Gray values stored in the PIP propagate and are accumulated along a path the wave proceeds on in a line pattern in the CIP. This two-plane system suggests a new basic concept in image processing-that is, a procedure controlled by another procedure.

The information carried by the wave in the GDTLP will vary according to applications. There are many different ways of information propagation at a branching point. Three types among them-the total-sum type, the maximum-input type, and the minimum-input type will be discussed later in the paper. In the total-sum type, the sum of all information values transferred to a branching point goes out from the branching point. The maximum (minimum) of information values carried to a branching point is sent out from that branching point in the maximum (minimum)-input type.

3. DISTANCE TRANSFORMATION ON A LINE PATTERN-BASIC TYPE

For the readers’ convenience we shall give a formal description of the basic type DTLP (BDTLP) by quoting from [6].

3.1. Notations and Basic Definitions

In this paper only a digitized picture sampled at points of a rectangular ordered array with definite numbers of rows and columns is considered. Each pixel located on the i th row and the j th column of the digitized picture is represented in any one of three ways: the row and column number pair (i, j), a two-dimensional vector p = (i, j), and the proper name given to it such as P and Q. A picture having the density value fij at the pixel (i, j) is denoted by F = {hi}. Notations fp and fp may be used instead of fi,, according to the representation of the pixel (i, j).

DEFINITION 1 (Binary and positive pictures). A picture F is called a binary picture if f,, = 0 or 1 for all (i, j), and a positive picture if f,, 2 0 for all (i, j). Pixels with densities 0 and 1 are called O-pixels and l-pixels, respectively.

Let S, S,, and S, denote three sets of integers (1,2,3,4,5,6,7, S}, {1,3,5,7}, and {2,4,6, S}, and let eight vectors with length 1 or fi be denoted by p, = (0, l), ,$ = (-l,l), p3 = (-I,()), p4 = c--l, -l>, p5 = (0, --l), p6 = (l, -l>, p7 = (ko), and ps = (l,l).

DEFINITION 2 (Neighborhood). The three sets of pixels {p + pK; K E S,}, {p + PK; K E s>, and (P + PK; K E S,} are called the 4-neighbors, 8-neighbors, and diagonal neighbors of the pixel P, and are denoted by Nc4)(P), N(a)(P), and N(,)(P), respectively (Fig. 3).

DEFINITION 3 (Connectivity). Three types of connectivity are considered here. Two pixels P and Q with a common value are said to be connected, if one of the following conditions is satisfied.

(i) Q E NC,,(P), 4-connectivity (4-c). (ii) Q E N(*)(P), 8-connectivity (8-c).

Page 8: A generalized distance transformation of a line pattern with gray values and its applications

326 TORIWAKI, TANAKA, AND FUKUMURA

(iii) Denoting the density values of P and R by fp and fR, respectively,

Q E Nc4#') or Q E N&p) and fR * .I;

mixed-type connectivity (m-c).

Any one of 4-q 8-c, and m-c may be adopted for the analysis of any partioular problem.

DEFINITION 4 (Picture operator). An operator on a picture is defined as a mapping from the set of pictures 9, into TZ5)2; that is it:: 9, ---) ‘YZ, where ?$, and \:i: are appropriate subsets of the set of all digitized pictures C?. The picture that is obtained by applying an operator 0 to a picture F is expressed by 0(F). An operator i” with a parameter a is denoted by O[a 1.

For details of picture operations, see [lo] and [ 131. DEFINITION 5. Let F = (f,,} and G = {g,,} b e an input and an output picture of

an operator 0. Then, the operator 8 is said to be local and parallel if it is represented

where C#J is a nine-variable function used for all (i, j) and called the iocalf’unctinn. The operator C is said to be iterative if it is always applied iteratively until some limiting state (invariant output) is reached (or some stopping conditions are satis- fied); that is, GCk’ = B[a](GCk-“), k = 1,2,. . . , F(O) = G, and for some m, G(“‘) -:= G(“’ - I). The parameter a may depend on the number of iterations k.

The following pseudo-Boolean local functions are used conveniently for the description of the algorithms.

DEFINITION 6 (Pseudo-Boolean local function). Let F = {f,,} and F’ = { j,;! br binary pictures. We define the following pseudo-Boolean local functions calculated on F and F’.

A@,(P) = 5 fp+pk’ k=l

A(,)(P) = i fp+pzk&,’ k=l

VYP) = A(4)(P) - C(8) (P>

k=l

(connectivity number, 4-c) [4].

KYP) = A&)(P) - c,,,(P) (connectivity number, 8-c) [ 41,

N?%) = A(8)(d - ‘(8)(P) + c(&&> (connectivity number, m-c) [5],

C,(P) = A@,(P) - q*)(P) (crossing number) [ 1 I],

Page 9: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 321

PfP& PfPj P+P2 Ci-:,;-il /I,-;,,, Ci-:,j+:,

FIG. 3. Pixel p and its neighborhood.

where p9 = P], andfP+Pk such as A&)(p).

is replaced by 1 - fp, for all k in the functions with the bar

The following interpretation of these functions may be useful in understanding their contents:

A@,(P) number of l-pixels in N,,,(p) B(S)(P) number of adjacent l-pixel pairs in N,,,(p) C(S)(P) number of adjacent triplets of l-pixels in NC,,(p) ‘4 (4) (P) number of l-pixels in Nc4)(p) N@‘(P) (NC4’(P)) $“‘(P)

c number of connected components in N{,,(p) ( Nc4)(p)) number of branches stemming from p

C,,(P) number of the transitions from 1 to 0 in N(s)(p) when eight elements are visited counterclockwise from p + p,.

The expression C(s, (p, p’) was introduced for the convenience of the formal expres- sion and does not have any special meaning. Some of the pseudo-Boolean local functions listed above can be found in the literature already cited.

3.2. Distance Transformation on a Line Pattern (Basic Type)-(BDTLP)

We assume in subsequent parts of Sections 3.2 and 3.3 that an input picture is a binary line pattern; that is, all figures contained in a given picture are of l-pixel width everywhere, except for particular types of crossing points and their neighbor- hoods. Such line patterns can be obtained from any type of input picture by commonly used techniques such as edge detections, thresholding, and thinning. First, let us present the definition of the basic type distance transformation on a line pattern (BDTLP).

DEFINITION 7 (Basic type distance transformation on a line pattern). Two types of distance transformations on a binary line pattern F = (h,} (type I and type II BDTLP) are defined as iterative local parallel operators fl[k] given by

Gck) = {gl’:‘} = C[k - l](G+‘)), k = 1,2,3 ,...,

g/;’ = g,‘,“‘” + 1 if g!k -‘I = k ‘J

and condition & is not satisfied, = g(W

(1)

I/ otherwise.

G(O) z F. (2)

Page 10: A generalized distance transformation of a line pattern with gray values and its applications

328 TORIWAKI, TANAKA, AND FUKUMURA

Condition A?. Condition & is given in terms of pseudo-Boolean local functions of Definition 6 calculated on two binary patterns Ytk) = {y,‘:)} and Y’(“) = :y;!” ‘) defined as

$9 = 1 ‘I

if g(k) > k + 1, ‘J Y f(k) = 1

lJ if g,‘;’ a k + I or g,‘:’ -2 0

= 0 otherwise = 0 if O<g,(S’.:k-i- I.

131

Condition 8 is shown in Table 1. It varies a little according to the type 01 transformation and the definition of connectivity.

Stopping Rule. g!kb2) + 1 and g,,

Let A, denote the number of pixels (i, j) such that g:,” ‘) ::: ck) = g!k -I), that is, the number of pixel values that increased by

oie by applying C[k -??I, but did not increase by the application of l? [k ~I- I]. Iteration stops if A,, = 0 for k = n. Then G (‘) = (g!J*)} gives the distance transfor- mation of a line pattern F = {hi}.

The conditions in Table 1 may seem to be complicated, but their meaning is rather simple.

Before proceeding to the modified or generalized DTLP we shall explain how the BDTLP defined by Eqs. (l)-(3) works by quoting from [6] again. Suppose that one iteration of the BDTLP increases the value of every l-pixel in F by 1 as shown in Eqs. (1) and (2). If the wavefront considered in Section 2 proceeds 1 pixel during every iteration, it will come to the pixel with the distance k after k iterations, or after the application of C[k - 11. This implies that distance values at all pixels with distance k are determined just after applying f.[k .- 11. Therefore any increase in the values at pixel P should be stopped after the k th iteration if the value at P comes to k at the output of l?[ k - I]. This is performed by the threshold operation in Eq. (3). The definition of Yck -‘) shows that all l-pixels of F with value 0 in Y(’ - ‘) have been reached by the above virtual wave and thus distance values have been determined. Therefore, in principle, only an edge point in Yck - ‘) can be assigned its distance value by applying C[k - 11.

Condition @ in Table 1 is the condition to be satisfied by an edge point. It is observed that the conditions in Table 1 are almost identical to N,(P) < I (the edge point condition for 4-c and S-c [4]), slightly modified to process a few special cases.

TABLE I

4-c

8-c (N,‘S)(yT-‘))= I)u(A(,,(y,:* -“)= 0)

Page 11: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 329

At a branching point, we can easily find which branch the wavefront has visited and which it has not. Thus the first wave goes through the branching point as the minimum type, while all preceding waves are stopped as the maximum type, until the last but one wave arrives. The wave will never come to a pixel on an isolated loop. In the case of a loop with a branch, the wave starting from the edge point of the branch will come to the branching point on the loop, but no other waves will come from other routes approaching the branching point because the remaining routes make the loop. Thus the iteration never stops, if a loop exists. However, the latter can be detected easily by the fact that the number of pixels whose values are changed never decreases after all of the pixels have been visited by the wave, except those pixels appearing on the loop. These considerations lead to the stopping rule described previously.

It is easily found that the algorithm always terminates after a finite number of iterations. In fact, if a binary picture Yck ~ ‘) contains an edge point, or a pixel satisfying condition @, that pixel stops increasing the value in the sequence of pictures {Gck)} for k’s such that k > K. Thus the number of pixels whose values are changed by applying C [ k] decreases monotonically until reaching zero, or is kept to some finite constant after a finite number of iterations if a loop exists. After reaching zero, it will remain as such since no l-pixel appears in Yck). Thus both cases are always detected by the stopping rule.

3.3. Modified Distance Transformation on a Line Pattern (MDTLP) In this section we shall introduce a modified DTLP which is called the limited

edge point DTLP (or LEP-DTLP). As was presented in Section 2, starting of the wave on a line pattern is forbidden at one of the edge points. We call an edge point where the wave starts a starting edge, and one where starting is forbidden an inhibited edge.

The formal description of LEP-DTLP is as follows. DEFINITION 8 (LEP-DTLP). Two types of limited edge point DTLPs (types I

and II LEP-DTLP) on a binary line pattern F = {f,,} are defined as iterative local parallel operators C[k] given by

G(k) = {gl:“‘} = C [k - l](Gck--I)), k = 1,2,3 ,...

gl’,“) = g!;-‘) - 1 if K gl’,“-‘) < -k) n 81 u [(i, j) = inhibited edge] = -gL-” if (g:;-‘)< -k)nW

= gU-‘) ‘J

if gli” - ‘) > 0

(4)

G(O) = { gl’,“’ },

gl:"' = 0 if f,, = 0 = -1 if f,, = 1 and (i, j) is not an inhibited edge zz - M ( M is a sufficiently large number), if f,, = 1 and

(i, j) is an inhibited edge. (5)

Page 12: A generalized distance transformation of a line pattern with gray values and its applications

330 TORIWAKI, TANAKA, AND FUKUMURA

Condition a. Condition & is the same as that in Definition 7 or Table 1, except that the following equations are used instead of Eq. (3).

yy’= 1 if (g!f-‘)< -k) U (g,:kem’)= k)

= 0 otherwise ( gj,k -- ‘) > 0)

y;; - ’ = 1 if ( gi:” - I) < -k) u (g;;- ‘) = k) u (g$ I) = 0)

= 0 otherwise ( g,‘,! .- ‘) > 0). (6)

Stopping Rule. Iteration stops if there exists no pixel such that g,(F) = --g,‘,! ‘), that is, if no change in the sign of the value gl’,” - ‘) occurs by applymg 2 [k - I] to G’k - 1)

Postprocessing. Letting G* = {gc} denote the final result of the above iteration process, the desired LEP-DTLP D = {d,,) is given as

4, = g; - ~4 if g$ > M ((i, j) = an inhibited edge) = g; if 0 6 g$ < M ((i, j ) = the background, or on a line

pattern except an inhibited edge (73 and a loop cluster)

=- g* ‘J if g$ < 0 ((i, j) = a loop cluster).

The algorithm defining the LED-DTLP is similar to the one appearing in Definition 7 (BDTLP). However, the inhibited edge must be given beforehand as can be seen in Eq. (5). A gray value gi,!’ on a line pattern in a picture Gck’ remains negative until a pixel (i, j) is visited by the wave, and is changed to a positive value as soon as the wave arrives at a pixel (i, j). Since a positive value gl’,“) in Gck’ means that the distance value has been determined at the pixel (i, j), all positive values in Gck’ are kept unchanged (see Eq. (4)). The value of a pixel in the background is always zero. Therefore, that no sign change in Gck) occurs means that all distance values have been fixed. This leads to the stopping rule.

A more general form of LEP-DTLP is defined in the same way, where starting of the wave is forbidden at more than one edge point.

3.4. Generalized Distance Transformation on a Line Pattern (GDTLP) A generalized distance transformation on a line pattern (GDTLP) is performed on

two different picture planes in parallel and synchronously. Let 9c and 9i denote two picture planes. The GDTLP generates two picture sequences {G(“); k = 0, 1.2, ; and {Hck); k = 0, 1,2,. . . } on the planes ??c and ??r, respectively. On the plane ?i;.* which is called the control information plane, either the BDTLP or the MDTLP is performed, thus, {Gck)} is given by Definition 7 or 8. This controls the process on the plane ??i, which is called the propagating information plane. Therefore it is enough to specify a particular GDTLP to define {Hck)} and to decide which of the BDTLP and MDTLP is employed for the control information on the plane 9?c.. We will show three kinds of GDTLP in this section.

DEFINITION 9 (GDTLP-total-sum type). Let F = {fij} and D = {d,,} denote an input line pattern (f,, > 0 on a line pattern and Ai = 0 in the background) and the total-sum type GDTLP, respectively. The D is defined in terms of the iterative

Page 13: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 331

procedure

Gck) = {g$‘> = C,[k - l](G’k-“)

(The same as in Definition 7 or 8. An input pattern is a binarized version of F.)

HCk’= {hi:‘} = &,[k - l](H’k-“), k = 1,2,...

j&/k) = f&-‘) + c f&p, (8) s(k-1) ‘I

where

s,:k-'I= ((p,q); [(p,q) E N((i, j))] n [0 < gl',"-'1~ k] n [I$-') > o]}

if ( g,‘: - ‘) = k ) n 62,

= -A!;-” if 3(p, q) such that (i, j) E Sdt-‘),

= h(k-‘) IJ

otherwise,

where N((i, j)) denotes the neighborhood of a pixel (i, j), that is, Nc4)((i, j)) or N(,,((i, i)) corresponding to the 4-c or the 8-c and the m-c case, respectively.

Stopping Rule. Iteration stops when the procedure on the control information plane ({Gck)}) finishes.

Postprocessing. Assuming that the iteration finished at k = N; then

D = (d,,), H@‘) = {hij”‘}, dij = Ihj?“l. (9)

Initialization. H(O) is suitably set beforehand. To understand the physical meaning of the total-sum type GDTLP, let us

remember the fact that the BDTLP on the plane Ci’c was clearly visualized by imagining a wave starting at every edge point at the same time and propagating toward the center of the pattern on a given input line pattern [5, 61. What happens on the propagating information plane 9’ is as follows. If a wave first reaches a pixel (i, j) after the k th iteration, then hi; - ‘1 is replaced by hi;’ which is equal to the sum of the values of /zij” -‘) and hF!-‘) such that a pixel ( p, q) is in the neighborhood of (i, j) and has already been visited by the wave. This is the first case of Eq. (8). If, on the other hand, the value hit -‘) of a pixel (i, j) is added to one of its neighboring cells ( p, q) at the kth iteration, then only the sign of h!T -‘) is inverted to show that the value hf: -‘) has already been transferred to one of adjacent cells. This is given by the second case of Eq. (8). The value of hjf-‘) at the other pixel (i, j) is kept unchanged, as shown by the last case of Eq. (8). Thus the density values given to each pixel on a line pattern in H(O) at the initialization are sequentially accumulated along a line pattern, and the accumulated values are just the values of the GDTLP (total-sum type). The propagation process finishes when all pixels on a line pattern have been visited by the wave. This is detected by the procedure in the control plane ‘??c. The accumulated value is stored in a pixel where the wave arrives last, that is, in a local maximum point if the BDTLP is used as the control information or in an inhibited edge point if the MDTLP is performed on C?c. The following property will be derived from the above considerations.

PROPERTY 1. Let us consider the total-sum type GDTLP D = {dij} with the BDTLP as the control information, and let H co) = {h(?)) denote an initial picture on

1J

Page 14: A generalized distance transformation of a line pattern with gray values and its applications

332 TORIWAKI, TANAKA, AND FUKUMURA

the propagating information plane ??i. Then, the value of d,i at a particular kind of pixel (i, j) is given as in Table 2 according to the type of the DTLP used as the control information.

Various kinds of information can be set in H (O) = {A!“) in practical applications. Let us present here three examples that seem to be imeresting from the practicat viewpoint. Let F = {f,,) denote an input picture.

Case 1.

H(O) = { h~i”‘}, hi?’ = f,, for V(i, j). I IO)

The control information is BDTLP of the maximum type. This case corresponds to the processing of a line pattern with a gray value. Simply,

the sum of all gray values on an input pattern is stored in the local maximum point,, If the BDTLP of the minimum type (type 11) is utilized instead of the maximum type (type I) as the control information, the sum of gray values on an arc [5] is stored in the local maximum point belonging to that arc. The content of a gray value varies with the individual problem. One interesting example is the processing of digitized map data, in which a line pattern shows a ridge with elevation values on it.

Case 2.

hjy' = 1 if f,, > 0

= 0 otherwise.

The control information is LEP-MDTLP (maximum type or type I) with only one inhibited edge.

Suppose that an input line pattern represents a digitized drawing of a river whose mouth is on the inhibited edge point and whose sources are on the other edge points. Then, a value of the GDTLP dij at a pixel (i, j) is equal to the length of the upper stream of the river from the pixel (i, j) or the total length of the parts of the river between its sources and the pixel (i, j). Thus the value of the GDTLP at an inhibited edge point gives the total length (area) of the tree structure to which that edge point belongs.

Case 3.

A!?’ = 1 lJ

if a pixel (i, j) is an ordinary (not inhibited) edge point,

ZZ 0 otherwise. (i2)

The control information is LEP-MDTLP (maximum type) with only one inhibited edge.

In the same context as Case 2, a value of the GDTLP dij at a pixel (i, j) is equal to the number of the water sources upstream from a pixel (i, j), which is used as a geomorphological feature of drainage systems [7, 81.

Next, let us introduce the other types of GDTLP called the maximum-input type and the minimum-input type.

DEFINITION 10 (GDTLP-maximum-input type and minimum-input type). Let- ting all notations be the same as in Definition 9, the maximum-input type GDTLP

Page 15: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 333

TABLE 2 Meanings of Values of the GDTLP

Control information

BDTLP (Type I. maximum me)

Propagating information

Total-sum type GDTLP

Maximum-input type GDTLP

Minimum-input type GDTLP

BDTLP (Type II. minimum type)

LEP-MDTLP (Type I. maximum We)

Total-sum type GDTLP

Total-sum type GDTLP di, = z’hjy) for V(i, j),

Maximum-input type GDTLP

Minimum-input type GDTLP

Values of GDTLP --

where (i, j) = local maximum point. c = the sum over all pixels on a line

pattern

where (i, j) = local maximum point, c = the sum along the greatest- WP weight path between (i, j) and

an edge point

d,, = c II;,“‘. SW where (i, j) = local maximum point,

c = the sum along the smallest- swp weight path between (i, j) and

an edge point

d,, = c h j,“‘. arc where (i, j) = local maximum point

c = the sum along an arc containing a= (i. i)

where c’ = the sum over all pixels on the part of a line pattern among (i, j) and all edge points except an inhibited edge

d,, = x’hjy’ for V(i, j), WP where c’ = the sum along the greatest-weight

PP path between (i, j) and an edge point except an inhibited edge

d,, = x’h$) for V(i, j), =T where c’ = the sum along the smallest-weight

=+P path between (i, j) and an edge point except an inhibited edge

Page 16: A generalized distance transformation of a line pattern with gray values and its applications

334 TORIWAKI, TANAKA, AND FUKUMURA

D = {dij} is defined as

Hck) = {hi;‘} = C,[k - l](H’-)

hp = q-1) + (~~~{h,,; [tp, q) E ~((i, j))] f7 [0 < g;,;- I) < k jj

if ( gjJ!‘ - ‘1 = k) n ii! = A(!-1)

‘J otherwise. (ii)

Stopping Rule. Same as in Definition 9. Postprocessing. Assuming that the iteration finished at k = N, then

D = {‘ij), HtN) = { hjr’}, d,, = hi;’

The minimum-input type GDTLP is defined by replacing the maximum operation in Eq. (13) by the minimum-input operation.

The function of the maximum-input type GDTLP is understood in the same way as the total-sum type GDTLP. Let us consider, as an example, the maximum-input type GDTLP with the maximum-input type (type I) BDTLP as the control informa- tion. If anyone of the waves starting at every edge point at the same time goes into a pixel (i, j) for the first time after the kth iteration, then hj,k - ‘) is replaced by hj j )” which is equal to the sum of h$ -‘I and the maximum values of hgq- ‘) such that a pixel ( p, q) is in the neighborhood of (i, j) and has already been visited by a wave. Therefore a density value hi;) of a pixel (i, j) given in H(O) is integrated sequentially along a line pattern from its edge point toward its center. If a branching point having more than one branch entering into it is met, a branch with the maximum integrated density value is selected, and the following density values on the path going out from the branching point are added again to this maximum integrated value. Thus, if a pixel (i, j) is only one local maximum point of the BDTLP, the distance value of the GDTLP fij is equal to the integration of density values 1~:: along the path from an edge point to (i, j) such that the integration of gray values on it is the maximum among all other possible paths. This path is called the greatest-weight path.

The minimum-input type GDTLP is derived by considering the minimization instead of the maximization of the integration,

As is clear from the definitions, all of the MDTLP and the GDTLP as well as the BDTLP are performed by a parallel operator and are suitable for the implementa- tion by a parallel processor. The GDTLP also suggests a new type of algorithm, a parallel local iterative operation controlled by another parallel local iterative opera- tion. It is expected that a variety of useful processings can be developed and implemented in this form by choosing the appropriate control information and setting a suitable initial picture H co) Furthermore, introducing other operations . instead of summation, maximization, and minimization in the definition of the GDTLP will make the GDTLP a more versatile tool for line-pattern analysis.

Page 17: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 335

4. APPLICATIONS

4.1. Processing of Digitized Map Data

In this section several experimental results are shown. The original data is digitized terrain elevation data and its smoothed version [12]. The ridge and ravine lines extracted from those data by the procedure presented in [12] were used as the input line patterns (Fig. 4).

The result of the LEP-MDTLP (maximum type) applied to a ravine line picture is shown in Fig. 5. The result of the total-sum type GDTLP with the maximum type BDTLP as the control information applied to a ridge line picture is shown in Fig. 6. A value hjy) at a pixel (i, j) on a line pattern is the elevation value of that point. Thus, it is easy to extract part of a ridge line structure that is of most importance in the sense that the average elevation is highest. The result of the GDTLP applied to a ravine line picture is presented in Fig. 7. Alphanumeric codes show GDTLP values determined by the total-sum type GDTLP with the LEP-MDTLP (maximum type) as the control information and case 3 of Section 3.4 (Eq. (12)) for H(O). An inhibited edge point was put on the edge point with the lowest elevation value. From a distance value d,,, we can find how many sources exist upstream from a pixel (i, j).

4.2. Properties of the Type II MDTLP and Loop Structure Analysis

Type II DTLP has several interesting features that are quite different from type I. These features lead us to effective methods to analyze the loop structure of a line pattern.

The wave propagating on a line pattern which was introduced in Section 2 is again useful to derive the properties described here. First, let us assume that our virtual wave satisfies the following.

(a) All waves start from edge points at the same time. No wave is generated at a pixel other than an edge point.

(b) Two waves meeting at any connecting point vanish there. (c) Any wave arriving at an edge point vanishes at the edge point. (d) The wave coming into a branching point goes out to all of the remaining

branches. (e) If more than one wave comes into a branching point at the same time, only

one of the incident waves goes out to all of the remaining branches. If no branch remains to be propagated, all incident waves vanish at the branching point.

Let a meeting of more than one wave be called a confluence. The point where confluence occurred is called the confluence point. Exceptionally, the vanishing of a wave at an inhibited edge is also called confluence. Such an edge point is also called a confluence point.

DEFINITION 1 1. A confluence number n,(P) at the confluence point P is defined as

n,(P) = 1 if P is a connecting point or an inhibited edge point, =n-1 if P is a branching point with n different incident

waves (n > 2).

Then, the following property holds.

Page 18: A generalized distance transformation of a line pattern with gray values and its applications

TORIWAKI, TANAKA, AND FUKUMURA

Page 19: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 337

b

FIG. 4. Original pattern used in the experiment. (a) Digitized terrain elevation data: (b) contour map obtained from (a).

PROPERTY 2. The following relation holds concerning one connected component e of a line pattern:

E-N,+L=l, (14)

where E is the number of edge points in the component 6?, NW the sum of confluence numbers over the component e, and L the number of primitive loops in e.

Proof: Consider the figure after all the wave-propagation process has finished. Make a directed graph corresponding to the given figure by the following rules.

(1) Put nodes on all of the edge points, branching points, and confluence points. (2) If the wave propagated from a node P to Q, connect P and Q by a directed

segment that comes to Q from P.

Page 20: A generalized distance transformation of a line pattern with gray values and its applications

338 TORIWAKI,TANAKA,AND FUKUMURA

Then, define a confluence number of a node P, of the graph X, as

x,=0 if 1, = 0 and Q, = 1 = 1 if 1, = 1 and Q, = 0 ( 15) = I, - 1 otherwise

for all i, i = 1,2,. . . , N, where 1, is the number of waves to enter into the node U,, Q, is the number of waves to go out from the node P,, and N is the number of nodes in the graph.

From graph theory,

where h is the number of vertices in the graph, and L is the number of primitive loops in the graph. Obviously the number of waves entering into all of the nodes is equal to the number of vertices, that is,

(Note that nodes are put on all confluence points.) Furthermore, by the definition.

NW = f XL = f I, (the number of nodes excluding all edge points). i=l I= I

=h-(N-E) f 18)

By eliminating h from (16) and (18), we obtain

N-h+L=N-(N,+N-E)+L=E-N,+L QED

Equation (14) is similar in form to the well known Euler’s formula E - B + L :y= Y , where E, B, and L are the number of edges, branches, and independent loops, respectively. However, the confluence number is used in Eq. (14) instead of the number of branches. It should be noted that any point in a line pattern may become a confluence point in principle and that the confluence on the connecting point always occurs on the local maximum point in the type II DTLP. or the type ll LEP-DTLP.

Since we can find the values of E and N, through the parallel local operation of the type II DTLP and the summation over the component, we can also obtain the number of primitive loops by using Eq. (14) and iterative parallel local operations.

By adding the constraint to the mode of wave propagation, several interesting results can be derived. We consider the LEP-DTLP with only one starting edge in the following three properties.

PROPERTY 3. In the result of the LEP-DTLP with one starting edge point, all confluence points except edge points are located on branches making loops or on branching points. The sum of confluence numbers on such confluence points is equal to the number of primitive loops.

Page 21: A generalized distance transformation of a line pattern with gray values and its applications

10 20 30 *0 50 60 10 00 90 100 1 ........................................................................................ ............. 2 ..................................................................................................... 3 ................................................ ,.......................o ............................ l ............... ..G~IJILYICIO P ..................... ) ....................... , ............................

5 ..... ..6?69A9C..F..........BPS.........G696....G ........................ *.......................121.. ..... ..5......."~..............lUV...LIG .... I0.B .......................... L ........................... 7 .. ..5~.........5.................*.* ......... o............................ ...........................

. ..z...........,..................x .......... o...........................c ...........................

. ..l...........J ................ ..T .......... a ......................... ..r ........................... ............ ..2...................5..........~ ........................... , ...........................

............ ..l ................ ..R ......... ..~...........................~ ...........................

............................... ..a...........r ........................... , ...........................

.............................. ..P............1 .......................... ,.8A9 ........................

............................. ..o .......... ..I .......................... ,.....(1,*5 ....................

............................. ..~............. .......................... ......... ..).l................

.......................... ,,LL*............., ......................... ~............Z .................

................ ..AKCEF.!l ... ..Z ............ ,.........................* ..............................

............... ..9......6.......1.........., ......................... ................................

............. ..l~.......P.................., .................. 123456......................1..........

............ ..6.........~..................,.........................~ .................... 2 ..........

............ .5..........7...................,E3C ..................... ~.....................3....121.. ....... ..~23...........6...................*....8192?b5r..............t ..................... 455 ...... ..................... ..5 ................................ , ........... ..L .............................. ..................... ..*........1 ....... ..I ............. Z............." .............................. .................... ..3 ................. ..I ............. 1.............1.............................. .................... ..2 ................. ..L ............................ 1............................. .................... ..l..................., .......................................................... .......................................... *,............................u ............................ ...................... ..1................*..,n..........................r ............................ ...................... ..?................~....CF ...................... ..s ............................ ....................... ..3...............I......E........................9.32 ........................ ........................ ..rr5e...........C........DC.....................~....l ....................... ........................... ..?8.........,..........a*9876. ............. ..P ............................ ............................. ..9.......~.................5,, .......... ..c ............................ ......... . .,....................*......,....................2 1 .......... N ............................ .......... Z......................L(..U1~ .6 .............................. ..* ........................... ........... 3......................cs .. ...9 ............................. ..L........................e .. ............ . ................... ..6......................................~..............56........0 .. .......... ..5.........r~~h.......*.........9..............................~321......123...7......~ ... .......... ..AC‘"EFW,J....O ...... ........... . ............................ . ............... ..)....H .... ......... ..P...............P . ..m ........... ..B ....................... ..." ................ ..P...L ..... .......... “.................r..........................................G....................,,~ ...... ..... ..567.....................................,......................F....................~ ......... . ..~2........................,.......~..........,.....................t...................G .......... ... ..3.......................,.......2..........1.....................D..................~ ........... .......................... ..*........3...........,....................‘..................E ........... .......................... ..,.........*..............................8 ................ ..o ............ ............................ . ...... ...> ........... ~..................I.................C ............. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..b..............................9........1.......8.............. ......................... ..,..........7.............“.......l........I ...... ..z .... ..A ............... ........................ ..*...........8..............,765*3 2 ....... ..7........3..676 9 ................ . . . . . . . . . . . . . . . . . . . . . . . . ..1...........Y . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..6........... . . ..I............... .................................... ..*.............. .............. ...5 ........................ ..w .. .... ..l.................... ......... ..H .......... ...* .............. ..a* .............................. ..... ..Z.................L............C................................32 1 ........................... ..... ..z.................r............~..............r........................................, ...... ....... l................. .......... ...* .................................................... ..t ....... ....................... ..*............~ ............ ...* ................................... ..L ........ ...................... ..1.6...........1..............." .................................... . ......... ....... ..1.............*...5.........7 .............. ..t ................................. ..I .......... .................... ..6.....*........6 .............. ..L .................................. . ........... ................... ..*.......3........ ................. . ............................... ..V ........... ........................... ..z.......* ............... ..t ............................. ..." ............ .. ..1...............~........1......3.................." .............. ..l ............ ..T ............. ... ..2..............*.............12..................., ............... ..z ............ . ..............

....... ..6.“E......X...................................., ................ ...5 ....... ..P ..............

........ ..c ...... ...’ ................................... . .................. ..6.......0 ...............

......... a..........” ................................... . ................... ..7 ... ..N ................ .* .*..*..A.... . . . . . ..P...* ..*...1..... . . . ..7...... . . ..6....... . . ..5....... . ..4..**.... . ..3 ........ ..2 .........

...... !I .........

.... ..T .........

... ..s .......... .......... ..3.............* .........

... ..R .......... ............ . .......................

..... a .......... ........... CL,...............II ......

... ..P .......... .l........R..E...........~....6 .....

.. ..OG .......... ..Z....)PI....FG...1..........., ....

. ..h..F ......... ..,.567.........“,,.............4 ...

..M....E ........ . ..*...............r..I........3 ....

*.*.........1.........,**.1...,..... . . . . . . . . . . ..z.......................

* . , . , , . . *

. . . . . . . * .

. . . . * . * . .

* * , , . , . . .

. . . . . . . . .

. . I . . . . . .

. . . I . . . . .

* . . * * , . . .

. . . . . . . . . . ..l...........L .... ..a ......................... ..L~.........Z................A 9 ............ ..~.......C .......................... ..L

..................... ...... ..l ................. ..a

............. . ...... ....................

..L’............................*............................7.............,21 .... ............ I.........~.............................~............................O.........A~~....A ......... ...9

.. ..I4 ....... ........................... ..I .......................... ...5 . ..A

........... G..........a.............................” ........................... F...........7.........1...................”

...*> 2 ............................. .......... ....... ..t .......... ..h ..........................

................................................ ..T...................1...

......... 0............5............................s ..........................

.................. ..I ...... ..C.............~

............................ ......................... ...* .................... .

.... ...8 ........... ...3 ............................

......................... ..ui ................... ..a ............................ ....

..

..A .......................................

..A...............‘.

..P......l............DDC.A 9 l...........................0.....2..........ABC

.......................... ....................

........ ... ...6

... ..Y~ac~tFG~(IJ~~*N.~..*3.......b~99..........; ........................

..T...........................U..............4..65 ... ..C.........................b 7

..... ...5 ........................

............... . ............ ..).............* ............ ...5

.............. ..A1 .....

... ..5......................." 5 .............. ..2...........2. .......................

... ..*......................3.................1 ........................................

.... ..321...................2 ......... ..l ................ ..3 .......................

....................................... ..l .......................... ..l......

.... ..I ....................... .... ..~............................A ..... ..l ......................

..................................................................................................... .....................................................................................................

FIG. 5. Result of the LEP-DTLP applied to the ravine lines extracted from the input pattern shown in Fig. 4.

339

Page 22: A generalized distance transformation of a line pattern with gray values and its applications

TORIWAKI, TANAKA, AND FUKUMURA

FIG. 6. Result of the total-sum type GDTLP with the BDTLP as the control information applied 10 the ridge lines extracted from the pattern shown in Fig. 4, with examples of the GDTLP values.

Page 23: A generalized distance transformation of a line pattern with gray values and its applications

b 10 20 >O *0 50 b0 70 80 90 100

1 .....................................................................................................

2 .....................................................................................................

, .... ........................... ..K

..o&C...........................77..........................................4a.~.~~~~~~..~~ .................................................................

1............. , ..k................................~..........~..........................~.............~ b .......................................................................................

.............

7 ......................................................... ..~ ........................... 0 .............

I ........ . ...................................................................... ..1........~bR ..

P ........ . .................................. ........ t.................................I ................ ...... ..~..........onoo~o..vb~c........~”................~ .... 0.....................2....*..1.......

..... ..... Y&! ........

..... ..1...................‘..........v”.................1.....~.....................~ ..m........~o...................~..................r............................u .... Y..O .......

..... ..o.......,....................,..................C........I.....................“..~ ...........

..... ..m...m@ I ..................... ~................OO.........~......................UV.....~....~ .

...... ..om~........................C ................C ........................................ ..a .....

..... ..m ........................... o.............i.t ..................... ..L.........~..........* ....

..... ..~.....................G .. ...@ ........... C(J.L ..................................................

..... ..B.....................Y .. ..o ............... . ......................... “........................

.... ..e......................, . ..I ................ . ......................... RTU ......................

...... b.............N........# . ..m ............................... ..G.......~...V .....................

.... ..0...........1~.........1)00 8 ............................... ..L.......P.....4~ ...................

10

:: 13

:: 16 17

:9" 20

::

::

:: 27

:: 30 31 32

:: 35 36 37 38 39 40 41 92 63 64 65 66 r7 a8 r9 50 51 52 53 5. 55 56 57 56 59 60 61 62 63 66 b5 66 67 68 69 70 71 72 73 74 75 76 77 76

... ..e........wer ........ ..a ................................... ..b.......P.......~...............I ..

........... ..*..............~.................1..................1........P .................... ..* ...

... ..o.....*...............o..................L................o t ........ ..s......*. ........... ..L ...

.. ..I) ................... ..a .................. ..x...........e~~m.............“”....~..............8 ...

.. ..ll...................R@ .s .................. ..‘.............a...............~~~** ........... mt ....

.. ..~................ob*....*....................LI.....**....~ .................... o........aa .......

.. ..1 ...................... ..(I ............. ........voboa.......a ................... m.o01...a .........

. ..~.wwo....Y...............1.......... .................... ..o .................. ..o...a .I ..........

.......... . ..*.................l~‘l,T,..........................~...................o ... ..o ...........

..*...........C......................8......R..................~..................~ .... ..o ...........

............................................. . ............... ..@ ....................... ...* .......... .............. ..aI1~oIC...........~..............................~...............o ...... ...4 .......... .................... ..vI........................................a..........Rb8bl..........., .........

................................................ ..~............o.oa..............o ................... ..,................................................VP.........~ .. ..a ........... ..S................G .. ..b..................................................no......~.....a.............~...~............~ .. ..................................................... .."O....D .. ...@ .......... ..e ............... ..a .. ....................................... ..F...............I..C......O.............~..~~............~ .. ...................... ..i................~...........~....oo.......~............a.c~..............~ .. ..................... ..*.................~...............o..a......~..........aa..................~ .. ..................... ..".........I.......~..............C....o.....1.........o...................o ... .................... ..v..........t.......~...................................~ ................ ..a .... .................. ..at...........* ...... ..o ........... ..D......1............” ............... ..I0 ..... .............. ..l)~ol.............1........8....i........T.......t..........w.................~ ....... ............. ..a.................v........o...~.............................................~ ........

..O........II....................B ........ ..I ........................................... ..a ..........

..~.........O ................... ..II ........ ..a...........................................0 ...........

................................ ..1 ........ ..a ......................................... ..o........w ..

..O.........~ ................... ..~..........O ........................... ...* ......... ..a.........2 ..

... . ...... ..1.......... ........... 8..........8...........Xll.... ........... ..“.........~........... ..

.. ..o........b....................*.........8...............~a I ............ ,.~........~..........., ..

.... . ...... ..c....................o.........o.................b...............1ooeo11~ 0 .......... ..v ..

............ ..cI...................~.........1.................a ............. ..o ......................

............. ..~..................~.........e..................a.....*”......e .e ............... ..a ...

.............. ..‘[email protected]~~........~..1................0~ ..

.............. ..I........N........1.........C..................O............~....~..............~ ....

.............. ..N........~........8 ....... ..B ................ ..0............~....1..............0 ....

........................ ..,.......a.........o..................a.................~ ............ ..a ....

......................... ..Ioo..............a ................................... ..o............., ....

............................ ..o.~ao........e.E.......~ ......... ..a

............................. ..~...1......a...a ............................. ..o ....

.. ..v ............ ................................. ..c.....a.....c

1...............................e .... . ..B ............ . ............................. ..* ....

................................. ..C....U.......U..4 .................................................

..,..............~.................C...II.........Iao..............~.~o~u............~...~...~..~~ ................ ..C..~..........~..~C

.... ..1............., ........... ..I .......................... ..(1.... ..,............1....................R (I ........ ...” .. ..P ...................................... ..a ..... ..‘...........V .............................................................................. ..o ..... ............ ..~..........~......................~....~.........................................a ............. .

..... ......................................

............ . ................................................

. .............. .;~.....................................................R..........,.., ... -- - ......... ..-................................................................................~~...~ I ........ ..0..................4 ...... ...* ........... .

...

79 ...................................... ..v .~.........~...........................1.....1...

............ . 80 ....... ..1.......~H...........O ....... ..I

................................. ..............

..“.......1...

...... ..~.........~............a........0 ............... ..~...............”

111 ............ ..I ............

a* ..... ..I ........ ..I ........... ..*.......a...............v ...

83 .... .....

........................................................................... ..~...........t.............~.......a.................o * ..1...

84 .... . ............ . ... ..~.........1.....0 .o .... ... .......... .........................................

8, ... . ........... ..o...............~~CCo8...~ ..o.....................................

..Ir ..~.................~O~.I” ...

86 ~.~.............O ............. ..o ........ ..a .. ............................

.............. ..‘...a .... ..Y ..” 67 ..1............1..............~ I .............. ..moo

........ ................

81 ..D............O .............. ...............

.............................. ...................................

..a...............Uw ..I 89 ..I............L .............................................. ................

....... ..oDw ..I~.........~

.....

90 ..~............B ............................................ . .........

............ 91 ..x............* ........................................... .

....... ..D.......O.....~ .... ..O.....~

92 ............. ..1...... ~.....‘.............................I ..................... ...........

PJ ............... . ......................................... . ....................... ..0..~1........1...

PI ............. ..eo ...................................... ..I ......................... ..om..........1...

9, ........................................... ........................ ..e............o ...

““““‘**“* 96 ....... ..tl*O.....~..................~ e.........tR~U.............o............~ ... ......................... . ...

............. 9, ................. ..*I*~..............9

..“O .” ................. ..I

.*..........‘.. ..*..............s

9) ................................... ..I ...... . ...” .. ..a......, ..

99 ................ ..L............~?tIeC .... .............. ..~........a................................~ .................Y.....“* I

..

100 ............................... ..~ ..

................... ............................................ 101

...................................... ............................................................... ......................................

FIG. 6-Conrinued.

341

Page 24: A generalized distance transformation of a line pattern with gray values and its applications

- - __ i ..................................................................................................... 2 ..................................................................................................... , ..................................................................................................... . ,

. . . . . . . . . . . . . . . . . . . . . .222722?222. . . . . . . . . . . . . . . . . . . . . k . . . . . . . . . . . . . . . . . . . . . . .5 . . . . . . . . . . . . . . . . . . . . . . . ; ; ;~ :

..111.111..2..........?li..........5.~....rr......................... ....................... 6 .... ..1.......:2..............222...553....95 .N .......................... ~....................~ ......

21 . . . . . . . . . . . . . . . . . . . . . . l . . . . . . . . . . . . . . . . . . . “ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ~ ~ . ~ “ .

ie ................................ ........ ..“I............................,.........~ ................... ie ........................ . .............. ..e..11.........................., ............................ 3” ...................... ..l................(r....Il........... ............. , ............................ 31 ....................... ..1...............s......1........................3*11 ........................ 32 ........................ ..~Il...........G........11.....................2....1..............~..~...~ . ,3 ........................... ..I1.........G..........111111...............2 ............................ ,* ............................. ..1.......0.................111............2............~..~....~....* .. 35 ....... ..I ...................... I......~....................11 ....... ...2 ............................ 36 ........ ..l......................l..~s@[email protected].......................~~ .. 37 ......... ..l......................lr.....~...............................2.......".............~ ..... 38 .......... ..l.....................a.......i..............................2.............111....~...~ .. 39 .......... ..l.........i22i........ ...... ...8 .~~.~.~~..................~...*111......111...1......2 ... *!I .......... ..ZL1222222i....i.....?...........~............................l.................~..."~ .... r1 ......... ..1..........*....2 . ..7 ........... ..o..........................1..................*...I...~. 62 ........ ..l..~..............i.7...............3 ...................... ..l .......... ..~.......222.~ .... 43 ..... ..111...................7 ............... ..a .................... ..l...........................~ .. a. . ..11.1......................5.......I..........r.....................1...................1...~~..~ .. ., ... ..1.......................5 ..... ..i..........9.....................1..................1 ........... ** .......................... ..5........1 ......... ..e .................. ..i..................1........... 2, .......................... ..2.........i...........6..................~..~..........~....1..."..."".~ .

,” . . . . . . . . . . . . . . ..I.....................1.............8.......1........ i........1......1;.............. ,l ........................ ..5...........l..............cI11111.........1........1..1111...........~~~ .. ,? ........................ ..5...........*.............7................1.........11..........."...~.~ .. 53 ........................ ..5...........~.............7 ............... ..I ........................ ..2 ... ,4 .... ..1...................~.........................7.................1.........................2 .... ,5 ..... ..l.................~ ......................... ..i ............... ..~I,.....................2 ..... ,b ..... ..1.................5............1..............7............................"...........~ ...... ,7 ..... ..l................5.............i .............. . ..................................... ..2 ....... ,a ....................... ..5............1...............7.....................................~......" . ,9 ...................... ..r.1...........1...............1 .............................................. 60 ......... . ........... ..r...1.........,.................,..............................~....~.....~~ ... bl .................... ..r.....,........i .............. ..I ................................ ..z ........... *2 ................... ..L.......1.......1.................7 ............................... ..i ........... 63 ................... ..~.......1.......I.................1................................*.....~...~ .. b* .. ..1...............c...............1..................7 .............. ..l ............ ..2 ............. b5 ... ..1..............r.............i. ................... . ............... ..I............2 .............. bb .... ..l... b7

....... ..*...................................7..................,...........2........." .... ..... ..I 1 .. ..2*22*1....................................7 ................. ..l ........ ..I ..............

bb ....... ..1.22 ... ...2 .................................. ..7...................1.........2...........~~. b9 ...... ..~.) 70

........................................... ..7....................1.......2............" .. ....... ..i..........1...................................7 ................... ..1.....2

71 ................

....... ..l..........i ................... ..I ........... ..7....................., . ...2 72

................. ....... ..1..........: ................... ..I ............. .

73 .................... ..2222 ..................

...... ..1..........2 .................... ..1.............7 ................... ..I ,*

...................... ..... ..1...........2 .................... ..i ..,...................I

7, ............ .......................

...... . .......... ..2.....................Zi.............5.11 ............... ..i ?b

....................... .... ..l............Z ........... .

17 ... ..1............2 1 ...... ..1..?...........b....1................1.......................

.......... ..l....111....~Z...l....6 ... ...1 I.+

.............. . ... ..l........... l..i...........1.111.........113

........................ . ...6

........ I9 .. ..l...........l....~...........i...............f ..6 1.............1........................

.~......1...............1 (0 . ..l...........l

....................... .... ..I ......................... ..3‘.......... .............. ..I 1

01 ............ ..1.......l............................h .....................

...... ..t 82 ............. . ...... ..I............................3

................. ..l....................

13 .......................... ..l

............ . ....... ..I ...... ..*....lLl.... .......................... ...) a. ......... ..l..........l ........................... ..j

......................... ...1.........111....1.. 0 ......... ..1 ........ ..I

........................... ..I . ..I ........................... ..3...............................1. ..............

96 ........ ..l...........l.........l..................., ...............

67 ....... ..1............1 ................................................

........................... ..~ ................. ..I 8, ....... ..l............r....,.......................) .............................

.................. ..I ,P ...... ..I ........... ..i

............................ ............................ .

90 .................... .

.... ...1 ............ ..i ......................... ..J ............................

91 .................. ...)

.... ..l...............I.........,................3. ............................ 92 .... ..l..............l............................

... ..f............122.11 ............................... 9, .... ..1...........................1111111111~1122.1..11

1..........111......1......................... 9 .... ..1...........................1..............1....

..... ..1111..........1........................ ..

95 ... ..L.........................ll .... ..l...............l................ll.....

9b ..... . ..................... ~.............l.............l

..11 ............. ..I .......................

91 ... ..1......................1 .............. ..l...........~. .............. ..l..................... ..

99 .... ..111 ................. ..l ..~..~~.~~...~...1...........1..................1 .......................

99 ............................ . ....................................... ..l......~ ....................... 100

....................................... ..l ..... ..I ...................... 101

.....................................................................................................

.....................................................................................................

FIG. 7. Result of the total-sum type GDTLP with LEP-DTLP as the control information (number of sources upstream) applied to the ravine lines obtained from the pattern shown in Fig. 4.

342

Page 25: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PAlTERN DISTANCE 343

Proof: First, assume that confluence occurs on a vertex or a branching point that is not contained in a loop. Let us denote this confluence point by A and the starting edge point by S. Since at least two waves reach A, they had to come along two different paths from S to A. This means that there exist at least two different paths between A and S. Thus A is located on a loop. This is contradictory to our assumption. Next, let NL denote the sum of confluence numbers on the above confluence points. Then, from Eq. (14),

E - (N; + (E - 1)) + L = 1;

therefore

N,‘+ = L. QED

PROPERTY 4. In Property 3, if no confluence occurs on any branching point, then there exists a one-to-one correspondence between a primitive loop and a confluence point.

The proof is omitted here. PROPERTY 5. If a connected component of a line pattern satisfies the assump-

tions in Property 4, then all loops in the line pattern can be eliminated without splitting the component into more than one part by cutting each loop at the confluence point associated with it.

Proof. First let us show that a connected line pattern is never split by cutting a loop at the confluence point. Every point of a line pattern except confluence points is visited by a wave that started from the same starting edge point and did not pass any confluence point, because only one starting point exists and no new wave is generated at a confluence point. This means that every point on the pattern is connected to the starting edge point after eliminating all the confluence points on the loops.

Next, we shall show that no loop remains after cutting a pattern at the confluence points. Let L’ denote the number of loops after the above cutting process and Nk denote the sum of confluence numbers at the eliminated confluence point. Consider- ing that the number of edge points increases by 2 Ni after cutting, and by applying Eq. (14),

E + 2N:, - {(E - 1) + 2N;) + L’ = 1,

where E is the number of edge points in the original pattern. Therefore

L’ = 0. QED

These results suggest a method for separating each primitive loop, and by cutting loops, a line pattern with a network structure is reduced to one with a tree structure. This will significantly simplify the processing of the pattern. Several examples are given in Fig. 8 to illustrate the above properties intuitively. In Fig. 9 we show an example of applying the results to eliminate small loops due to noise in an input picture.

Page 26: A generalized distance transformation of a line pattern with gray values and its applications

344 TORIWAKI, TANAKA, AND FUKUMURA

a

b-i

b-2

FIG. 8. Illustrations for (a) Properties 2 and 3. (b) One-to-one correspondence among many loops and confluence points (Properties 3-5). (a) Starting edge point, P; inhibited edge point, R. T: confluence point, Q, R, S, T, N,(Q) = N,(S) = N,(T) = Y,,,(r/) = 1: E -- Xw + I. = 3 - 4 A- .! = i: dashed circle, primitive loop; IV,(Q) + N,(S) = 2 = number of primitive loops. (b-l) E -- iv,. J L i- 5 4 , ,i - I; A; starting edge point; B, C. D, E, P, Q, R. S, T, confluence point; loop-confluence point corre-

spondence; L,-P, L2-Q, L,-R, L,-S, L,-T. (b-2) Loop cutting.

FIG. 9. An example of an application. (a) LEP-DTLP (type II); (b) loop cutting; (c) Basic DTLP (~ypc: I); (d) trunk extraction.

Page 27: A generalized distance transformation of a line pattern with gray values and its applications

GENERALIZED LINE-PATTERN DISTANCE 345

PROPERTY 6. Consider the shortest branch among all branches connecting an edge point and a branching point. In the case of the basic DTLP of type II there exists no confluence point on this shortest branch.

The proof is omitted here. This property suggests that a branch that has no confluence point on it is a

relatively short one. Thus, by repeating the process to propagate waves by the way of the BDTLP (type II) and to eliminate a branch that connects an edge point and a branching point and has no confluence point on it, we can extract a kind of trunk of a pattern (Fig. 9). This process of extracting a trunk or eliminating a short branch provides a method for analyzing the structure of a line pattern in a different way from that by the type I BDTLP presented in [6].

Distinctive features of the method discussed here for structure analysis of line drawings lie in that it is applied directly to a digitized binary picture instead of an abstract graph structure, and that all processing is performed by iterative local parallel operations.

5. CONCLUSION

In this paper several variations and generalizations of the distance transformation of a line pattern (DTLP) were presented. The DTLP is the transformation of a binary line pattern and was first proposed by the authors in [5]. This basic DTLP (BDTLP) was modified by introducing an inhibited edge point, at which no propagation of information occurs (modified DTLP, or MDTLP). By doing this, the information concerning the structure of a treelike pattern can be concentrated on an edge point instead of a center (or a local maximum) point of a line pattern. The generalized DTLP (GDTLP) can process a line.pattem with an arbitrary gray value on it as well as a binary pattern by combining two parallel iterative local operations performed synchronously. One of them controls the performance of iteration (con- trol information plane) and the other processes the information contained in the gray value of an input picture (propagation information plane). Experimental results using digitized terrain elevation data were also shown.

Furthermore, it was shown that the type II limited edge point DTLP (LEP-DTLP) could be effectively used to extract information on the loop structure of a line pattern. Thus, the types I and II DTLP are remarkably useful in quite different aspects of line-pattern analysis.

All algorithms for performing the MDTLP and the GDTLP are of parallel type and pertinent to the implementation by a parallel processor. The GDTLP is expected to become a versatile tool for the analysis of a digitized binary picture by employing a variety of information contents and operations for the propagating information plane.

ACKNOWLEDGMENTS

The authors thank Professor Namio Honda of Toyohashi University of Technol- ogy for valuable advice and encouragement. The authors also owe much to the useful discussions with colleagues in their laboratory. All experiments were performed using the computer system and the SLIP library for image processing of the Nagoya University Computation Center. This work was supported in part by a grant-in-aid for cancer research from the Ministry of Health and Welfare (55-17) and a grant-in-aid for scientific research from the Ministry of Education (588021).

Page 28: A generalized distance transformation of a line pattern with gray values and its applications

346 TORIWAKI, TANAKA, AND FUKUMURA

REFERENCES

1. S. W. Zucker, R. A. Hummel, and A. Rosenfeld, An application of relaxation labeling to line and curve enhancement, IEEE Trans. C-a, 1977, 394-403.

2. A. Rosenfeld, R. A. Hummel, and S. W. Zucker, Scene labeling by relaxation operations. IIIEF: Trans. SMC-6, 1976, 420-436.

3. A. Rosenfeld and A. C. Kak, Digital Picture Processing, Academic Press, New York, 1976. 4. S. Yokoi, J. Toriwaki, and T. Fukumura, An analysis of topological properties of digitized binary

pictures using local features, Computer Graphics and Image Processing 4. 1975, 63-73. 5. N. Kato, J. Toriwaki, and T. Fukumura, Parallel local operations for a new distance transformation

of a line pattern and their applications, Report of the Professional Group on Pattern Recognition and Learning, IECE, Japan, PRL77-72, 1978.

6. J. Toriwaki, N. Kato, and T. Fukumura, Parallel local operations for a new distance transformation of a line pattern and their applications, IEEE Trans. SMC-9, 1979, 628-643.

7. C. Arcelli and G. S. di Baja, Medial lines and figure analysis, Proc. Fifth International Joint Conference on Pattern Recognition, 1980, pp. 1016-1018.

8. A. N. Strahler, Revisions of Horton’s quantitative factors in erosional terrain, Trans. Amer. Geophu. Inst. 34, 1953, 345.

9. M. Berry, Topological analysis of dendritic trees, Proceedings of the Fourth International Congress for Stereology, 1975, p. 49.

10. S. Yokoi, J. Toriwaki, and T. Fukumura, Theoretical analysis of parallel processing of pictures using algebraic properties of picture operations, Proceedings of the Third International Joint Con- ference on Pattern Recognition, 1976, pp. 723-727.

11. J. C. Hilditch, Linear skeletons from square cupboards, in Machine InteNigence IV (B. Meltzer and D Michie, Eds.), pp. 403-420, Edinburgh Univ. Press, London, 1969.

12. J. Toriwaki and T. Fukumura, Extraction of structural information from grey pictures. Con~prrfer Graphics And Image Processing 7, 1978, 30-5 I.

13. S. Yokoi, J. Toriwaki, and T. Fukumura, A generalized distance transformation of a digitized picture. IEEE Trans. PAMI-3, 1981, 424-443.