Image Segmentation By Local Morphological ... - IEEE Xplore

2 downloads 0 Views 336KB Size Report
texture-based segmentation. Rather than construct a single size distribution based upon the entire image, local size distributions are computed over windows ...
1220

IMAGE SEGMENTATION BY LOCAL MORPHOLOGICAL GRANULOMETRIES Edward R. Dougherty, Eugene J. Kraus, and Jeff B. Pelz CENTER FOR IMAGINGSCIENCE ROCHESTER INSITUTEOF TECHNOLOGY

Abstract Morphological granulometries are generated by successively opening a thresholded image by an increasing sequence of structuring elements. The result is a sequence of images, each of which is a subimage of the previous. By counting the number of pixels at each stage of the granulometry, a Size distribution is generated that can be employed as a signature of the image. Normalization of the size distribution produces a probability distribution in the usual sense. The present paper describes an adaptation of the method that is appropriate to texture-based segmentation. Rather than construct a single size distribution based upon the entire image, local size distributions are computed over windows within the image. These local size distributions lead to statistics at pixels within the image and pixels are classified according to local statistics. If the image happens to be partitioned into regions of various texture, the local statistics will tend to be homogeneous over any given region. Segmentation results from classifying the local statistics. Kevwords: Morphology, Granulometry, Segmentation, Texture

.

. . .

ize D-i

One of the basic operations of morphological image processing is the opening. The opening of a binary image S by a binary structuring element E (also an image) is defined to be the union of all translations of E which are subsets of S. In effect, the template E is moved around inside S and the opening, OPEN(S, E), consists of all the points of S which lie in some translated copy of E. Rigorously, x E opEN(S,E) if and only ifthere is some translgte E + z of E such that x E E+ z S. If E is a ball, the effect is as if E were "rolled around inside of S and all points in S covered by the rolling ball were kept in the opening. From the definition, it follows that for E C F, OPEN(S, F) c OPEN@, E). As a result, if El, E2 ... is a sequence of increasing structuring elements, then the filtered images form a decreasing image sequence opEN(S,E,)> opn\l(S, E2) 3

...

