6
Pattern Recognition, Vol. 25, No. 8, pp. 803-808, 1992 Printed in Great Britain 0031-3203/92 $5.00 + .00 Pergamon Press Ltd 1992 Pattern Recognition Society THRESHOLDING OF DIGITAL IMAGES USING TWO- DIMENSIONAL ENTROPIES A. D. BRINK Department of Computational and Applied Mathematics, University of the Witwatersrand, Johannesburg 2050, South Africa (Received 18 April 1991; in revised form 30 September 1991; receivedfor publication 1l December 1991) Abstraet--Thresholding is an important form of image segmentation and is a first step in the processing of images for many applications. The selection of suitable thresholds is ideally an automatic process, requiring the use of some criterion on which to base the selection. One such criterion is the maximization of the information theoretic entropy of the resulting background and object probability distributions. Most processes using this concept have made use of the one-dimensional (1D) grey-level histogram of the image. In an effort to use more of the information available in the image, the present approach evaluates two-dimensional (2D) entropies based on the 2D (grey-level/local average grey-level) "his- togram" or scatterplot. The 2D threshold vector that maximizes both background and object class entropies is selected. Thresholding Entropy Segmentation 1. INTRODUCTION Thresholding is an important form of image seg- mentation where one wishes to identify and extract object regions from their background on the basis of differing brightness or grey levels. Many methods for the automatic selection of thresholds have been proposed.C1,2) Most of these methods base their selec- tion on the optimization of some threshold-depen- dent criterion function which is somehow related to the image and its properties. One useful function is the entropy measure from information theory. Generally the methods making use of this function have followed a one-dimensional (1D) approach based on the entropy of the image (o,ol grey-level histogram. The aim is to separate the a priori probability distribution (histogram) into two independent class distributions by means of a threshold which is selected in such a way that the entropies of both distributions, and hence their infor- mation content, are maximized. The method of Kapur et al. (3) is typical of this approach. By using only the grey-level histogram much infor- mation contained in the image is lost which, if used, 5" could result in a much better segmentation. Two- dimensional (2D) entropic techniques using local neighbourhood as well as point pixel information have been proposed for this reason. Abutaleb (a) makes use of the 2D (grey-level/local average grey- level) "histogram" or scatterpiot. Pal and Pal (5) have used a grey-level co-occurrence matrix. It should be j noted that while the latter method still selects a single-valued (essentially 1D) threshold, use of the 2D histogram results in a 2D threshold vector, a point coordinate in 2D (grey-level/local average) space. In the proposed technique use is again .made of the 2D histogram. The 2D entropies of the distributions resulting from each threshold pair are evaluated and the image is thresholded at the point which most nearly maximizes both the background and the ob- ject class entropies, using a "maximin" optimization procedure. In Section 2 the 2D entropies are defined. In Section 3 the method proposed by Abutaleb (4) is outlined and the new technique is described. Section 7" / (n-I, n-I) Fig. 1. Quadrants in the 2D histogram resulting from thresholding at (T, S). 803

1992Thresholding of Digital Images Using Two-dimensional Entropies

Embed Size (px)

Citation preview

Page 1: 1992Thresholding of Digital Images Using Two-dimensional Entropies

Pattern Recognition, Vol. 25, No. 8, pp. 803-808, 1992 Printed in Great Britain

0031-3203/92 $5.00 + .00 Pergamon Press Ltd

1992 Pattern Recognition Society

THRESHOLDING OF DIGITAL IMAGES USING TWO- DIMENSIONAL ENTROPIES

A. D. BRINK Department of Computational and Applied Mathematics, University of the Witwatersrand,

Johannesburg 2050, South Africa

(Received 18 April 1991; in revised form 30 September 1991; received for publication 1 l December 1991)

Abstraet--Thresholding is an important form of image segmentation and is a first step in the processing of images for many applications. The selection of suitable thresholds is ideally an automatic process, requiring the use of some criterion on which to base the selection. One such criterion is the maximization of the information theoretic entropy of the resulting background and object probability distributions. Most processes using this concept have made use of the one-dimensional (1D) grey-level histogram of the image. In an effort to use more of the information available in the image, the present approach evaluates two-dimensional (2D) entropies based on the 2D (grey-level/local average grey-level) "his- togram" or scatterplot. The 2D threshold vector that maximizes both background and object class entropies is selected.

Thresholding Entropy Segmentation

1. I N T R O D U C T I O N

Thresholding is an important form of image seg- mentation where one wishes to identify and extract object regions from their background on the basis of differing brightness or grey levels. Many methods for the automatic selection of thresholds have been proposed.C1,2) Most of these methods base their selec- tion on the optimization of some threshold-depen- dent criterion function which is somehow related to the image and its properties.

