2006image thresholding using two-dimensional tsallis–havrda–charvet entropy
TRANSCRIPT
www.elsevier.com/locate/patrec
Pattern Recognition Letters 27 (2006) 520–528
Image thresholding using two-dimensionalTsallis–Havrda–Charvat entropy
Prasanna K. Sahoo a,*, Gurdial Arora b
a Department of Mathematics, University of Louisville, Louisville, KY 40292, USAb Department of Mathematics, Xavier University of Louisiana, New Orleans, LA 70125, USA
Received 4 April 2005; received in revised form 29 August 2005Available online 26 October 2005
Communicate by Prof. L. Younes
Abstract
In this paper, we present a thresholding technique based on two-dimensional Tsallis–Havrda–Charvat entropy. The effectiveness ofthe proposed method is demonstrated by using examples from the real-world and synthetic images.� 2005 Elsevier B.V. All rights reserved.
Keywords: Image segmentation; Thresholding; Tsallis–Havrda–Charvat entropy
1. Introduction
Image segmentation is one of the most difficult, dynamicand challenging problems in the image processing domain.Image segmentation denotes a process by which a rawinput image is partitioned into non-overlapping regionssuch that each region is homogeneous and the union oftwo adjacent regions is heterogeneous. In the literature,many techniques have been developed for image segmenta-tion. Thresholding (see Abutaleb, 1989; Brink, 1992;Chang et al., 1995; Esquef et al., 2002; Kapur et al.,1985; Pavesic and Ribaric, 2000; Portes de Albuquerqueet al., 2004; Sahoo et al., 1988, 1997a,b; Sahoo and Arora,2004; Wong and Sahoo, 1989, and references therein) is awell-known technique for image segmentation. Threshold-ing is the operation of converting a multi-level image into abinary image. It involves the basic assumption that theobjects and the background in the digital image have dis-tinct gray level distributions. If this assumption holds, thegray level histogram contains two or more distinct peaks
0167-8655/$ - see front matter � 2005 Elsevier B.V. All rights reserved.
doi:10.1016/j.patrec.2005.09.017
* Corresponding author. Tel.: +1 502 852 2731; fax: +1 502 852 7132.E-mail addresses: [email protected], [email protected]
(P.K. Sahoo), [email protected] (G. Arora).
and threshold values separating them can be obtained. Seg-mentation is performed by assigning regions having graylevels below the threshold to the background, and assign-ing those regions having gray levels above the thresholdto the objects, or vice versa. Threshold selection methodscan be classified into two groups, namely, global methodsand local methods (see Sahoo et al., 1988). A global thres-holding technique thresholds the entire image with a singlethreshold value obtained by using the gray level histogramof the image. Local thresholding methods partition thegiven image into a number of subimages and determine athreshold for each of the subimages. Global thresholdingmethods are easy to implement and are computationallyless involved. They have found many applications in thefield of image processing.
In this paper, we propose an automatic global thres-holding technique based on two-dimensional Tsallis–Havrda–Charvat entropy. This work is based on theentropic thresholding method proposed in our earlier paper(see Sahoo and Arora, 2004). This new method extends amethod due to Pavesic and Ribaric (2000) and Portes deAlbuquerque et al. (2004) (see also Esquef et al., 2002).This method includes a previously proposed well-knownglobal thresholding method due to Abutaleb (1989) and
P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528 521
Brink (1992). This paper is organized as follows: In Section2, we present a brief description of the Tsallis–Havrda–Charvat entropy. In Section 3, we describe the mathe-matical setting of the threshold selection and the newlyproposed thresholding method. In Section 4, we reportthe effectiveness of our thresholding method when appliedto some real-world and synthetic images. In Section 5, wepresent some concluding remarks about our method.
2. Tsallis–Havrda–Charvat entropy
Let
P ¼ ðp1; p2; . . . ; pnÞ 2 Dn;
where
Dn ¼ ðp1;p2; . . . ;pnÞ j pi P 0; i¼ 1;2; . . . ;n;nP 2;Xn
i¼1
pi ¼ 1
( )
is a set of discrete finite n-ary probability distributions.Havrda and Charvat (1967) defined an entropy of degreea as
H anðP Þ ¼
1
1� 21�a 1�Xn
i¼1
pai
" #; ð1Þ
where a is a real positive parameter not equal to one. Inde-pendently Tsallis (1988), proposed a one parameter gener-alization of the Shannon entropy as
H anðP Þ ¼
1
a� 11�
Xn
i¼1
pai
" #; ð2Þ
where a is a real positive parameter and a 5 1. Both theseentropies essentially have the same expression except thenormalizing factor. The Havrda and Charvat entropy isnormalized to 1. That is, if P = (0.5,0.5), then H a
2ðP Þ ¼ 1where as the Tsallis entropy is not normalized. For ourapplication both the entropies yield the same result andwe called these entropies as the Tsallis–Havrda–Charvatentropy. However, we use (2) as the Tsallis–Havrda–Charvat entropy. Since lima!1H a
nðP Þ ¼ H 1nðPÞ, the Tsallis–
Havrda–Charvat entropy H anðP Þ is a one parameter
generalization of the Shannon entropy H 1nðP Þ, where
H 1nðP Þ ¼ �
Xn
i¼1
pi ln pi. ð3Þ
When a = 2, the Tsallis–Havrda–Charvat entropy becomesthe Gini–Simpson index of diversity,
H 2nðP Þ ¼ 1�
Xn
i¼1
p2i
" #. ð4Þ
The Tsallis–Havrda–Charvat entropy was studied as theentropy of degree a for the first time by Havrda and Char-vat (1967) and then by Daroczy (1970). This entropy be-came often used in statistical physics after the seminalwork of Tsallis (1988).
3. The proposed method
Let f(m,n) be the gray value of the pixel located at thepoint (m,n). A digital image of size M · N is a matrix ofthe form
f ðm; nÞjm ¼ 1; 2; . . . ;M and n ¼ 1; 2; . . . ;N½ �or in short form [f(m,n)].
Let G denote the set of all gray values {0,1,2, . . . , 2‘ � 1}. Usually ‘ is either 8 or 16. In our test im-ages, ‘ is 8. Hence for our test images, the set G ={0,1,2, . . . , 255}. In the next three subsections, we discuss(1) how to construct the two-dimensional histogram, (2)how to compute the probability distributions of objectand background classes, and (3) the choice of the entropiccriterion function.
3.1. Two-dimensional histogram
In order to compute the two-dimensional histogram of agiven image we proceed as follows. Calculate the averagegray value of the neighborhood of each pixel. Let g(x,y)be the average of the neighborhood of the pixel locatedat the point (x,y). The average gray value for the 3 · 3neighborhood of each pixel is calculated as
gðx; yÞ ¼ 1
9
X1
i¼�1
X1
j¼�1
f ðxþ i; y þ jÞ$ %
; ð5Þ
where brc denotes the integer part of the number r. Whilecomputing the average gray value, disregard the two rowsfrom the top and bottom and two columns from the sides.The pixel�s gray value, f(x,y), and the average of its neigh-borhood, g(x,y), are used to construct a two-dimensionalhistogram using
hðm; nÞ ¼ Probðf ðx; yÞ ¼ m and gðx; yÞ ¼ nÞ; ð6Þwhere m,n 2 G. For a given image, there are several meth-ods to estimate this density function. One of the most fre-quently used methods is the method of relative frequency.The normalized histogram is approximated by using theformula
hðm;nÞ ¼ number of elements in the event ðf ðx; yÞ ¼ mÞ and ðgðx; yÞ ¼ nÞnumber of elements in the sample space
¼ number of pixels with gray value m and average gray value nnumber of pixels in the image
.
The joint probability mass function, p(m,n) is given by
pðm; nÞ ¼ hðm; nÞ; ð7Þwhere m,n = 0,1, . . . , 255.
3.2. Computation of the object and background
probabilities
The threshold is obtained through a vector (t, s) where t,for f(x,y), represents the threshold of the gray level ofthe pixel and s, for g(x,y), represents the threshold of the
522 P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528
average gray level of the pixel�s neighborhood. Using thejoint probability mass function p(m,n), a surface can bedrawn that will have two peaks and one valley. The objectand background correspond to the peaks and can be sepa-rated by selecting the vector (t, s) that maximizes a suitablecriterion function Ua(t, s). Using this vector (t, s), thedomain of the histogram is divided into four quadrants(see Fig. 1).
We denote the first quadrant by [t + 1,255] · [0, s], thesecond quadrant by [0, t] · [0, s], the third quadrant by[0, t] · [s + 1,255], and the fourth quadrant by[t + 1,255] · [s + 1,255]. Since two of the quadrants, firstand third, contain information about edges and noisealone, they are ignored in the calculation. Because thequadrants which contain the object and the background,second and fourth, are considered to be independentdistributions, the probability values in each case must benormalized in order for each of the quadrants to havea total probability equal to 1. Our normalization is accom-plished by using a posteriori class probabilities, P2(t, s) andP4(t, s), where
P 2ðt; sÞ ¼Xt
i¼0
Xs
j¼0
pði; jÞ and P 4ðt; sÞ ¼X255i¼tþ1
X255j¼sþ1
pði; jÞ.
ð8ÞWe assume that the contribution of the quadrants whichcontains the edges and noise is negligible, hence we approx-imate P4(t, s) as P4(t, s) � 1 � P2(t, s).
Thresholding an image at a threshold t is equivalentto partitioning the set G into two disjoint subsets:
G0 ¼ f0; 1; 2; . . . ; tg and G1 ¼ ft þ 1; t þ 2; . . . ; 255g.
The two probability distribution associated with these setsare:
pð0; 0ÞP 2ðt; sÞ
; . . . ;pð0; sÞP 2ðt; sÞ
;pð1; 0ÞP 2ðt; sÞ
; . . . ;pðt; sÞP 2ðt; sÞ
� �
and
pðtþ 1; sþ 1ÞP 4ðt; sÞ
; . . . ;pðtþ 1;255Þ
P 4ðt; sÞ;pðtþ 2; sþ 1Þ
P 4ðt; sÞ; . . . ;
pð255;255ÞP 4ðt; sÞ
� �;
Fig. 1. Quadrants in the 2D histogram due to thresholding at (t, s).
respectively. Based on our previous discussion we haveapproximated P4(t, s) as 1 � P2(t, s), that is P4(t, s) �1 � P2(t, s).
3.3. Entropic criterion function
Thus the Tsallis–Havrda–Charvat entropies associatedwith object and background distributions are given by
H abðt; sÞ ¼
1
a� 11�
Xt
i¼0
Xs
j¼0
pði;jÞP 2ðt; sÞ
� �a" #
ð9Þ
and
H awðt; sÞ ¼
1
a� 11�
X255i¼tþ1
X255j¼sþ1
pði;jÞ1� P 2ðt; sÞ
� �a" #
. ð10Þ
The a priori Tsallis–Havrda–Charvat entropy of an imageis given by
H aT ¼ 1
a� 11�
X255i¼0
X255j¼0
pði; jÞa" #
; ð11Þ
where a (51) is a positive real parameter.If we consider that a physical system can be decomposed
into two statistical independent subsystems A and B, theprobability of the composite system is pA+B = pApB, thenthe Tsallis–Havrda–Charvat entropy of the system followsthe non-additivity rule
H aT ðAþ BÞ ¼ H a
T ðAÞ þ H aT ðBÞ þ ð1� aÞH a
T ðAÞH aT ðBÞ. ð12Þ
Thus, in this paper we use
Uaðt; sÞ ¼ H abðt; sÞ þ H a
wðt; sÞ þ ð1� aÞH abðt; sÞH a
wðt; sÞ;ð13Þ
as a criterion function. We obtain our optimal thresholdpair (t*(a), s*(a)) by maximizing the above criterion func-tion Ua(t, s). Thus
ðt�ðaÞ; s�ðaÞÞ ¼ Arg maxðt;sÞ2G�G
Uaðt; sÞ. ð14Þ
4. Analysis of test results
In this section, we discuss the experimental resultsobtained using the proposed method. This discussionincludes the choice of the optimal threshold and the presen-tation of the optimal threshold values of some real-worldand synthetic images. These images are cameraman.tif,kids.tif, rice.tif, tire.tif, bonemarr.tif, boats.tif, bridge.tif,columbia.tif, face.tif, and lena.tif and they are shown inFigs. 2–11. The optimal threshold value was computedby the proposed method for these 10 images. Table 1 liststhe optimal threshold values that are found for theseimages for a values equal to 0.3, 0.5, 0.7, 0.8, and 1.0,respectively.
Fig. 2. Cameraman image, its gray level histogram and the thresholded images.
Fig. 3. Kids image, its gray level histogram and the thresholded images.
P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528 523
Fig. 4. Rice image, its gray level histogram and the thresholded images.
Fig. 5. Tire image, its gray level histogram and the thresholded images.
524 P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528
Fig. 6. Bonemarr image, its gray level histogram and the thresholded images.
Fig. 7. Boats image, its gray level histogram and the thresholded images.
P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528 525
Fig. 8. Bridge image, its gray level histogram and the thresholded images.
Fig. 9. Columbia image, its gray level histogram and the thresholded images.
526 P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528
Fig. 10. Face image, its gray level histogram and the thresholded images.
Fig. 11. Lena image, its gray level histogram and the thresholded images.
P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528 527
Table 1The optimal threshold values for various values of a
Test image tw(0.3) tw(0.5) tw(0.7) tw(0.8) tw(1.0)
camaraman.tif 99 99 99 95 119kids.tif 32 32 32 29 11rice.tif 182 182 182 182 178tire.tif 111 111 93 93 55bonemarr.tif 122 121 121 121 216boats.tif 102 103 103 103 158bridge.tif 125 130 125 113 154columbia.tif 122 120 120 103 160face.tif 104 104 104 95 204lena.tif 112 112 106 80 38
528 P.K. Sahoo, G. Arora / Pattern Recognition Letters 27 (2006) 520–528
Using the original test image [f(m,n)], the thresholdedimage [ft(m,n)] was computed using formula
ftðm; nÞ ¼0 if f ðm; nÞ 6 tHðaÞ;1 if f ðm; nÞ > tHðaÞ.
�
The original images together with their histograms and thethresholded images obtained by using the optimal thres-hold value tw(0.8) and tw(1.0) are displayed side by sidein Figs. 2–11. Note that the thresholded image obtainedby threshold value tw(1.0) is same as the one obtained byAbutaleb�s method (see Abutaleb, 1989).
4.1. The best value for the parameter a
Our analysis is based on how much information is lostdue to thresholding. In this analysis, given two thresholdedimages of a same original image, we prefer the one whichlost the least amount of information. Using the above tenimages and also many other images, we conclude that whena is 0.8 our proposed method produced the best optimalthreshold values. When a was greater than 1, this proposedmethod did not produce good threshold values. In fact thethreshold values produced were unacceptable. When thevalue of a was one, the threshold value produced was notalways a good threshold value (see Figs. 2–11). This newmethod performs better than Abutaleb�s method whena = 0.8.
4.2. The window size for computing g(x,y)
In this method of thresholding, we have used in additionto the original gray level function f(x,y), a function g(x,y)that is the average gray level value in a 3 · 3 neighborhoodaround the pixel (x,y). This approach can be extended toan image pyramid, where an image on the next higher levelis composed of average gray level values computed for dis-joint 3 · 3 squares. In order to find out which pyramid levelwill produce an optimal threshold value, we have tested allthe test images with different neighborhood sizes and differ-ent a values. In particular, we have considered neighbor-hood sizes of 2 · 2, 3 · 3, 4 · 4, 5 · 5, 8 · 8 and 16 · 16,
respectively. Neighborhood sizes of 3 · 3, 4 · 4, 5 · 5 and8 · 8 all produced similar optimal threshold values givingacceptable binary images. From the point of view of com-putational time and image quality, a neighborhood size of3 · 3 or 5 · 5 with a value equals 0.8 would be ideal forthresholding with this proposed method.
5. Conclusion
Using Tsallis–Havrda–Charvat�s entropy of degree a, wehave developed a new method for thresholding of images.This method usages a two-dimensional histogram com-puted from the image. The two-dimensional histogramwas constructed using the gray value and local averagegray value to choose an optimal threshold value.
Acknowledgements
The work was supported by the Missile Defense Agencyof USA under Cooperative Agreement HQ0006-02-2-0002,and by an IRI Grant from the Office of the Vice Presidentfor Research, University of Louisville.
References
Abutaleb, A.S., 1989. Automatic thresholding of grey-level pictures usingtwo-dimensional entropies. Pattern Recognition 47, 22–32.
Brink, A.D., 1992. Thresholding of digital images using two-dimensionalentropies. Pattern Recognition 25, 803–808.
Chang, F.J., Yen, J.C., et al., 1995. A new criterion for automaticmultilevel thresholding. IEEE Trans. Image Process. 4, 370–378.
Daroczy, Z., 1970. Generalized information functions. Inform. Control16, 36–51.
Esquef, I., Albuquerque, M., et al., 2002. Nonextensive entropic imagethresholding. In: Proc. XV Brazilian Symp. on Computer Graphicsand Image Processing. IEEE Computer Society.
Havrda, J., Charvat, F., 1967. Quantification methods of classificationprocesses: Concept of structural a-entropy. Kybernetica (Prague) 3,95–100.
Kapur, J.N., Sahoo, P.K., et al., 1985. A new method for gray levelpicture thresholding using the entropy of the histogram. Comput.Vision Graphics Image Process. 29, 273–285.
Pavesic, P., Ribaric, S., 2000. Gray level thresholding using the Havrdaand Charvat entropy. In: 10th Mediterranean Electrotechnical Conf.,MEleCon2000. IEEE, pp. 631–634.
Portes de Albuquerque, M., Esquef, I.A., et al., 2004. Image thresholdingusing Tsallis entropy. Pattern Recognition Lett. 25, 1059–1065.
Sahoo, P.K., Arora, G., 2004. A thresholding method based on two-dimensional Renyi�s entropy. Pattern Recognition 37, 1149–1161.
Sahoo, P.K., Soltani, S., et al., 1988. A survey of the thresholdingtechniques. Comput. Vision Graphics Image Process. 41, 233–260.
Sahoo, P.K., Slaaf, D.W., et al., 1997a. Threshold selection using aminimal histogram entropy difference. Opt. Eng. 36, 1976–1981.
Sahoo, P.K., Wilkins, C., et al., 1997b. Threshold selection using Renyi�sentropy. Pattern Recognition 30, 71–84.
Tsallis, C., 1988. Possible generalization of Boltzmann–Gibbs statistics.J. Stat. Phys. 52, 480–487.
Wong, A.K.C., Sahoo, P.K., 1989. A gray-level threshold selectionmethod based on maximum entropy principle. IEEE Trans. SystemsMan Cybernet. 19, 866–871.