Counting the number of pixels in each succeeding opening results in a decreasing function Y (k) , such that for some K, Y (k) = 0 for k 2 K. Depending on the shapes of the Ek, various texture information is revealed by studying the function Y (k) . The image sequence {OPEN(S,Ek)} is called a granulomstry and the resulting function Y (k) is called a size distribution. In practice E l consists of a single point so that Y(1) = CARD(S). The notion of a granulometry was introduced by Matheron in (31 and is discussed by Dougherty and Giardina in [I] and [2] and Serra in [5]. Since Y (k) is a decreasing function, the normalization

is a probability distribution function and the (discrete) derivative d@(k) is a discrete density function. The moments of d@ can be used to extract shape or texture information from an image. For instance, in [4], Pelz and Dougherty use d@ to analyze the distribution of toner particle size. It should be recognized that, relative to a population of images, d@ is a random function, and therefore its moments are random variables. For instance in our current studies we make use of both the mean p and variance 0 2 of d@. Each of these is a random variable possessing a distribution that is dependent on the image population. In the current work, we introduce the notion of a local granulometric size distribution. In this case, the granulometry is generated in the usual manner: however, for each pixel x, a window of a fixed size is centered at the pixel at the conclusion of each opening and a count of the activated pixels in the window is recorded. The result is that a local size distribution W X is generated at each pixel x in the image domain. Normalization yields a histogram de, at each pixel. Each of these has moments, and in the present paper we make use of the mean K, of de, although our study has shown that useful local texture information is also revealed by other moments, especially the variance. Since we are only using px, for the purpose of efficiency we are partially computing each of these as k increases and not keeping the entire histogram d9x.

A Seamentation Modd Restricting our attention to the means, p = p x is an image that contains local texture information. Specifically, because of

1221 the way px has been generated, it reflects the texture in the window around x, relative to the structuring-element sequence. Texture segmentation occurs by segmenting the image p. We consider a simple model to demonstrate the manner in which circular structuring elements of increasing diameters generate the mean image p. To do so, we adopt the preceding digital definitions to the continuous case so that a size distribution Y = Y ( t ) is a function of a real variable t, dO(t) is a true derivative, and the mean p is the mean of a continuous probability distribution (see [ I ] or [2]). In the local case, we have dQ,(t) and px. Now consider an image S that is partitioned into two regions S, and SR consisting of disjoint balls of radius r and R, respectively, r < R (see Figure 1). We consider a granulometry based on the structuring-element sequence of balls Et of radius t. For t 5 r, OPEN(S, Et) = S; for r < t IR, OPEN(S, Et) = SR;and OPEN(S, Et) = 0 . for t > R, For a pixel x, suppose W is the window determining the local size distribution. Let us assume the number of balls in a region is proportional to the region area, the constant of proportionality being q, and that no balls intersect the boundary of W. There are three cases to consider (see Figure 2). If W lies entirely in S,, then the local size distribution W, is a step function with W, (t) = qW& for t 5 r and W, (t) = 0 for t s r, where we have let W denote its own area. Normalization yields the generated density d$ ,(t )= 6(t - r), 6( t) being the delta function. Thus, px = r. Analogously, if W lies entirely in SR.then pLX = R.

Fig. 1 - Regions Sr & SR

Fig. 2 - Sampling Windows

More interestingly, suppose W lies partially in both S, and SR, with the areas of W n Sr and W n SRbeing pW and (1 - p)W, respectively, 0 < p < 1. Then qxw(pr2 + (7- p ) ~ ' ) , f o r t s r for r < t < R for t z R

Let A(r) and A(R) denote the areas of regions of the image for respectively; let A(rR) denote which W S r and w c the remainder of S; and, finally, let A denote the area of the domain of S . Then the first-order probability distribution associated with p jumps from 0 to A(r)/A at r, rises continuously to [A(r) + A(rR)]/A at R, and then jumps to 1. Thus, the associated first-order density is of the form

s,,

11A

AV) S(y

- r ) + A(R)

S(Y - R)1+ Q(Y )

where the support of g(y) lies between r and R. If we now assume that A(rR) is small in comparison to both A(r) and A(R), then the density possesses spikes at r and R that are much greater than the continuous mass g(y) between r and R. It is therefore possible to choose a threshold value between r and R with which to segment S approximately into S, and SR. It is also possible to use gradient edge detection to locate an edge between Sr and SR. The condition that A(rR) be small in comparison to both A(r) and A(R) entails two requirements. First, both S, and SR must comprise substantial portions of the image. Second, the window must be small in comparison to the overall image and the boundary between S, and SR must not "wander" too far about the image. The model can be extended to multiple texture regions defined in terms of balls of various radii. In this case, px dependson the number of regions its window intersects. If W intersects the r l , r2 ...... ,r regions with respective intersection areas plW, p2W...... pmW, the sum of the pi being 1 and r1 r2< ... < ,,r then

i=l

A further extension of the model can be made in which the local texture regions are comprised of shapes other than balls. Consider any compact convex set B in the Euclidean plane and let r I , r2 ...... r, be a strictly increasing finite sequence of nonnegative real numbers. Suppose the texture region corresponding to 6 consists of bodies of the form

r iB,if t s r , OPEN(r

-p)R pr' + ( I - p) R Thus,

prz

Moreover, for

r i B = { r i b : b c B}

2

pr3 + (I

px+r.

each of which is a convex set. Then (as discussed in [2]) for t > 0

Normalization yields

W, =

AsP+O,px-+R,andasp+l, O < p < l , r < wX < R .

pr' + (I - P)R

6(t

-

R)

B, t B ) =

0,

if t >ri

Moreover, for any s r 0, the area of sB is s2 times the area of B. Consider the granulometry generated by the structuring elements Et. If the window for x intersects the r I r2 ...... ,r texture regions, then px is given by the same expression as in the case of balls.

.

3'

-

P)R

.+(I - p ) ~ '

In practice, textures do not display the uniformity of structure necessary for the segmentation model given herein.

1222 Even if each texture region is characterized by balls of a given size, the radii of these balls will exhibit some variability. Thus, one cannot expect the mean image to consist precisely of constant regions separated by a gradient. More generally, the mean image will itself exhibit variability, so, at best, the probability density for the mean image will have local maxima separated by valleys. While a large window might help to mitigate texture fluctuations, it will also result in a large boundary and less peakedness in the mean-image density. Conversely, a small window will shrink the area of the gradient in the mean image at the cost of greater mean variability throughout the image. in order to model the effect of variability within a given texture region, a more robust random model has been developed; however, due to the requirements of space, it will not be presented here, but will appear in a forthcoming longer paper.

EXPERIMENTAL

While circular structuring elements are sufficient to segment the regions in this image, in some cases regions of like image components are not easily segmented using circular elements alone. Figure 13 shows such a segment containing three classes of image components, all three of which are opened by circular structuring elements of the same diameter.

Fig. 13 Figure 14 shows a more complex 256x256 simulated image requiring a range of structuring elements for segmentation.

