Window-size determination for granulometrical structural texture
classification
1Sen-Ren Jan, Yuang-Cheh Hsueh
)Department of Computer and Information Science, National Chiao-Tung UniÕersity, Hsinchu, Taiwan 300
Received 11 September 1997; revised 21 January 1998; accepted 22 January 1998
Abstract
In this paper we present a method to predict the window size when determining the local granulometry for a structural texture image set. The proposed method is based on the concept of periodicity property of structural texture images. It suggests that one may choose the minimum odd number not less than the maximum periods of texture images as a window size.q 1998 Elsevier Science B.V. All rights reserved.
Keywords: Granulometry; Local granulometry size distribution; Window size; Structural texture; Texture periodicity; Covariance;
Co-occurrence matrix
1. Introduction
Dougherty and his colleagues introduce the con-cept of local granulometric size distributions and
Ž
apply it to image segmentation Dougherty et al.,
. Ž
1989 and pixel classification Dougherty et al., .
1992a . Their works indicate that moments of local granulometric size distributions provide good feature sets for pixel classification, however, a feature value from a local granulometric size distribution is a good descriptor of an image only when an effective win-dow size is chosen.
A good result of the pixel classification is ob-tained only when the chosen window contains
suffi-)Corresponding author. E-mail: [email protected]. 1This work was partially supported by the National Science
Council of the R.O.C., under Grant NSC 84-2112-M-009-038.
cient information. Thus, the selection of an effective window size is very important. For a particular grain model, there is an inverse relation between the
varia-Ž .
tion of the PSM pattern spectrum mean and the
Ž .
window size Dougherty et al., 1992b . In this paper, we propose a method to predict a window size for a structural texture image set. A structural texture im-age possesses a property called texture periodicity. By investigating texture periodicities of the given images, we can determine the window size that in turn determines the local granulometry. The pro-posed method is based on the co-occurrence matrix Žfor the binary case and the covariance calculation. Žfor the greyscale case . We first find the texture. periodicity and then determine a reasonable window size.
The rest of this paper is organized as follows. In Section 2, we briefly review morphological granu-lometries and local granugranu-lometries. In Section 3, we 0167-8655r98r$19.00 q 1998 Elsevier Science B.V. All rights reserved.
Ž .
review the notions of co-occurrence matrices and covariance that will be used in the present study. In Section 4, we describe the proposed method in de-tail. In Section 5, we show experimental results and give a discussions. Finally, we draw some conclu-sions in Section 6.
2. Granulometry and local size distribution Let S be a bounded set and E , E , E , . . . an0 1 2
increasing sequence of structuring elements such that
Ekq1 is E -open, kk s1,2, . . . . Then the opened
im-ages S(E , S(E , S(E , . . . form a decreasing se-0 1 2
Ž .
quence called a granulometry Matheron, 1975 . Ž .
Moreover, a decreasing function V k can be ob-tained by counting the number of pixels remaining in Ž . each succeeding opening. Since S is bounded, V k s0 for sufficiently large k. If E consists of a0
Ž .
single pixel, then V 0 gives the image area of S Ž .
itself. The function V k is called a size
distribu-Ž . Ž . Ž .
tion. The normalizationF k s1yV k rV 0 is a probability distribution function and the discrete
Ž . Ž . Ž .
derivative dF k sF kq1 yF k is a probabil-ity mass function.
Local granulometric size distributions, introduced
Ž .
by Dougherty et al. 1989 , are variations of size distributions alluded to the above. As in the original granulometry, the entire image is opened succes-sively by a sequence of increasing structuring ele-ments. Then, by placing a window at each pixel x in the image and by taking a pixel-count in the window at each stage of the granulometry, a local
granulo-Ž .
metric size distribution V k is obtained for x.x
Then each size distribution is normalized and differ-entiated to generate the local pattern spectrum
Ž . dF k .x
Ž .
Consider the model in Dougherty et al., 1992b . Let the regions S and S partition an image S suchr R
that they consist of disjoint balls of radius r and R, respectively, where r-R. The proportion of the number of balls in each region to the region area is assumed to be a constant q. Now suppose W is the window determining the local granulometric size distribution for a pixel x. In the case when W lies partially in both S and S , the area of Wr R lS andr
Ž .
WlS are assumed to be pW and 1yp W, re-R
spectively, where 0-p-1. Moreover, no balls are assumed to intersect the boundary of W. Then
2 2
°
qp W pr q 1yp RŽ
.
for tFr,~
2V t sx
Ž .
¢
qp W 1yp RŽ
.
for r-tFR,0 for R-t.
Normalization and differentiation yields:
2 1yp R
Ž
.
dF t s 1yxŽ .
pr2q 1yp RŽ
.
2 d tyrŽ
.
1yp R2Ž
.
q 2 2d tyR ,Ž
.
pr q 1yp RŽ
.
Ž .where d t is the delta function. Thus,
pr3q 1yp R
Ž
.
3 m sx 2 2, pr q 1yp RŽ
.
2 4 4 3 3 pr q 1yp RŽ
.
pr q 1yp RŽ
.
2 s sx 2 2yž
2 2/
. pr q 1yp RŽ
.
pr q 1yp RŽ
.
Note that as p™0, we have m ™R and s ™0,x x
and as p™1, we have m ™r and s ™0. Alsox x
note that r-m -R.x
The density dF can be used as a descriptor ofx
the local texture at x, and the moments of the local granulometric size distributions can be used to clas-sify pixels based on local texture. Interested readers
Ž .
can find more details in Dougherty et al. 1992a,b .
3. Co-occurrence matrices and covariance In the current study, we are interested in choosing an effective window size that determines the local granulometries for a structural texture image set. In structural texture images, texture primitives are basic units to form the images. These can be found by
Ž
using co-occurrence matrices Zucker and Terzopou-los, 1980; Parkkinen et al., 1990; Starovoitov et al.,
.
1995 . A co-occurrence matrix M consists of
ele-Ž .
ments M i, j; d k, d l , each of which represents the number of times that a given feature i occurs in a
Ž .
particular spatial relation d k, d l to another given feature j. Generally, x2 statistics are used to
mea-sure the association between the grey values of the
Ž . Ž .
the elements of the co-occurrence matrix and, N the Ž .
sum of all elements of M i, j . Here, for brevity, the
Ž . 2
displacement d k, d l is not explicitly given. The x statistics are computed by the following formula ŽParkkinen et al., 1990 :. 2 M i ,
Ž
P M P, j. Ž
.
M i , jŽ
.
y m mž
/
N 2 x sÝ Ý
, M i ,Ž
P M P, j. Ž
.
is1 js1 N Ž . Ž .where M i,P and M P, j are row and column sums, and m is the matrix size. The displacements Žd k,P and P, dl are used to analyse the horizontal. Ž . and vertical periods, respectively. For the binary case, this method is fast and effective. However, it has to compute a large co-occurrence matrix for a grey scale image. In order to avoid the large co-oc-currence matrix computation, we use the concept of covariance to find the texture primitives for grey scale images.
Let S be an artificial texture image shown in Fig.
™
Ž . 4
1 a , and let Bs 0, 1h be a structuring element,
™
where 1h is parallel to the x-axis. Then the
covari-Ž . Ž .
ance of S can be defined as CoÕ h sMes S]B , Ž .
where Mes A denotes the number of black pixels in
Ž .
A Serra, 1982; Giardina and Dougherty, 1988 . That
Ž .
is, the covariance CoÕ h is the measure of S]B, the erosion of set S by B. The calculated covariance
Ž .
is depicted in Fig. 1 b . The period of repetition can be found by investigating their spatial distribution ŽSerra, 1982 or by using convolution filters De-. Ž
.
waele et al., 1988 . In this study, we used a simple and intuitive approach. The width of the texture primitive is the distance between two adjacent local
Ž .
maxima or minima . The height of the texture
primi-Ž . Fig. 2. Conditional covariance curve of Fig. 1 a .
tive can be similarly found by working along the
y-axis.
The preceding results are easily generalized to
Ž .
grey scale images Serra, 1982 . For a grey scale Ž .
image S, the covariance CoÕ h of S is defined by
CoÕ h sE f x yp
Ž .
Ž .
f xŽ
qh yp.
2sE f x f xqh yp
Ž . Ž
.
Ž .
where f x denotes the grey value at point x and w Ž .x
psE f x . Interested readers can find the details in
Ž .
Serra 1982 . Ž .
In Fig. 1 b , we observe that the heights of the repetition peaks on the covariance curve are decreas-ing. To find the repetition period of a texture primi-Ž < . tive, we define the conditional covariance CoÕ h w
Ž .
to be Mes Slw . Note that w is a window se-h
lected from the texture image S. Instead of measur-Ž < .
ing the entire image S, CoÕ h w just measures the area of the intersection of the shifted window w andh
the image S. Fig. 2 exhibits the conditional covari-Ž .
ance curve of the image in Fig. 1 a . Note that all Ž .
peaks have equal height. Fig. 3 b shows the condi-tional covariance curve of the texture image D102 in
Ž . Ž . Ž .
Ž . Ž . Ž
Fig. 3. a Texture image D102; b conditional covariance curve of example texture image D102 the thin line presents the horizontal .
period, and the bold line the vertical period .
Ž .
Fig. 3 a . In our experiments, the position of the first peak of the conditional covariance curve is taken as the period of the texture primitive.
4. Texture primitive and window size.
In a pixel classification application, the selection of a window size W will affect the training results of a maximum likelihood classifier. Let us consider the situation mentioned in Section 2. If WFr, then the window W may lie entirely in the ball of radius r or
R. Moreover, if the distance d between disjoint balls
is less than W, then W may lie partly in balls of radius r and R. Otherwise, W may lie between disjoint balls. Thus, if one randomly chooses sample points from a texture image to compute the local granulometric size distributions associated with them, then the local pattern spectrum mean values will vary in the range from 0 to R, and the pattern spectrum standard deviation of this texture image is large. If r-WFR, the local pattern spectrum mean values vary from r to R. Note that the probability of the event that W lies between disjoint balls is de-creased. As we keep enlarging the window size, the variation of local pattern spectrum mean values is further decreased.
In a practical application, we assume that texture images are structural texture images. That is, the
images are defined by texture primitives which ap-pear in near regular repetition spatial arrangements ŽHaralick, 1979 . In this case, as we enlarge the size. of window W, the variation of the local pattern spectrum mean for each image is decreased. The variation will be mitigated when the window size is larger than the sizes of the texture primitives, due to the periodicity property of structural texture images. Fig. 4 illustrates the relation between W and the pattern spectrum deviation for texture image D20. The structuring elements used in this example are the
Ž .
same as those used in Dougherty et al., 1992a . The
x-axis denotes the window size, the y-axis denotes
the standard deviation. If the texture image set is separable, then the small deviation indicates that the local pattern spectrum means highly concentrate on the global pattern spectrum mean of the texture image and the probability of inaccurate classification can be reduced. From Fig. 4, we observe that the local minimum deviation occurs when the window size W equals 29. This is the same as the period of texture image D20. The variation of the local pattern spectrum means is mitigated whenever the size of window W is larger than the period of repetition.
From another point of view, the maximum likeli-hood classifier is based on Bayes theory. Its simplest form is shown in Fig. 5. The shaded area denotes the probability of error for a maximum likelihood classi-fication. We can observe that if the features of the
Fig. 4. Relation between window size W and the pattern spectrum standard deviation of example texture image D20.
samples highly concentrate on the mean of the class, the probability of the error for the maximum likeli-hood classification is small. Hence, if the features of samples concentrate more on the mean of the class, a high accuracy rate can be obtained.
As mentioned in the previous discussion, the vari-ation of the local pattern spectrum means of the features of the samples tend to mitigate whenever the window size is larger than the size of the texture primitive. The texture primitive can be found by
investigating the variation of co-occurrence matrices or covariance. Once texture primitives for a set of texture images are found, the maximum size of the texture primitives is chosen as the window size. This window size will determine the local granulometric size distributions of this set of images. Let
T ,T , . . . ,T1 2 n be a set of texture images. Let
w ,w , . . . ,w and h , h , . . . ,h be periods of texture1 2 n 1 2 n
primitives along the x- and y-axis, respectively. The window size of the local granulometric size
() S.-R. Jan, Y.-C. Hsueh r Pattern Recognition Letters 19 1998 439 – 446 Ž . Ž . Ž . Ž . Ž . . Ž . Ž . Ž . Ž . Ž .
Table 1
Texture primitive of original and thresholded image set Texture image Grey scale Binary
x-axis y-axis x-axis y-axis
d6 14 16 13 16 d17 10 11 10 11 d20 29 28 29 28 d52 13 26 15 25 d53 6 17 6 17 d55 19 8 19 8 d65 5 22 5 22 d77 11 6 11 6 d82 5 8 10 8 d84 10 14 10 5
tion for this set of images is the maximal value of
w ,w , . . . ,w and h , h , . . . ,h , i.e.,1 2 n 1 2 n
4
window_sizesmax w ,w , . . . ,w , h ,h , . . . ,h .1 2 n 1 2 n
It should be noted that the chosen window size is increased by one when it is an even number.
5. Experimental results and discussion
A great deal of data have been tested for the experiment. Ten test images are taken from Brodatz’s
Ž
collection of photographic texture images Brodatz, .
1966 . A MicroTek ScanMarker 600Z scanner oper-ating under Aldus Photostyler is used. The images are scanned at: 75 dpi and 100% scaling into an 8-bit grey digital format. Fig. 6 shows the ten grey scale
Ž .
texture images image set A . For the same reason as
Ž .
in mentioned by Dougherty et al. 1992a , a single threshold value is employed across all ten texture images. The moment preserving threshold method ŽTsai, 1985 is chosen for binarization. The structur-. Ž . ing element sequences we used are vertical v ,
Ž . Ž .
horizontal h , q458 diagonal pd , y458 diagonal Ž .nd , and circular c . The features used are the threeŽ .
Ž .
central moments: the pattern-spectrum mean PSM ,
Ž . Ž .
standard deviation PSSD , and skewness PSS for each structuring element sequence. Two additional features are also used: MAXLIN and LINEARLY. The classifier used in our experiment is the Gaussian maximum likelihood classifier, the same as the one
Ž .
reported by Dougherty et al. 1992a .
The effective window size has to be determined before performing granulometric classification. As mentioned previously, the effective window size can be determined by investigating the variation of co-variance of each texture image. Table 1 shows the size of the texture primitives found in the threshold
Table 2
Relation of window size and accuracy rate in the original and threshold image set
Window size Test image set A Test image set B
Classification Classification Classification Classification
accuracy accuracy accuracy accuracy
Ž . Ž% grey scale. Ž . Ž% binary. Ž . Ž% grey scale. Ž . Ž% binary.
17 96.6 95.4 97.8 93.1 19 97.1 96.1 98.0 95.2 21 97.9 97.5 99.0 96.9 23 98.7 97.6 99.6 97.1 25 98.5 98.2 99.7 97.8 27 99.2 98.2 99.9 98.1 29 99.1 98.1 100 98.1 31 99.5 98.3 100 98.4 33 99.0 98.1 100 98.2 35 99.1 98.4 98.4 37 99.3 98.2 98.4 39 98.9 98.3 98.3 41 99.1 98.5 98.6 43 99.1 98.7 98.8 45 99.4 98.8 98.8 47 99.6 98.9 98.7
images and the images without thresholding. In the threshold image set, the maximum primitive size, 29, is chosen as the window size for granulometric classification. Table 2 presents the relation between window size and accuracy rates of classification. The experimental results reveal that the selected window size yields a high accuracy rate. Table 2 also shows the relation of window sizes and accuracy rates for classification on the same image set without thresh-olding. The results confirm our idea again. The maximum primitive size is 29 as well. The results also indicate that classification with the window size predicted by the proposed method results in a high accuracy rate.
We also apply the proposed method to image set B, which is the same as image set A, except that image D55 is replaced by D102. In image D102, the texture primitive has size 33 and 32 along the x- and
y-axis, respectively. Size 33 is selected as the
win-dow size for granulometric classification with image set B. For the grey scale case, the results are very satisfying, all pixels are classified correctly. The relation between window sizes and accuracy rates is shown in the right portion of Table 2. Observe that the classification accuracy rate is already 100% when the selected window size is 29.
Different test image sets need different window sizes to achieve effective classification. In general, larger windows decrease the variability of the feature at the cost of positional uncertainty. Given an input image set, the proposed method can predict a dow size for granulometric classification. This win-dow size can yield high classification accuracy and it is acceptably small. However, an explicit limitation of the proposed method is that the size of the largest texture primitive cannot be larger than that of the region to be classified. Otherwise, significant errors will occur.
6. Conclusions
We propose a method to determine the window size for local granulometric size distributions. The
co-occurrence matrices and covariance measures are used to predict effective window sizes for granulo-metric classification. The proposed method suggests that one can choose the maximum size of texture primitives in an image set as the window size for local granulometric size distributions. Instead of the overall classification accuracy calculation, the use of the predicted window size can reduce the computa-tion time. Moreover, the proposed method can auto-matically determine the effective window size when inputting a test image set.
References
Brodatz, P., 1966. Textures: A Photographic Album for Artists and Designers. Dover, New York.
Dougherty, E.R., Kraus, E.J., Pelz J.B., 1989. Image segmentation by local morphological granulometries. IGARSS’89, Vancou-ver, pp. 1220–1223.
Dougherty, E.R., Newell, J.T., Pelz, J.B., 1992a. Morphological texture-based maximum-likelihood pixel classification based Ž . on local granulometric moments. Pattern Recognition 25 10 , 1181–1198.
Dougherty, E.R., Pelz, J.B., Sand, F., Lent, A., 1992b. Morpho-logical image segmentation by local granulometric size
distri-Ž . butions. J. Elect. Imaging 1 1 , 46–60.
Dewaele, P., Van Gool, L., Wambacq P., Oosterlinck, A., 1988. Texture inspection with self-adaptive convolution filters. 9th ICPR, Rome, pp. 56–60.
Giardina, C.R., Dougherty E.R., 1988. Morphological Methods in Image and Signal Processing. Prentice-Hall, Englewood Cliffs, NJ.
Haralick, R.M., 1979. Statistical and structural approaches to Ž .
texture. Proc. IEEE 67 5 , 786–804.
Matheron, G., 1975. Random Sets and Integral Geometry. Wiley, New York.
Parkkinen, J., Selkainaho, K., Oja, E., 1990. Detecting texture periodicity from the cooccurrence matrix. Pattern Recognition Letters 11, 43–50.
Serra, J., 1982. Image Analysis and Mathematical Morphology. Academic Press, London.
Starovoitov, V.V., Jeong, S.Y., Park, R.H., 1995. Investigation of texture periodicity extraction. SPIE 2501, 870–881.
Tsai, W.H., 1985. Moment preserving thresholding: a new ap-proach. Computer Vision, Graphics, and Image Processing 29 Ž .3 , 377–393.
Zucker, S.W., Terzopoulos, D., 1980. Finding structure in co-oc-currence matrices for texture analysis. Computer Graphics and Image Processing 12, 286–308.