One useful function is the entropy measure from information theory. Generally the methods making use of this function have followed a one-dimensional (1D) approach based on the entropy of the image (o,ol grey-level histogram. The aim is to separate the a priori probability distribution (histogram) into two independent class distributions by means of a threshold which is selected in such a way that the entropies of both distributions, and hence their infor- mation content, are maximized. The method of Kapur et al. (3) is typical of this approach.

By using only the grey-level histogram much infor- mation contained in the image is lost which, if used, 5" could result in a much better segmentation. Two- dimensional (2D) entropic techniques using local neighbourhood as well as point pixel information have been proposed for this reason. Abutaleb (a) makes use of the 2D (grey-level/local average grey- level) "histogram" or scatterpiot. Pal and Pal (5) have used a grey-level co-occurrence matrix. It should be j noted that while the latter method still selects a single-valued (essentially 1D) threshold, use of the 2D histogram results in a 2D threshold vector, a

point coordinate in 2D (grey-level/local average) space.

In the proposed technique use is again .made of the 2D histogram. The 2D entropies of the distributions resulting from each threshold pair are evaluated and the image is thresholded at the point which most nearly maximizes both the background and the ob- ject class entropies, using a "maximin" optimization procedure.

In Section 2 the 2D entropies are defined. In Section 3 the method proposed by Abutaleb (4) is outlined and the new technique is described. Section

7" /

( n - I , n - I )

Fig. 1. Quadrants in the 2D histogram resulting from thresholding at (T, S).

803

Page 2: 1992Thresholding of Digital Images Using Two-dimensional Entropies

804 A.D. BRINK

4 contains representative results, discussion and con- clusions.

2. TWO-DIMENSIONAL ENTROPIES

Each bin of the 2D histogram is related to the frequency of occurrence of each (grey-level, local average) pair. These bins form a surface with ideally two peaks corresponding to background and object regions. The bulk of the histogram, including the peaks, lies on or near the leading diagonal of the scatterplot, off-diagonal bins being contributed by edges and noise in the image. For an n grey-level image there are obviously n 2 bins.

The a priori probability pq of a pair (i, j) is given by the total number of occurrences of the pair, Aj, divided by the total number of pixels, N M (for an image of size N x M)

Pij = f i j /NM, i and j = 0 . . . . . n - 1. (1)

The total entropy for the 2D histogram is given by n - l n - 1

Ht = - ~ ~ , Pij logpq. (2) j = 0 i=0

By means of two thresholds S and T the histogram is divided into four quadrants (Fig. 1).

Since the shaded quadrants of Fig. 1 will in general contain information only about edges and noise they

(a)

(b) (c)

Fig. 2. (a) Clean video image of a dog, (b) result of thresholding with H0 + H1, (c) result of thresholding using maximin.

Page 3: 1992Thresholding of Digital Images Using Two-dimensional Entropies

Thresholding of digital images 805

are ignored in the calculation. The quadrants 0 and 1 contain the distributions corresponding to the back- ground and object classes. As they are to be regarded as independent distributions, the probability values in each class must be normalized using the a pos- teriori class probabilities

$ T

P0(T, S) = ~ ~ Pij (3) j=0i~0

n - 1 n - I

P~(T, S) = ~ ~, Pii (4) j = S + l i = T + I

in order that each has unit total probability. The

class entropies are thus defined as s T

H o ( T , S ) = _Xf, xf, Pij , Pij j---'0 i70 P0(T, S) log P 0 - - ~ , S) (5)

n - l n - 1 ~, Pij , Pij

n0(T, s ) = -s+~ ~" W~ P~(T, s ) , o g ~ ) . (6)

It should be noted that Abutaleb(*) approximates PI(T, S) as

PI(T, S) = 1 - t0(T, S) (7)

based on the assumption that in general the con- tribution from the shaded quadrants is negligible.

(a)

(b) (c)

Fig. 3. (a) Infra-red image of a road, (b) result of thresholding with H0 + Hi, (c) result of thresholding using maximin.

Page 4: 1992Thresholding of Digital Images Using Two-dimensional Entropies

806 A . D . BRINK

While this is true for thresholds lying on or near the diagonal, the assumption is not valid for thresholds far off the diagonal.

3. THRESHOLDING METHODS

3.1. Maximization of total entropy

Abutaleb, t4J following the technique of Kapur et al.,(3) defines an entropic criterion function

~p(T,S) = Ho(T,S) + HI(T,S) (8)

where Ho(T, S) and HI(T, S) are given by equations (5) and (6). This method has been tested using both Abutaleb's approximation (7) for PI(T, S) and the

correct formula (4). The results obtained generally differ significantly, with equation (4) yielding the better result although the computational time is slightly longer.

3.2. Maximization of class entropies

The present method attempts by means of a single threshold vector to maximize both Ho(T, S) and HI(T, S). It is clear that, unless their maxima happen to coincide, such a selection involves a trade-off. When dealing with two functions in this way, the maximin procedure from optimization theory can be used. In this case the process involves finding a

(a)

(b) (c)

Fig. 4. (a) Aerial photograph of farmland, (b) result of thresholding with H0 + HI, (c) result of thresholding using maximin.

Page 5: 1992Thresholding of Digital Images Using Two-dimensional Entropies

Thresholding of digital images 807

threshold vector (3, o) which maximizes the smaller value of Ho(T, S) and Hi(T, S), that is

H(~,o)= max / min {Ho(T,S),HI(T,S)}" L T = O . . . n - l [ T = O . . . n - I I S ~ O . . . n - l k S = O . . . n - 1

(9)

This threshold vector is selected to perform the seg- mentation.

4. R E S U L T S

Some representative results appear in Figs 2-5, together with the corresponding results for the stand- ard method outlined in Section 3.1 above for corn-

parison. The black and white regions in these results correspond to the quadrants 0 and 1 in Fig. 1, while the grey areas are due to the unclassified pixels in the off-diagonal quadrants.

5. D I S C U S S I O N

Based on a subjective evaluation of the "recog- nizability" of the resulting binary images, the new approach using the maximin of the class entropies performs better on most of the images tested. How- ever, it should be pointed out that no single method can produce results universally acceptable for all applications or image types and hence for some

~ ~ ? 5 • i

(a)

(b) (c)

Fig. 5. (a) Low contrast video image of part of a printed page, (b) result of thresholding with H0 + H1, (c) result of thresholding using maximin.

Page 6: 1992Thresholding of Digital Images Using Two-dimensional Entropies

808 A . D . BRINK

processes the maximized sum of the entropies may yield a more useful result, as in the infra-red image of Fig. 3, for example.

The remaining unclassified pixels can be assigned to 0 or 1 in several ways. Usually these are simply assigned using the grey-level threshold T only. A more elaborate scheme could be used whereby each of the unclassified quadrants is also thresholded using this technique. This process is repeated until no unclassified pixels remain.

The technique could be extended to multi- thresholding by regarding each of the two classes produced by binary thresholding as an independent distribution. These can each be binarized using the same approach, resulting in a four-class image. The splitting can be continued as far as desired, although information is lost in the unused quadrants at each stage. However, these quadrants can be used and regarded as classes in their own right ("light edge" and "dark edge", for example).

6. S U M M A R Y

An entropic threshold selection technique using the 2D (grey-level/local average grey-level) scat- terplot is described.

A threshold vector (T, S) divides the scatterplot into four quadrants, two of which contain mainly edge and noise information. The other two quadrants 0 and 1, correspond to the classes "background" and "object". The 2D entropies of these classes are given by

S T

Ho(T,S) =-____~. ~, ~ . Pii i=0 i=0 Po(T, S) log ~ S)