Figure 3 is one of the simulated test images used in our experimentation. It is similar to the two-region case described above, except that some of the circular image components overlap and there is local variation in dot placement within regions S, and SR.The image was digitized as a 256x256 binary image.

Figure 15 shows the results of a [33x33] local granulometry with a circular structuring element on the complex image. As expected, the results can be used to segment the two regions of circular image components, but the other regions are not easily distinguished.

Figure 3

Figure 4 is the result of local granulometric calculations applied to Figure 3 using circular structuring elements and a window size of [17x17]. The image is the greyscale representation of the pLxvalues at each pixel, the darker regions representing areas of larger p,. While the two regions are clearly distinguished in the image, evidence of local variation is strong due to the window size. To decrease the effects of local variations within S R , Figure 5 was calculated with a [33x33] window. As predicted, the local variations are muted at the expense of broader borders between regions. Increasing the window size to [49x49] eliminated all evidence of local variations, while broadening the border still further. Figure 7 shows p calculated using a [7x7] window. The border dividing the regions is sharper, but the local granulometric calculations are now locating individual image components rather than regions of like components. The greylevel p images must be thresholded to achieve segmentation. Greylevel histograms of the [7x7], [I 7x171, 133x331, & 149x491 granulometries are shown in Figure 8. Window Size

Figures 9, 10 , 11, & 12. The effect of window size is clearly illustrated in this sequence.

4

+

7 ,7 33 49

As shown above, any convex shape may be used to form the ever-increasing set of structuring elements. In this case, four linear structuring elements, (vertical, horizontal, positive diagonal, and negative diagonal) are used in addition to the circular element. The five structuring elements are termed E". Eh, E,, E,, and E,. An array comprising wLx calculated with vertical structuring element Evyielded the image V = V,. Similarly, images H = Hx, P = P,, N = N, and C = C, were produced. These elements yield very different values for the three regions shown in Figure 13. In addition to the maximum 'length' being different in each case, it is also clear that the V and H images would be substantially different for the three regions. In cases where the investigator has a priori knowledge of the image components, 'custom' structuring elements could be used to identify those regions. Rather than attempt image segmentation based on the five individual images V, H, P, N, and C, the data was combined to ease the differentiation of local textures. In order to locate areas of maximum linear dimension, regardless of direction, was defined. Figure 16 MaxLin = M, = MAX(V,,H,,P,,N,) shows the Maxlin results based on a 133x331 window sampling of the test image. This measure still does not differentiate regions of large linear components from regions consisting of circular components with similar diameters. In order to allow such differentiation, the following linearity measure was defined: Linearity = L' = MP

CP

In order to segment the images into fields S, arid& a threshold value of 48 was chosen. Segmented images are shown in

The ratio yields 1.0 for all circular elements regardless of diameter, with values increasing for components whose ratio of 'length' to 'width' increases. L', based on a [33x33] window for the complex simulated image is shown in Figure 17.

1223

A range of Figure 18 classes of values. In similar L',

such measures can be defined based on the image. shows an image segment containing three new image components, selected to yield similar M, addition, the central and rightmost regions yield values.

Fig. 18 In order to differentiate such textures, the mean of the linear can be measures, AvgLin = A, = Mean(V,,H,,P,,N,), implemented. While any one of these measures may be capable of segmenting regions in a given image, in most cases segmentation would have to be based on a vector, coding several texture measures. Classification of image regions could then be accomplished given a look-up table of known vector values.

s1.

Dougherty, E. R., and C. R. Giardina, lmaae Processina __ Continuous to Discrete. Prentice-Hall, Englewood Cliffs, 1987.

2.

Dougherty, E. R., and C. R. Giardina, ~OrDhOloaicd Mh eo td% sPrentice-Hall, Englewood Cliffs, 1988.

3.

Matheron, G., Random Sets and lntearal Geometw, John Wiley, New York, 1975.

4.

Pelz, J., and E. R. Dougherty, "Granulometric Analysis of Toner Particle Distribution, Electronic Imaging '89, Pasadena, 1989.

5.

Serra, J., Jmaae Analvsis and Mathematical Morpholoav. Academic Press, New York, 1988.

I

Fig. 7 [7x7] Granulometry

Fig. 4 (17x171 Granulometry

Fig. 5 p3xm.l Granulometry

Fig. 6 [49x49] Granulometry

Fig. 9 [7x7] Segmented Image

Fig. 10 [17x17] Segmented Image

Fig, 11 [33x33] Segmented Image

Fig. 12 [49x49] Segmented Image

Fig. 14 Test Image I I

Fig. 15 C Granulometry

Fig. 16 M Granulometry

Fig. 17 Lx Granulometry

Suggest Documents