Pattern Recognition 38 (2005) 1289 – 1294 www.elsevier.com/locate/patcog
Recursive algorithm based on fuzzy 2-partition entropy for 2-level image thresholding Souad Benabdelkader∗ , Mohammed Boulemden Department of Electronics, University of Batna, Rue Chahid Boukhlouf Med El-Hadi, Batna 05000, Algeria Received 14 August 2003; accepted 24 March 2004
Abstract The fuzzy c-partition entropy approach for threshold selection behaves well in segmenting images. But the size of search space increases very rapidly when the number of parameters needed to determine the membership function increases. The computation complexity of the fuzzy 2-partition entropy approach is bounded by O(L3 ). In this paper, a recursive scheme which decreases the computation complexity of the basic algorithm to O(L2 ) is proposed. The approach does not need the calculation of the membership function. The processing time of each image is reduced from more than 5 min to less than 20 s. 䉷 2005 Pattern Recognition Society. Published by Elsevier Ltd. All rights reserved. Keywords: Segmentation; Thresholding; Entropy; Fuzzy logic; c-Partition
1. Introduction Thresholding, for the purpose of image segmentation, is essentially a classification problem, where one wishes to identify and extract object regions from their background, on the basis on the similarity of brightness of image objects. Many methods for the automatic selection of thresholds and a number of reports on the design of variations of existing ones have been proposed [1–3]. Most of the proposed methods base the selection of suitable thresholds on the optimization of some criterion function which is related to the image and its properties. The fuzzy set theory has been successfully applied in several areas such as image processing, pattern recognition, computer vision, medicine, etc. With respect to automatic threshold selection and segmentation, the concept of fuzzy partition leads to a powerful and effective scheme [4–6].
Although the fuzzy c-partition entropy approach for image thresholding results in much better segmentation than many existing methods, it gives rise to the increment of the size of search space when the number of parameters needed to determine the membership function increases and therefore the increment of computation time and storage space. For an image having L gray levels, and a membership function determined by two parameters, the size of search space is L(L − 1)/2. For example, if L equals 256, the search space will be 32 640. In this paper, a fuzzy 2-partition entropy approach is considered. The computation complexity of this method is bounded by O(L3 ), then we introduce a recursive algorithm which reduces the computation complexity to O(L2 ) and avoids the calculation of the membership function.
2. Fuzzy 2-partition entropy 2-level thresholding ∗ Corresponding author. Tel.: +213 31 96 11 33;
fax: +213 31 96 20 05. E-mail address:
[email protected] (S. Benabdelkader).
In the fuzzy 2-partition entropy approach proposed in Ref. [4], an image is modeled by two fuzzy sets dark and bright,
0031-3203/$30.00 䉷 2005 Pattern Recognition Society. Published by Elsevier Ltd. All rights reserved. doi:10.1016/j.patcog.2004.03.018
1290
S. Benabdelkader, M. Boulemden / Pattern Recognition 38 (2005) 1289 – 1294
3. Recursive fuzzy 2-partition entropy 2-level thresholding
whose membership functions are defined as
d =
b =
1, x−c a−c 0, 0, x−a c−a 1,
x a, , a ≺ x ≺ c,
(1)
x c, x a, , a ≺ x ≺ c,
(2)
x c,
where x is the independent variable and a and c are parameters determining the shape of the above two membership functions. We assume that the images have 256 gray levels ranging from 0 to 255. Then, an exhaustive search is used to find the pair aopt et copt which forms a fuzzy 2-partition that has the maximum entropy as follows: For a = 0 to 254 For c = (a + 1) to 255 1. For given a and c, new membership functions d (i) and b (i) are computed, for i = 0, . . . , 255. 2. Probabilities of the two fuzzy events dark and bright are defined as P (dark) =
255 i=0
P (bright) =
d (i)P (i),
255 i=0
(3)
b (i)P (i),
In the basic fuzzy 2-partition entropy thresholding method, for each pair of (a, c), d (i) and b (i), P (dark) and P(bright) are calculated from (0, 1) to (254, 255). It takes too much repetitive calculation to obtain these quantities. According to Eq. (1), the formula for calculating d (i) can be rewritten: d (i) = 1 − b (i), the probability of the dark fuzzy set is thus defined as P (dark) = 1 − P (bright),
H = − log(1 − P (bright)) 1 − P (bright) + P (bright) · log . P (bright)
H (T ) = max
H (t)
t=0,...,255
,
(aopt + copt ) 2
/* End For c */ /* End For a */
P (g) · 0 c−1
+
g=a+1
b (g) · P (g) +
255 g=c
P (g),
(11)
which reduces to
P (bright) =
c−1 g=a+1
255 g−a · P (g) + P (g). c−a g=c
(12)
(6) The recursive algorithm is implemented as follows:
where T =
a g=0
where P(i) is the probability of the occurrence of the gray level i = 0, . . . , 255. 3. The entropy of this fuzzy 2-partition is given by:
4. The selected threshold value Topt which is the midpoint of aopt and copt has to satisfy the following criterion function:
(10)
In the method we propose, only the probability of the bright fuzzy set will be computed recursively and then used to compute the entire entropy of the fuzzy 2-partition according to Eq. (10). There is no need to compute the membership function for any fuzzy set. According to Eqs. (2) and (4), the probability of the bright fuzzy set can be subdivided into three quantities, for given a and c:
(4)
(5)
(9)
and the entropy of the fuzzy 2-partition can be obtained as
P (bright) =
H = − P (dark) · log(P (dark)) − P (bright) · log(P (bright)).
(8)
(7)
For a = 0 to 254 For c = (a + 1) to 255 1. Compute the probability vector Pc such that Pc =
255 g=c
p(g),
c = 1, . . . , 255
(13)
S. Benabdelkader, M. Boulemden / Pattern Recognition 38 (2005) 1289 – 1294
1291
Table 1 Processing times, parameters (a, c) and optimal thresholds Image
BF2-PET: t (s)
RF2-PET: t (s)
(a, c)
T
1 2 3
336.87 504.22 501.26
16.76 10.73 18.63
(69, 193) (133, 153) (1, 11)
131 143 6
Fig. 1. The original image with size 352 × 464 is shown in (a), its histogram is shown in (b) and the segmentation result of the original image is shown in (c) with parameters (a, c) = (69, 193). The threshold value is 131.
and recursively: Pc = Pc−1 − p(c − 1);
c = 2, . . . , 255.
(14)
2. Compute the probability matrix Pa,c such that c−1
Pa,c = (g − a)P (g) (a = 0, . . . , 254); g=a+1
(c = a + 2, . . . , 255)
(15)
3. Compute the total probability matrix P(bright) such that 1 Pb (a, c)=Pc−1 + (Pa,c−1 −p(c−1)). (17) c−a 4. Compute the entropy of the fuzzy 2-partition according to Eq. (10). The selected threshold T is the value that satisfies (6) and (7). /* End For c*/ /* End For a*/
Pa,a+1 = 0 4. Experimental results
and recursively Pa,c = Pa,c−1 + (c − a − 1) · p(c − 1).
(16)
The proposed recursive algorithm for a fuzzy 2-partition thresholding has been tested on many images with
1292
S. Benabdelkader, M. Boulemden / Pattern Recognition 38 (2005) 1289 – 1294
Fig. 2. The original image with size 256 × 256 is shown in (a), its histogram is shown in (b) and the segmentation result of the original image are shown in (c) with parameters (a, c) = (133, 153). The threshold value is 143.
various histogram distributions. Each image is presented by eight bits, that is, gray levels are ranging from 0 (the darkest) to 255 (the brightest). As far as segmentation
results are concerned the basic method and the recursive one are the same. Table 1 shows the results of thresholds and processing time of the basic fuzzy 2-partition entropy
S. Benabdelkader, M. Boulemden / Pattern Recognition 38 (2005) 1289 – 1294
1293
Fig. 3. The original image with size 537 × 358 is shown in (a), its histogram is shown in (b) and the segmentation result of the original image is shown in (c) with parameters (a, c) = (1, 11). The threshold value is 6.
1294
S. Benabdelkader, M. Boulemden / Pattern Recognition 38 (2005) 1289 – 1294
method (BF2-PET) and the recursive proposed algorithm (RF2-PET) (Figs. 1–3).
5. Conclusion In this paper, a fast recursive algorithm for 2-level entropy thresholding with the concept of fuzzy 2-partition has been proposed. As far as segmentation results are concerned these methods are the same, but the computation complexity and the memory space required by the algorithm are greatly reduced. Indeed, the proposed recursive algorithm decreases the computation complexity of the basic algorithm which is bounded by O(L3 ) to O(L2 ). The processing time of each image is reduced from more than 5 min to less than 20 s.
we introduce a recursive algorithm which reduces the computation complexity to O(L2 ). Indeed, in the basic method, for each pair of parameters (a, c) determining the shape of the membership functions, probabilities of the bright and dark events and their corresponding membership functions are calculated from (0, 1) to (254, 255). It takes too much repetitive calculation to obtain these quantities. In the method we propose, only the probability of the bright fuzzy set will be computed recursively and then used to compute the entire entropy of the fuzzy 2-partition. There is no need to compute the membership function for any fuzzy set. As far as segmentation is concerned the two methods are the same, but our algorithm attempts to reduce the computation time from more than five minutes to less than twenty seconds.
6. Summary
References
Thresholding, for the purpose of image segmentation, is essentially a classification problem, where one wishes to identify and extract object regions from their background, on the basis of the similarity of brightness of image objects. With respect to automatic threshold selection and segmentation, the concept of fuzzy partition leads to a powerful and effective scheme. Although the Cheng algorithm based on the maximisation of the fuzzy c-partition entropy for image thresholding results in much better segmentation than many existing methods, it gives rise to the increment of the size of search space when the number of parameters needed to determine the membership function increases and therefore the increment of computation time and storage space. For an image having L gray levels, and a membership function determined by 2 parameters, the size of search space is L(L − 1)/2. For example, if L equals 256, the search space will be 32 640. In this paper, the 2-partition case is considered. The computation complexity of the method is bounded by O(L3 ), then
[1] J.-P. Cocquerez, et al., Analyse d’images: filtrage et segmentation, Masson, Paris, 1995, pp. 239–280. [2] P.K. Sahoo, S. Soltani, A.K.C. Wong, Y.C. Chen, A survey of thresholding techniques, Comput. Vision Graphics Image Process. 41 (1988) 233–260. [3] O.D. Trier, A. Jain, Goal-directed evaluation of binarization methods, IEEE Trans. PAMI (1995) 1191–1201. [4] H.D. Cheng, J.-K. Chen, J. Li, Threshold selection based on fuzzy c-partition entropy approach, Pattern Recognition 1 (1998) 857–870. [5] S. Benabdelkader, M. Boulemden, S. Louifi, Threshold selection by maximising the between class variance of a fuzzy 2-partition, Proceedings of the Ninth International Workshop on Systems, Signals and Image Processing, Manchester, UK, 2002, pp. 282–288. [6] A.G. Yiannoulis, Y.S. Boutalis, B.G. Mertzios, Fast segmentation of colour images using the fuzzy kmeans algorithm and different sampling approaches, Proceedings of the Ninth International Workshop on Systems, Signals and Image Processing, Manchester, UK, 2002, pp. 532–535.
About the Author—SOUAD BENABDELKADER was born in Constantine, Algeria. She received the degree of engineer and Magister in electronics from the Electronic Institute of the Constantine University in 1991 and 1996, respectively. She is currently a lecturer at the Electronic Department at the University of Batna and carrying out research leading to the Doctor degree. Her current research activities include image processing, satellite image analysis with fractals and wavelets. About the Author—M. BOULEMDEN, Ph.D., Professor at the University of Batna, Algeria. He graduated from Algiers’ Polytechnic where he obtained the degree of engineer in electronics, then carried out research work leading to M.Phil. in microprocessor systems and signal processing at the University of Nottingham, UK. He pursued his research work and obtained the degree of Ph.D. in 1983. He was a senior lecturer at the University of Constantine, Algeria, then moved to the University of Batna where he took office as the chancellor of the university. He is currently carrying out research work in the fields of signal processing and robotics.