edge detection using sliding statistical tests

14
C OMPIJTER VISION, GRAPHICS, AND IMAGE PROCESSING 23, 1-14 (1983) Edge Detection Using Sliding Statistical Tests PETERDE SOUZA* IBM U.K. Scientific Center, Winchester, England Received January 14, 1982; revised March 16, 1982 The problem discussed is that of detecting edges in one-dimensional image profiles, with particular attention being paid to the case in which there is prior information available regarding the scene. Five sliding statistical tests are presented which often display well-defined turning points in the vicinity of edges, thereby enabling edges to be located. Some of the tests are applicable to the case of detecting edges between objects of different intensity, and others are applicable to the case of textures where there may be no difference in average intensity on each side of the edge. I. INTRODUCTION Edge detection plays a very important role in many image processing applications, and for this reason a great deal of effort has been directed towards this problem. Many different edge detectors have been proposed [ 11, yet, as Ehrich and Schroeder [2] remark, edge semantics are extremely complicated and our understanding of edge detection is still inadequate. The problems can be simplified, as Ehrich and Schroeder noted, by adopting a one-dimensional approach and considering one-dimensional profiles only. Indeed, it not only simplifies matters, it saves substantially on computation, and it is also quite adequate in many instances, such as X-ray processing, where the nature and approximate orientation of the objects of interest are known in advance. Davis and Mitiche [3], who considered the problem of detecting edges in textures, also restricted themselves to the one-dimensional case, and further reasons for doing so can be found in their paper. Like the above articles, the present discussion will be concerned with the one-dimensional case only. Many edge detectors in common use are based on local gradients or local edge models typically computed over a small window which scans the image. In this approach it is the edge itself which is the important feature rather than the environment in which the edge lies, or even the objects which have combined to create the edge. In the absence of prior information regarding the content of the image it may well be appropriate to look for edges per se as a first step. If, however, some prior information is available concerning the image scene, it is worth consider- ing whether or not it is possible to capitalize on this information and to detect edges using properties of the objects, rather than properties of edges, particularly in view of the difficulties associated with detecting edges. As an initial example we shall consider the problem of rib detection in chest radiographs where the approximate size and orientation of the objects of interest (the ribs) are known in advance. However, the techniques are not restricted to rib detection but can be applied to other X-ray processing tasks, or to entirely different tasks such as the analysis of three-dimensional shapes using Moire photography where light and dark bands have to be delineated. As a second example we shall *Present address: IBM, T. J. Watson Research Center, PO Box 218, Yorktown Heights, NY 10598. 0734-189X/83 $3.00 Copyrighl 0 1983 by Academic Press, Inc. All rights of reproduction in any form reserved

Upload: peter-de-souza

Post on 21-Jun-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Edge detection using sliding statistical tests

C OMPIJTER VISION, GRAPHICS, AND IMAGE PROCESSING 23, 1-14 (1983)

Edge Detection Using Sliding Statistical Tests

PETERDE SOUZA*

IBM U.K. Scientific Center, Winchester, England

Received January 14, 1982; revised March 16, 1982

The problem discussed is that of detecting edges in one-dimensional image profiles, with particular attention being paid to the case in which there is prior information available regarding the scene. Five sliding statistical tests are presented which often display well-defined turning points in the vicinity of edges, thereby enabling edges to be located. Some of the tests are applicable to the case of detecting edges between objects of different intensity, and others are applicable to the case of textures where there may be no difference in average intensity on each side of the edge.

I. INTRODUCTION

Edge detection plays a very important role in many image processing applications, and for this reason a great deal of effort has been directed towards this problem. Many different edge detectors have been proposed [ 11, yet, as Ehrich and Schroeder [2] remark, edge semantics are extremely complicated and our understanding of edge detection is still inadequate.

The problems can be simplified, as Ehrich and Schroeder noted, by adopting a one-dimensional approach and considering one-dimensional profiles only. Indeed, it not only simplifies matters, it saves substantially on computation, and it is also quite adequate in many instances, such as X-ray processing, where the nature and approximate orientation of the objects of interest are known in advance. Davis and Mitiche [3], who considered the problem of detecting edges in textures, also restricted themselves to the one-dimensional case, and further reasons for doing so can be found in their paper. Like the above articles, the present discussion will be concerned with the one-dimensional case only.

Many edge detectors in common use are based on local gradients or local edge models typically computed over a small window which scans the image. In this approach it is the edge itself which is the important feature rather than the environment in which the edge lies, or even the objects which have combined to create the edge. In the absence of prior information regarding the content of the image it may well be appropriate to look for edges per se as a first step. If, however, some prior information is available concerning the image scene, it is worth consider- ing whether or not it is possible to capitalize on this information and to detect edges using properties of the objects, rather than properties of edges, particularly in view of the difficulties associated with detecting edges.

As an initial example we shall consider the problem of rib detection in chest radiographs where the approximate size and orientation of the objects of interest (the ribs) are known in advance. However, the techniques are not restricted to rib detection but can be applied to other X-ray processing tasks, or to entirely different tasks such as the analysis of three-dimensional shapes using Moire photography where light and dark bands have to be delineated. As a second example we shall

*Present address: IBM, T. J. Watson Research Center, PO Box 218, Yorktown Heights, NY 10598.

0734-189X/83 $3.00 Copyrighl 0 1983 by Academic Press, Inc.

All rights of reproduction in any form reserved

Page 2: Edge detection using sliding statistical tests

PETER DE SOUZA

discuss a herringbone texture where the problem is to detect the edges or thr: herringbone bands.

2. A SLIDING ( TEST

Given a standard posterior/anterior chest radiograph, a common approach to automatic rib location is to detect edges and then identify which edges belong to ribs (e.g., [4, 51). The emphasis in this method is on edge recognition. An alternative approach is to use what we know about ribs to detect them directly, and hence obtain their edges implicitly. The emphasis this time is much less on edge recognition and more on rib recognition. An obvious difference between the two approaches is in the size of the window required. A small window is usually adequate for edge detection, but a much larger window is required if we wish to identify a “riblike” object.

Consider a lung field of a chest radiograph such as that shown in Fig. 1C. and consider a section taken through it like the one shown as a dotted line. Because we know in advance the approximate size and orientation of the ribs, we know that the section will intersect with the posterior (dorsal) ribs, and that the regions of intersection will normally be about 8-15 mm in length. Thus, to detect the ribs on any given section we might look for a region of about 8 - 15 mm in length which is lighter than its immediate neighborhood. In statistical terms, we might test for a rib by taking samples from two adjacent regions of this size and testing them for significant differences in density.

Consider, then, a statistical test applied to two samples of size n taken from such a section, where n is the number of pixels spanning about 8 mm of the original radiograph. If one sample lies entirely on a rib, and the other lies entirely between ribs, then we would expect to find a highly significant difference between the samples. Alternatively, if the samples are not so homogeneous we would expect to find a less significant difference, or even no significant difference between them. Thus if a test is applied to a window of length 2n + 1 pixels, testing the first n against the last n and assigning the result to the location of the center pixel, we would expect to obtain highly significant results when the window is centered on a rib edge, and less significant results as the window moves away from the edge in either direction. By sliding the window along a section one pixel at a time, and computing a test at each step, we should be able to identify riblike edges by noting the places where the significance level of the test reaches a local maximum.

What is an appropriate statistical test? In straightforward cases a simple t test ([Cr], pp. 330-333) as defined below may suffice. Consider again a one-dimensional window comprising 2n + 1 pixels as described above. Let x,, x2,. . . , X, denote the first n pixel values in the window, let y,, yZ, . . . , y, denote the last n pixel values, and let 7 and p denote their respective means. Then t is defined as

t = (j-2)/s (1)

where

s2 = (&,2 - nx2 + cy;L - ?2y2)/n(n - 1).

Page 3: Edge detection using sliding statistical tests

EDGE DETECTION USING SLIDING TESTS 3

A 250 I

I-L 5-l” ’ /t

200 -

150 - V

100 -

50 -

I I I I I I I

50 100 150 200 250 300 350

B

I I I I I I I I n I

-30 I I I I I I I I

50 100 150 200 250 300 350

C

FIG. I. Sliding f test: (a) profile taken through the lung field in Fig. lC, (b) t test values, (c) lung field of a chest radiograph showing the position of the profile in Fig. 1A.

The effect of this sliding t test can be seen in Fig. 1. Figure 1A shows the profile obtained by averaging three sections taken through the lung field in Fig. 1C in the vicinity of the dotted line. The sections were averaged to smooth the profile, but it also has the effect of blurring the distinction between posterior rib, ventral rib, and clavicle at the right-hand end of the section, making these edges a little harder to distinguish. The gap between the pixels corresponds to 600 microns on the original radiograph, so the number of pixels, n, required to span 8 mm is about 15. Therefore an appropriate window size for rib detection is about 3 1, and Fig. 1B shows the values of t computed over a sliding window of this length. The first 15 and last 15 values of t have been set to zero: these cannot be computed as the window would obviously then lie partly beyond the end of the section.

The turning points in the sliding t test represent the locations where the result is most significant. As expected, these points correspond to riblike edges where there is

Page 4: Edge detection using sliding statistical tests

a significant difference in grey level between the 8 mm immediately to the left auJ the 8 mm immediately to the right. Other smaller features have largely been smoothed out--a consequence of the window size. The positive peaks occur at edges where the region to the right has greater pixel values then the region to the left. and negative peaks occur where the opposite is true.

The denominator in the expression for t is related to the standard deviation of the pixel values in the left and right halves of the window. To an extent, therefore, Lhe l test reflects properties of the neighborhood in which the edges lie other than just average intensity. Additionally, because the denominator takes smaller values when the left and right halves of the window are homogeneous than when either one lies across an edge, the denominator has the effect of emphasizing and sharpening the turning points occurring when the window is centered upon an edge. Furthermore, the presence of the denominator ensures that the value of t is independent of the scale of the data, thereby simplifying tasks of threshold selection. However. in borne cases where there may be little or no variation in the pixel values lying in the window, s2 may take very small or even zero values, thereby distorting the value of :. This can be avoided by putting a small arbitrary lower limit on s’.

Since the sliding t test often yields a smooth scale-independent function with well-defined, generally sharp turning points, the edges of interest can easily be located with a simple peak picking routine, and of course the nature of the edges (positive or negative) can be determined by simply noting the nature of the peaks. Thus the sliding t test affords a simple means of detecting riblike edges, but differs from many edge detectors in common use insofar as no edge model is fitted, nor is it necessary to compute any gradients in the conventional sense. The motivation for the test is drawn from statistics, not from image processing, and the window is selected according to the nature of the objects which combine to create the edge, not from properties of edges. Note that since edge properties are relatively unimportant in this approach, there would usually be little advantage in performing edge enhancement prior to edge detection, thus potentially saving on computation.

In fact, computation of the sliding f test can be carried out very efficiently hy noting that successive values can be computed by simply updating the appropriate sums and sums of squares as the window is moved, rather than computing the value anew each time. Furthermore, as the window slides from left to right, the right-hand half of the window eventually becomes the left half. Therefore, by storing the appropriate results there is no need to perform any computation at all for the left half except for the first few values.

Although the sliding t test owes its derivation to statistics and appears, as we have seen. to be an appropriate edge detector in some cases, it cannot be strictly interpreted as a statistical test. This is because the normal statistical assumptions underlying the test are not generally met in the current application, and therefore the r statistic may not adhere to the expected t distribution. This is of little consequence with regard to edge detection but does mean that any attempt to interpret the f test value should be made with caution.

Jacobus and Chien [7] discuss a similar but slightly more heuristic sliding edge detector, and include some suggestions for threshold selection and window size selection for the general case where advance knowledge of the image scene may not be available. Davis and Mitiche [3] also consider a sliding edge detector. although they are primarily interested in texture edges. Their edge operator is based on the

Page 5: Edge detection using sliding statistical tests

EDGE DETECTION USING SLIDING TESTS 5

difference of the average values between the left and right halves of the window, and therefore it has rather different properties from the sliding t test discussed here.

As an alternative to performing sliding tests with a fixed window size, Basseville et al. [8] describe an edge detection procedure based upon sequential tests. These tests which originated in quality control can be used to detect edges in one-dimensional profiles where the edges are expected to be accompanied by a jump in intensity.

3. A SLIDING 7 TEST

As we have just seen, the t test may be an adequate statistic for detecting riblike edges in straightforward cases such as that illustrated in Fig. 1. There are situations, however, where the t test is inadequate and a more elaborate test is necessary.

Consider another section from another radiograph where the problem is to detect the anterior (ventral) ribs. Figure 2A shows a section taken across a lung field of a chest radiograph. The section was taken on a curve lying wholly in the intercostal space between two posterior ribs and was approximately “parallel” to the posterior rib edges. Thus there are no posterior ribs visible in the section. The first trough on the left is the outer edge of the rib cage, and the right-hand end of the section leads into the spine and sternum approximately in the center of the radiograph. The second and third troughs correspond to two anterior ribs.

Unlike the situation in Fig. 1, the ribs in Fig. 2 lie in an area of nonuniform intensity. There is a clear increase in background grey level going from left to right from the edge of the lung towards the center. This not only distorts the rib troughs, but also means that the average value of pixels lying on a rib is not necessarily appreciably different from the average value of pixels in the immediate neighbor- hood. This greatly reduces the effectiveness of the t test, and it becomes necessary to use a test which can take account of the gradation in background grey level.

To illustrate the point, the sliding c test of Section 2 was actually applied to the profile in Fig. 2A and the result is shown in Fig. 2B. Once again a half-window was used which was equivalent to approximately 8 mm on the original radiograph. As we would wish, the positive peaks correspond to the edge of the rib cage and the right-hand edges of the two ribs. And there are even local minima (negative peaks) corresponding to the left-hand edges of the ribs. But the minima are not nearly as well defined or as sharp as those of Fig. lB, and indeed they do not even have negative values. It would be preferable for an edge detector to have more pro- nounced, sharper turning points.

It is worth noting in passing that the gradation in background intensity seriously affects the gradients of the rib edges. This means that edge detectors which rely solely on gradient information may not function properly in this kind of situation, and also implies that an edge cannot be adequately defined in terms of absolute gradient, as some workers have attempted to do.

We will now consider an appropriate test for the kind of profile shown in Fig. 2A. As before, consider a window of 2n + 1 pixels where we wish to compare the first n and last n to determine whether or nor they belong to different objects. Let X1’ x 2,“‘, x, denote the locations of the first n pixels in order, and similarly let X n+29 X "+3,"', xZn+ , denote the locations of the last n. Furthermore, let y,, y2,. . . , yn and Yn+2, &+3,---,Y2n+l denote the corresponding pixel values of the two samples. If the window lies wholly on a single object then we would expect both

Page 6: Edge detection using sliding statistical tests

PETEK DE SOUL4

175

150

125

100

75

25 50 75 100 125

C 5- ,\

4- i 3- 2- -

1- 0-

-l- if -2 - -3 - -4 I I I I-I

25 50 75 100 125

FIG. 2. Sliding T test: (a) profile taken across a lung field in a chest radiograph, (b) poor result of t test, (c) 7 test values.

samples to satisfy an equation of the form

Y = ax2 + bx + c (3)

describing the gradation in intensity along the profile. Alternatively, if there is an edge notionally situated at the (n + 1)th pixel so that the two samples are entirely distinct and come from different objects, then we would expect the first sample to satisfy (3) and the second to satisfy

.Y = ax2 + bx + c + d (4)

where a, b, and c take the same values as in the first sample, and d is a constant describing the difference in intensity between the samples after allowing for the

Page 7: Edge detection using sliding statistical tests

EDGE DETECTION USING SLIDING TESTS 7

gradation. Thus, if we fit curves like (3) and (4) to the two samples we can test for significant differences between them by testing d to see if it is significantly different from zero. An appropriate test can be found in Johnston [9] and is outlined below.

We wish to find the best fitting model of the form Y = X/? where

Y=

Yl

Y2

Y,

Y n+2

Y n+3

Y2n+ I

x=

4 Xl 1 0

x2” x2 1 0 . . . . . .

4 xn 1 0

x,2+2 X,+2 1 1

x,2+3 X,+3 1 1 . . . . . .

X2”+ 2 I XZn+ 1 1 1

The least squares solution is given by

b = (X’X)~‘X’Y.

Let

s2 = (Y’Y - pX’Y)/2(n - 2).

Then a test on the significance of d is given by

7 = &s&

where (Y is the element of (XX-’ in row 4, column 4.

P= (5)

(6)

(7)

(8)

As in the case of the t test (1) the statistic 7 would be expected to have turning points in the vicinity of edges. Under certain conditions 7 would also have a t distribution just as the statistic t has; however, it should only be interpreted as a statistical test with caution, for the same reason as before.

Figure 2C shows the result of applying the sliding 7 test to the profile in Fig. 2A, again using a window equivalent to about 8 mm on the original radiograph. There are now sharp and distinct positive and negative peaks located in the vicinity of the rib edges and rib cage edge, as required. Other minor peaks are due to small fluctuations in the profile. The turning points which correspond to relevant edges might be determined by thresholding, or in this case by noting that anterior ribs always occur at the left side of such profiles and therefore the location of the turning points can be used to resolve the problem.

Note that the matrices X’X and X’Y consist of straightforward sums of squares and products which can simply be updated each time the window is moved, thereby keeping computation to a minimum. As before, it may be desirable to put a small arbitrary lower limit on S* so that the denominator in 7 (8) never takes zero or very small values. In fact, doing so may even help to suppress the irrelevant peaks while leaving the others largely unaffected.

Page 8: Edge detection using sliding statistical tests

p PETER DE SOUZA

Another procedure for detecting edges in the presence of smoothly changing intensity is described by Haralick [IO]. He is particularly interested in the tao- dimensional case and uses a statistical test based on a sloped-facet model as a means of detecting the changes in slope or average intensity which accompany certain types of edges.

4. SLIDING TESTS FOR TEXTURES

The sliding tests described in the previous two sections are only appropriate where the edges being sought occur between objects having different average intensities. Edges between different textures may not satisfy this condition and therefore alternative tests will often be required. Two tests which might be used in the case of texture edges are described in this section. and a further procedure along similar lines may be found in Davis and Mitiche [3].

As an example we shall consider a herringbone weave of the type shown in Fig. 3B. The herringbone pattern consists of parallel bands of equal average intensity and therefore it would be inappropriate to use the sliding t and 7 tests as edge detectors in this case.

Figure 3A shows a one-dimensional profile obtained from this herringbone pattern by averaging several adjacent diagonal sections. The data has been resealed to have a mean of zero. Given only this one profile, it is difficult to say exactly where one band ends and another begins, but the difference between the bands shows up clearly as a difference in variance. As expected, there is no noticeable difference in the mean values of the bands.

In cases such as this where the difference between textures shows up as a difference in variance, the texture edges might be detected with nothing more complicated than a sliding F test ([6], pp. 325-327) designed to test the variance ratio of the left and right halves of the sliding window. Consider again a windovr of 2n + 1 pixels and let x,, x2.. , x,, denote the value of the first n pixels, or the left half. Then the variance of the left half is defined by

and the variance V, of the right half is defined similarly on the last n pixels. The variance ratio F is then given by

F= mad v,, V, >

tin(f$ v,> ( 10)

which would be expected to have local maxima in the vicinity of edges. As before, a suitable window size for use with a sliding F test should be

determined by the size of the objects in the image where this is known. In the current example the “objects” are fairly broad herringbone bands and so a large window is appropriate. Accordingly, a sliding F test with a half window of 30 pixels was applied to the profile in Fig. 3A, and the results after smoothing are shown in Fig. 3C. Because the original profile in Fig. 3A is so erratic the resulting F sequence was

Page 9: Edge detection using sliding statistical tests

EDGE DETECTION USING SLIDING TESTS 9

25 50 75 100 125 150 175 200

35 30 25 20 15 10

5

I 1 I I I

25 50 75 100 125 150 175 200

FIG. 3. Sliding tests for textures: (a) herringbone diagonal profile, (b) herringbone weave, (c) F test values. (d) x2 test values.

also a little erratic but was found to be amenable to some simple smoothing. In this case an ordinary five-point rectangular moving average was applied to the sequence to smooth it. The result is that the local maxima are clearly defined, easy to identify, and, as expected, are located in the vicinity of the herringbone band edges. Note that local minima are of no significance in this test. The maxima do not always occur at the “exact” position of the band edges, reflecting the fact that it is difficult to pinpoint the edges given only the profile in Fig. 3A.

There will often be cases where a difference in texture is not accompanied by such an obvious difference in variance as that shown in Fig. 3A. In these cases the sliding F test may not detect the edges between the textures reliably, and a test is required which can detect changes in pattern rather than changes in variance or changes in intensity. We will now consider a sliding x2 test based on an autoregressive model which is appropriate in these circumstances.

Page 10: Edge detection using sliding statistical tests

Let X = {x,} (t = 1,2,. . , II ) denote a one-dimensional sequence of data satrsfv.. ing the pth-order autoregressive equation

i a;x,-, = t, (I ==p + 1. p + 2,..., n) !il) 1=0

where (Ye = 1 and the {ar} are uncorrelated random variables each with mean zero and variance a*. Let {a;} (i = 1,2,. . ., p) denote the least squares estimates of the parameters {a,} and let RSS denote the resulting residual sum of squares. (Note that an extremely efficient algorithm for computing these values can be found in Markel and Gray [ 11 I.) Finally, let the p x p matrix D be defined as

where n’ = n - p. Now consider two independent samples of data X,,X, both of size n. It can be

shown [12] that the statistic

x = $(&, - &,)‘(D,/&; i- D,,‘(i,2)(~%~ - a,) (13)

has a xi distribution if the two samples emanated from the same autoregressive process. Here the subscripts 1,2 denote the respective samples and

bf = RSS,/( n’ -- p) (i = 1,2). (14)

We may use the statistic x to detect changes in texture patterns by modeling the data as autoregressive series. Given a one-dimensional profile taken from an image, we may perform a sliding x2 test using x defined over a window of 2n -I- 1 pixels. In this case the two samples would be the first n and last n pixels in the window, respectively. Again, it would be expected that x would attain local maxima in the vicinity of edges, and because x has a xi distribution only when both samples arise from the same process, it would also be expected that these maxima would be statistically significant at genuine edges, i.e., they would exceed, for example, the upper 5% point of the xi distribution. This property means that we may use the x’, distribution as a guide if necessary in the selection of thresholds.

The sliding x2 test was applied to the profile in Fig. 3A under the same conditions as for the previous F test, i.e., a half window of 30 pixeIs was used and the resulting sequence smoothed using a five-point rectangular moving average. Fig. 3D shows the results obtained with p = 2 in (13). We would expect local maxima greater than the upper 5% point of the xi distribution (5.99) to he in the vicinity of the edges and this is indeed the case. Again, local minima are of no significance.

Note that the statistic x is unaffected by differences in variance between the two samples. The terms &: and ;12’ effectively standardize the samples to a common variance, and therefore x is sensitive to changes in pattern only. Despite the fact that in this case we have discarded useful information concerning the variances, the x2 test has proven sufficiently powerful to have detected all the edges on the basis of

Page 11: Edge detection using sliding statistical tests

EDGE DETECTION USING SLIDING TESTS 11

changing shape alone. As before, the maxima do not coincide exactly with the herringbone band edges, and in fact they appear to be slightly less precise than the F test maxima. This is not surprising in the case of this profile where there is a striking difference in the variance of adjacent bands but a much less obvious difference in pattern.

The height of the peaks in the x sequence is determined by how great the difference in pattern is between the two samples, and how well the autoregressive model fits the data. In the particular profile shown in Fig. 3A this varies from edge to edge and consequently the peaks are of varying height in Fig. 3D.

5. A LIKELIHOOD RATIO TEST

The t test of Section 2 tests for a difference in average intensity between the left and right halves of the sliding window, and the F test of Section 4 tests for a difference in variance. In this section we will consider a likelihood ratio statistic which is sensitive to a difference in intensity and also to a difference in variance.

In the case of two independent normal random samples x,, x2,. . . , x, and Y,, Y2,..., y,,, the likelihood ratio X ([13], pp. 268-269) is given by

4s2s2 U2 A= -.-L-L

i i $0”

where

So’ = C(Xi + yi)2 - (xxi + .Yi)2/2n

s; = xx; - (Cx,)‘/n

s22 = CYi’ - ( CYi)2/n-

(15)

(16)

(17)

(18)

Furthermore, it can be shown ([13], pp. 240-241) that

L = -2log,X (19)

has an asymptotic ~‘2 distribution when the two samples come from the same normal distribution. Because the approximate distribution of L is known, it affords a convenient and simple means of determining whether the two distributions have the same mean and variance. In fact, the statistics A and L are equivalent as there is a monotonic relationship between them, and so we may use whichever is more convenient.

In the present context the two samples are the left and right halves of the sliding window, and by computing L at each window position we would again hope to find local maxima in the vicinity of edges. As before, the statistical assumptions underly- ing the derivation of h are not usually met in image processing and therefore L cannot strictly be used as a statistical test and should be interpreted with caution.

Figures 4A and 4B show the results of applying the log likelihood ratio test L to the profiles in Figs. 1A and 3A, respectively, under the same conditions as the t test

Page 12: Edge detection using sliding statistical tests

19 I- PETER DE SOLVA

50 100 150 200 250 300 350

25 50 75 100 125 150 175 200

FIG. 4. Sliding log likelihood ratio test. f.: (a) applied to rib profile of Fig. IA. (b) applied to herringbone profile of Fig. 3A.

and F test described earlier. The results obtained on the herringbone profile are much the same as those obtained with the F test (Fig. 3C) with clear peaks in the vicinity of the edges between the bands. In the case of the rib profile, however, the results are a littler harder to interpret than those obtained with the f test (Fig. 1 R). Unlike the t test which had positive and negative peaks corresponding to “positive” and “negative” edges, L is positive semidefinite and therefore all the detected edges are represented by positive peaks. Furthermore, the sequence of L values is not as smooth nor are the peaks as unambiguous as was previously the case with the t test.

Thus the log likelihood ratio test L can be seen to be more general than the other tests discussed here, being applicable to a wider variety of profiles, but in some cases it may be harder to interpret than the simpler, more specific tests.

Further discussion of the use of likelihood ratio tests in edge detection can be found in Yakimovsky [ 141 who considers some two-dimensional cases.

6. SUMMARY

This article has discussed the problem of detecting edges in one-dimensional profiles, and has considered solutions based on a sliding window which travels along the profile. It has been argued that in many cases the size of the window can and should be determined by the nature of the objects combining to create the edges, rather than being determined by edge properties. This often leads to quite large windows being selected, covering considerably more than the immediate vicinity of an edge.

Edges are detected by locating the positions where a function computed over the window undergoes a particular type of turning point. The function is dependent upon the nature of the problem and five different functions have been described, all

Page 13: Edge detection using sliding statistical tests

EDGE DETECTION USING SLIDING TESTS 13

of which are based on statistical tests. These are

(1) The t test (1) which is appropriate in straightforward cases where an edge lies between two homogeneous objects having different intensities;

(2) the 7 test (8) which is appropriate in cases where an edge lies between two objects of different intensity but where there is a gradation in intensity across the objects;

(3) the F test (10) which is appropriate for detecting edges in textures with different variances but possibly identical average intensities;

(4) the x2 test (13) which is appropriate for detecting edges in textures which have the same variance and the same average intensity;

(5) the log likelihood ratio test L (19) which is sensitive to edges lying between objects of different intensity or different variance and may be used wherever the t test or F test is appropriate.

In the first two of these tests local maxima and local minima are both significant in the sense that they indicate possible edges. In the other three cases only local maxima are of interest; local minima are of no significance.

It is interesting to note that the sliding x2 test (13) has applications outside image processing. It is, in fact, suited to many signal processing tasks where it is required to detect changes in the signal. In this context it has also been used by the author as part of a speech recognition system where it was successfully applied to the problem of detecting boundaries between phones. The sliding t and +r tests have also been used successfully. They form part of a rib detection algorithm which will be reported in full at a later date.

ACKNOWLEDGMENTS

I thank M. Cocklin, A. Gourlay, P. Jackson, G. Kaye, and A. Pullen for their assistance and for many helpful discussions. I am also indebted to IBM U.K. Ltd. for awarding me the fellowship under which this work was carried out.

REFERENCES

I. W. K. Pratt, Digital Image Processing, pp. 478-499, Wiley, New York, 1978. 2. R. W. Ehrich and F. H. Schroeder, Contextual boundary formation by one-dimensional edge

detection and scan line matching, Computer Graphics Image Processing 16, 1981, I 16- 149. 3. L. S. Davis and A. Mitiche, Edge detection in textures, Computer Graphics Image Processing 12, 1980,

25-39. 4. E. Persoon, A new edge detection algorithm and its applications in picture processing, Computer

Graphics Image Processing 5, 1976, 425-446. 5. H. Wechsler and J. Sklansky, Finding the rib cage in chest radiographs, Pattern Recognition 9, 1977,

21-30. 6. Y. L. Chou, Statistical Analysis, 2nd. Ed., Holt, Rinehart, Winston, New York, 1975. 7. C. J. Jacobus and R. T. Chien, Two new edge detectors, IEEE Trans. Pattern Anal. Mach. Intell.

PAMI-3, 1981, 581-592. 8. M. Basseville, B. Espian, and J. Gasnier, Edge detection using sequential methods for change in level

-Parts I and II, IEEE Trans. Acoust. Speech Signal Process., ASSP-29, 1981, 24-50. 9. J. Johnston, Econometric Methods, pp. 106-142, McGraw-Hill, New York, 1963.

IO. R. M. Haralick, Edge and region analysis for digital image data, Computer Graphics Imuge Processing 12, 1980,60-73.

I I. J. D. Markel and A. H. Gray, Linear Prediction of Speech, pp. 219-222, Springer-Verlag. Berlin, 1976.

Page 14: Edge detection using sliding statistical tests

14 PETER IX’ SOUZA

I!. I’ de Sousa and P. Thomson, LPC distance measures and statistical tests, with particular rcferenca: *Al the likelihood ratio, IEEE 7’runs. Acousr. Speech Signal Pro~.~.. ASSP-30, 10X2, 304 7 15

I>. M. G. Kendall and A. Stuart. The Adtxmced Them, of Statistrc~. Vol. 2. 3rd Ed.. Ciriffin. l.nn~~~ 1913.

14. Y Yakimovsky, Boundary and obJect detection in real world images. J. Assoc~ C‘onzpul rtlot,l:. 23. 1976. 599-618.