1 Random spatial sampling and majority voting based image thresholding Yi Hong Y. Hong is with the City University of Hong Kong. yihong@cityu.edu.hk November 1, 7
2 Abstract This paper presents a novel image thresholding algorithm, termed as random spatial sampling and majority voting based image thresholding algorithm (). firstly obtains a population of binary subimages by using random spatial sampling and s thresholding algorithm [1]. Then aggregates these binary subimages into a consensus binary image by majority voting technique. Since the subimages are randomly selected with different sizes ranging from one pixel to the whole image, can make use of both global and information for thresholding an image. Experimental results on several real images confirm the effectiveness of. Index Terms Image thresholding, s thresholding algorithm. I. INTRODUCTION Image thresholding plays an important role for image processing and image transmission. It performs to convert a gray-level image into a binary image such that foreground objects and their background are represented as two different states in the binary image. Let G M N denote a gray-level image where 0 G(m, n) 255 and B M N be its objective binary image where B(m, n) {0, 1} and (1 m M, 1 m N). Then image thresholding algorithms try to find threshold values T (m, n) that are able to partition the whole image into objects and background according to the following criterion: 1 G(m, n) T (m, n) B(m, n) = 0 G(m, n) < T (m, n) where 1 m M, 1 n N and the value 1 of B(m, n) represents that the pixel (m, n) belongs to foreground objects. Many image thresholding algorithms have been proposed so far [2] and most of them can be classified into two groups, namely global image thresholding algorithms [1] and image thresholding algorithms [4]. The global image thresholding algorithms assume that all pixels in the gray-level image have the same threshold value T, that is: T (m, n) = C (1 m M, 1 n N) (2) where C is a constant. Global image thresholding algorithms are simple to implement and require less computational cost, therefore have gained many real-world applications such as (1) November 1, 7
3 automatic target recognition, image compression, text enhancement and to just name a few [2]. However, global image thresholding algorithms can only work well under the condition that both objects and their background have uniform gray values. Therefore if images are obtained under a non-uniform illumination or with a non-uniform background, the performances of global image thresholding algorithms may become unsatisfactory. To mitigate the problem of non-uniform illumination, several image thresholding algorithms have been introduced [4] [5] [6]. Most of them assign a threshold value to each pixel according to some statistics like mean, variance or surface-fitting parameters of the pixels in its neighborhood. Let N(m, n) denote the neighborhood of the pixel (m, n), then the threshold value of the pixel (m, n) can be calculated as: T (m, n) = Ω(N(m, n)) (1 m M, 1 n N) (3) where Ω( ) is the image thresholding function. For example, White and Rohrer compared the gray value of the pixel with the average of the gray values in its neighborhood. If the pixel is darker than the average, it is considered as objects; otherwise, it belongs to background [6]. Local image thresholding algorithms can achieve a good result for images with a non-uniform illumination or with a non-uniform background [2] [4]. However, image thresholding algorithms are not exempt from any drawbacks. They at least suffer from the following two problems. First, image thresholding algorithms require much more time consumption, when compared with global image thresholding algorithms. Second, the performances of image thresholding algorithms are significantly dependent on the size of neighborhood [2] [5]. If the size of neighborhood is too large, information can not be well exploited. But a too small size of neighborhood usually leads to the disruption of large objects and large background. This paper proposes a novel image thresholding algorithm, termed as random spatial sampling and majority voting based image thresholding algorithm (). firstly obtains a population of binary subimages by using random spatial sampling and s image thresholding algorithm [1]. Then aggregates these binary subimages into a consensus one by majority voting technique. Since the subimages are randomly selected with different sizes ranging from one pixel to the whole image, is able to make use of both global information and information. Another advantage of is no parameters are required to be tuned with care. The remainder of this paper is arranged as follows. Section II goes into details of describing November 1, 7
4 random spatial sampling and majority voting based image thresholding algorithm. Our experimental results and their analysis are given in section III. Section IV concludes this paper. II. RANDOM SPATIAL SAMPLING AND MAJORITY VOTING BASED IMAGE THRESHOLDING ALGORITHM A. s thresholding method Our proposed random spatial sampling and majority voting based image thresholding algorithm () is based on Ostu s thresholding method [1]. This algorithm was proposed by Ostu in 1979, but still remains as one of the most widely used approaches for image thresholding. Ostu s thresholding method considers the image thresholding problem as a process to partition pixels into foreground objects group and background group such that the minimal value of within-cluster variation is met. Several studies have concluded that Ostu s thresholding method outperforms other existing global thresholding methods [2] [3]. However as a global image thresholding method, Ostu s thresholding method can not perform well enough under a nonuniform illumination or with a non-uniform background. This paper proposes a novel approach to overcome the above shortcoming of Ostu s thresholding algorithm by random spatial sampling and majority voting techniques. B. Random spatial sampling method Let {G (1) M 1 N 1, G (2) M 2 N 2,..., G (L) M L N L } denote a population of gray-level subimages, obtains these subimages through randomly sampling from the whole image G M N following steps employed: First, the center (C (i) k generated as follows:, C(i) l ) of the subimage G (i) M i N i with the is randomly C (i) k = M rand(1) (4) and C (i) l = N rand(1) (5) Likewise the height M i and the width N i of the subimage: M i = 2 M rand(1) + 1 (6) 2 November 1, 7
5 and Based on the center, height and width, the subimage G (i) M i N i N i = 2 M rand(1) + 1 (7) 2 can be directly sampled from the original image G. Something worthwhile mentioning is that an image pruning process is required for a unfeasible sampling if the subimage exceeds the border of the whole image G. After these L subimages have been generated, L binary images {B (1), B (2),..., B (L) } can be achieved by executing the Ostu s image thresholding algorithm on these L subimages. C. Aggregating by majority voting technique Based on a population of binary subimages, aggregates these binary images into a consensus one by using the majority voting technique. The majority voting technique calculates the frequencies of the pixels to be classified into objects as: [ Li=1 δ(m, n, G (i) ) B (i) (m, n ) ] P (m, n) = Li=1 (8) δ(m, n, G (i) ) where 1 if pixel(m, n) is selected intog (i) δ(m, n, G (i) ) = 0 otherwise (9) and (m, n ) is the position of the pixel (m, n) in the subimage G (i). The final binary image can be achieved by using a simple voting process as follows: 1 P (m, n) 0.5 B(m, n) = 0 otherwise where 1 m M and 1 n N. (10) III. EXPERIMENTAL RESULTS AND THEIR ANALYSIS Six real images are selected to test the performance of : Cameraman, Rices, Circuit, Rabbit, Plane and Kids. All these six images have non-uniform backgrounds or non-uniform objects. Experimental results of are compared with a global thresholding algorithm: s thresholding algorithm [1] and an adaptive thresholding algorithm [5]. For, its number of subimages L is set as 0. Experimental results are given in Figure 1. From this figure, we can observe the following three phenomena. 1) The results of s thresholding algorithm November 1, 7
6 are very normal. For example, the field in Cameraman has been wrongly classified as objects and part of the object in Rabbit has been neglected as background. More seriously, the whole Kids image was wrongly considered as background. 2) thresholding algorithm is also not good enough. For example, only the borders of rices are classified as objects, but the bodies of these rices are wrongly considered as background. 3) The results of are very satisfactory. It achieves better binary images on all tested images when compared with other two algorithms. We can conclude from the above three phenomena that is able to make use of both global and information, therefore achieve a satisfactory thresholed image. IV. CONCLUSION In this paper, a novel image thresholding algorithm is proposed. We have described the image thresholding algorithm into details. Moreover, we have tested the proposed image thredholing algorithm on several real images and compared its performance with two other thresholding algorithms. Experimental results have confirmed the effectiveness of the proposed thresholding algorithm. REFERENCES [1] N.. A threshold selection method from gray-level histogram, IEEE Trans. System, Man, and Cybernetic. vol. 9, no. 1, pp. 62-66, 1979. [2] M. Sezgin, B. Sankur. Survey over image thresholding techniques and quantitative performance evaluation. Journal of Electronic Imaging, vol. 13, no. 1, pp. 146-165, 4. [3] O.D. Trier, T. Taxt. Evaluation of binarization methods for document images. IEEE Trans. Pattern Analysis, and Machine Intelligence, vol. 17, no. 3, pp. 312-315, 1995. [4] I. Blayvas, A. Bruckstein, R. Kimmel. Efficient computation of adaptive threshold surfaces for image binarization. Pattern Recognition, vol. 39, pp.89-101, 6 [5] J. Sauvola, M. Pietikäinen. document image binarization, Pattern Recognition. Vol.33, pp.225236, 0. [6] J.M. White, and G.D. Rohrer. Image thresholding for optical character recognition and other applications requiring character image extraction, IBM Journal Research Developmenet. Vol.27, no.4, pp. 411, 1983. November 1, 7
7 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Fig. 1. Experimental results November 1, 7