n - 1 n - I

s~ + Pi/ pq ~" PI(T,S-----~I°gp1(T,S)

HI(T,S) = -j= 1 I = T + I

where Po(T, S) and PI(T, S) are the a posteriori class probabilities.

A threshold (r, a) is selected such that these class entropies are maximized. This involves finding the maximin of the entropies by iteration:

/-t(r, o)

= max / min {H0(T,S),HI(T,S)}~. T = O . . . n - 1 ~ T = 0 , , , n - 1 1 S = 0 . . . n - 1 \ S = O . . . n - 1

Subjectively the results obtained are encouraging. As this is a global technique, problems such as uneven illumination can result in less than optimum segmentation. However, the use of a 2D scatterplot does lead to better results than those obtainable using only the histogram.

R E F E R E N C E S

1. R. M. Haralick and L. G. Shapiro, Image segmentation techniques, Comput. Vision Graphics Image Process. 29, 100-132 (1985).

2. P. K. Sahoo, S. Soltani, A. K. C. Wong and Y. Chen, A survey of thresholding techniques, Comput. Vision Graphics Image Process. 41,233-260 (1988).

3. J. N. Kapur, P. K. Sahoo and A. K. C. Wong, A new method for grey-level picture thresholding using the entropy of the histogram, Comput. Vision Graphics Image Process. 29, 273-285 (1985).

4. A. S. Abutaleb, Automatic thresholding of grey-level pictures using two-dimensional entropy, Comput. Vision Graphics Image Process. 47, 22-32 (1989).

5. N. R. Pal and S. K. Pal, Entropic thresholding, Signal Process. 16, 97-108 (1989).

About the AUthOr---ANTON BRINK received B.Sc. and Honours degrees in physics and electronics and an M.Sc. degree in image processing from Rhodes University in 1983, 1984 and 1986, respectively. He is currently employed as a Junior Lecturer in the Department of Computational and Applied Mathematics at the University of the Witwatersrand while studying for a Ph.D. degree in image segmentation.