Paper Title (use style: paper title)

42 downloads 0 Views 420KB Size Report
calculating correlation and SSIM with inverted benchmarks. From all above observation, its quiet clear, entropy method is better for binarization, whereas Kapur's ...
2014 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT)

Adaptive Thresholding: A comparative study Payel Roy

Goutami Dey

Dept. of CA, JIS College of Engineering, Kalyani, West Bengal, India, [email protected]

Dept. of CSE, JIS College of Engineering, Kalyani, West Bengal, India, [email protected]

Saurab Dutta

Sayan Chakraborty

Dept. of CA, JIS College of Engineering, Kalyani, West Bengal, India, [email protected]

Dept. of CSE, JIS College of Engineering, Kalyani, West Bengal, India, [email protected]

Nilanjan Dey

Ruben Ray

Dept. of IT, JIS College of Engineering, Kalyani, West Bengal, India, [email protected]

Department of IT, GCELT, Kolkata, West Bengal, India [email protected]

Abstract— With the growth of image processing applications, image segmentation has become an important part of image processing. The simplest method to segment an image is thresholding. Using the thresholding method, segmentation of an image is done by fixing all pixels whose intensity values are more than the threshold to a foreground value. The remaining pixels are set to a background value. Such technique can be used to obtain binary images from grayscale images. The conventional thresholding techniques use a global threshold for all pixels, whereas adaptive thresholding changes the threshold value dynamically over the image. This paper offers a comparative study on adaptive thresholding techniques to choose the accurate method for binarizing an image based on the contrast, texture, resolution etc. of an image. Keywords—Threshold, Otsu’s Method, Kapur’s threshold, Rosin’s threshold, Entropy based thresholding, Image binarization.

I.

INTRODUCTION

In image processing, thresholding is applied to obtain binary images from grayscale images. Adaptive thresholding is found to be better as compared to conventional thresholding technique. In an image, some parts remain under more shadow and often illuminations also affect the image. In conventional thresholding method, a global or standard threshold value is taken as mean value. In an image, if darker part or pixels contain a value larger than the threshold value, then that part of the image appears in the foreground. Similarly if the value is less than the threshold value, then that pixel or part appears in the background. Binary image is the resultant image of adaptive thresholding as it depicts the differences between different threshold values. The white region describes values less than threshold and black region describes values greater than threshold value.

are mainly based on some parameters of the respective image to compute the threshold value. The main problem of such techniques is two class classification paradigms. The two classes are foreground and background. Following the selection of the threshold value, the image turns into a binary image. This issue demanded the threshold value being image dependent. As previously noted, recently a number of works has been done on adaptive threshold methods. In 1986, Niblack et al. [1] used the local mean and standard deviation of the neighboring pixels inside the local window to compute the threshold according to the contrast. Bernsen et al. [2] proposed a local gray range technique to determine the threshold value inside the range between the maximum and minimum pixel. The gray range was used within the local window. Later, in 1997 Sauvola et al. introduced a technique to compute the local adaptive [3] threshold. But there was a difference in their result based on their calculation process. In the local neighborhood, the contrast remained quite low which led to threshold becoming smaller than the mean value. This technique helped to successfully remove the relatively dark regions of the background. In 2011, Singh et al. [4] computed the local threshold without compromising the performance of the local thresholding techniques. They used the technique of integral sum image to find the local mean of the neighborhood pixel in a window which was independent of the window size. Niblack’s and Bernsen’s methods needed large window size to compute the adaptive threshold value. These techniques were not appropriate for smaller window size. Surprisingly, Singh’s technique achieved good result in smaller window also. This current work proposes a comparative study on adaptive thresholding techniques to choose the optimal method for binarizing an image based on the contrast, texture, resolution etc. of an image.

Previously, lot of work has been done on several techniques for computing the adaptive thresholding value based on contrast, texture, resolution etc. of the image. The techniques

978-1-4799-4190-2/14/$31.00 ©2014 IEEE

1320

2014 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT)

II. METHODOLOGY There are several methods which can be used to compute the adaptive threshold value of an image. Some of these techniques were used for our study.

Step 6. Two maxima and their corresponding threshold values are calculated and stored.

A. Otsu’s Method This method was named after Nobuyuki Otsu et al. [5] in 1979. Otsu’s method is capable of converting a grayscale image into a binary image. To adapt a local threshold value of an image, this method can be termed as a very basic method. Otsu's method looks for the threshold value [6] which can minimize the intra-class variance. The intra-class variance [7] can be defined as the two classes’ weighted sum of variances. The following equation is used to obtain the intra-class variance.

In Otsu’s method, the algorithm assumed that the image was classified into two classes of pixels: foreground and background. Afterwards, those two classes were separated in order to minimize their respective inter-class variance, which led to computation of the optimum threshold. This method is always independent of the probability density function. However, bimodal distribution of gray level values was assumed by this method. This assumption was the main drawback of this method. It also failed to determine the threshold value when the classes are very unequal.

 w2t  1 (t)12t  2 (t) 22t

(1)

1 (t ) refers to the probabilities of two classes separated by a threshold t.  1 and  2 are the

where, weights

which are variances of these two classes. The following equation used in Otsu’s method describes that minimizing and maximizing [8] the intra-class variance is almost similar.

 b2t   2   w2t  1 (t )2 (t )[1 (t )  2 (t )]2

(2)

i

refers to the class probabilities of the class means i . Such class probabilities are measured with the help of histogram t. Class probabilities uses following equation to compute. t

1 (t )   p(i) (3) . 0

Class mean in Otsu’s method was defined by  t    p(i ) x(i )   1 (t )   0

1

(4)

In this equation, x(i ) refers to the value which is located at the center of the ith histogram bin. Otsu’s method was also capable of computing  2 and 2 using the previously discussed method (eqn. 3 and 4). These two parameters  2 and 2 are measured to extract the right-hand side of the histogram for bins greater than t. These computations are carried out iteratively which leads to an effective algorithm discussed below. Step 1. Each intensity level’s histogram and probabilities are calculated. Step 2. Initial values  0 and

0

are set.

Step 3. For all possible thresholds t =1……intensity, these steps are repeated. Step 4. Obtained result is used to update i and to compute  b t . Step 5. The maximum threshold value is obtained. 2

978-1-4799-4190-2/14/$31.00 ©2014 IEEE

i

and also

Step 7. Finally desired threshold value is obtained using the mean value of those two threshold values.

B. Kapur’s method In 1985, Kapur et al. [9] used Shanon’s concept of entropy to compute the threshold value but in different perspective. They considered two probability distributions instead of one. One probability was for the foreground of the image and another one was for the background. The sum of the individual entropy of the foreground and the background was maximized later. This process created equal-probability gray levels in every region. Hence, the desired threshold should be capable of gray level minimizing of relative entropy. The proposed technique was different from the two popular entropy-based thresholding techniques such as, the local entropy and joint entropy methods [10] developed by N. R. Pal and S. K. Pal. This method was focused on the match between the two images while the previously discussed methods [11] only emphasized on the entropy of the co-occurrence image matrix. The experimental results showed that these three techniques were image dependent. Also, the local entropy and relative entropy [12] seemed to perform better than the joint entropy. In addition, the relative entropy can complement the local entropy and joint entropy in terms of providing different details which the others cannot. As far as computational complexity is concerned, the relative entropy approach also provides the least computational complexity. This method was later used in further studies [13]. C. Rosin’s method In 2001, Rosin et al. [14] described an algorithm which showed a straight line from the highest point of the intensity histogram to last non-empty bin as a result of the operations carried out in the proposed method. The maximum deviation point between [15] the line and the histogram curve was located [16] at a corner. That point was selected as the adaptive threshold value. D. Entropy method The entropy method used a technique of relative entropy for obtaining adaptive threshold value. This method is also known as Kullback-Leiber[17] discrimination distance function. This method required the gray level lessening of the relative entropy. The unique feature of this method was that it emphasized the entropy of the one image’s co-occurrence matrix. The proposed relative entropy approach is different from the previously discussed entropy-based thresholding

1321

2014 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT)

techniques, the local entropy and joint entropy methods developed by N. R. Pal and S. K. Pal [11, 12]. Our proposed system studied these four techniques, which later binarized the image and those images are used for postprocessing to evaluate each of these methods individually. III.

RESULTS AND DISCUSSION

The adaptive threshold methods were examined on the standard lena.jpg images. Our proposed system used 1.2 GHz Intel Core 2 Duo processor based system, and Matlab R2012a software. To observe the effect of different threshold methods, firstly our system binarized the standard lena image. Our work showed the visual effects (Fig.1) and later calculated the correlation (Table 1) values between benchmark lena (Fig. 2) binary image with obtained binary images. We have also calculated (Table 1) the mean structural similarity index (MSSIM) between the benchmark image and resultant images for each method. By extracting structural and transformed features from the images, structural and feature based similarity indices check for the similarity can be obtained. Calculating correlation value can be a very useful method to observe the changes between original image, and resultant image. Highest correlation value 1 refers to images being similar and lowest correlation value 0 defines both images are completely different from each other. Following binarization of the image, the similarity of benchmark image and binarized image was computed with the help of the standard correlation coefficient C as follows:

 ( x

mn

C

m

 x)( ymn  y)

n

(5)  2  2   ( xmn  x)   ( ymn  y)   m n  m n  where, x and y refers to the rows and columns of benchmark image and x’ and y’ are the rows and columns of resultant image. The similarity of structure based features between the resultant and original images, structural similarity index [18] (SSIM) and mean structural similarity index (MSSIM) [19] were also computed to establish a comparative approach between different adaptive threshold methods.

SSIM and MSSIM are defined as: (2v v  k )(2a  k ) SSIM  2 x 2 y 1 2 xy 2 2 (6) (vx  v y  k1 )(ax  a y  k2 ) where, x is the benchmark image, y is the obtained binary image, vx is the average of the benchmark image (x), vy is the average of the obtained binary image (y), ax is the standard deviation of benchmark image (x), ax is the standard deviation of resultant image (y). In this equation, ax is the covariance of x and y, k1 and k2 are variable to stabilize the division with weak denominator.

MSSIM ( x, y) 

1 N  SSIM ( xi  yi ) N i 1

where, N refers to the number of local windows in the image used for processing. Structural coefficients and overlap measures vary from zero and one. Table 1 showed the MSSIM values as an effect of different types of adaptive threshold methods used for binarization.

A

B

C

D

E

F

G

H

978-1-4799-4190-2/14/$31.00 ©2014 IEEE

(7)

1322

2014 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT)

I

J

K

M

N

O

L

P B

Fig.1 A), E), I), M)- Original Image of Lena; B), F), J), N)- Ground truth Image; C)- Binarized image using Otsu; G)- Binarized image using Kapur; K)- Binarized image using Rosin; O)- Binarized image using Entropy; D)- Fused image of A) & C); H)- Fused image of E) & G); L)- Fused image of I) & K); P)- Fused image of M) & O);

Method

Correlation

SSIM

Benchmark

Inverted benchmark

Benchmark

Inverted benchmark

Otsu

0.6110

-0.6110

0.4546

0.1580

Rosin

-0.4132

0.4132

0.0994

0.1677

Kapur

-0.9463

0.9463

-0.1472

0.1693

Entropy

0.9503

-0.9503

0.8001

0.1513

Fig.1A, 1E, 1I, 1M showed the original image, which was taken for post processing. Fig.1 (B, F, J, N) are ground truth images which are obtained from the original image. Fig. 1C is the obtained image using Otsu’s method, whereas Fig. 1G, 1K and 1O showed the effect of Kapur, Rosin and Entropy methods.

Fig.3 Benchmark image for calculation Apart from visual representation, we have calculated the correlation between resultant images and taken one lena binary image as benchmark image (Fig.3). The proposed

978-1-4799-4190-2/14/$31.00 ©2014 IEEE

system calculated correlation and SSIM values with the original benchmark and inverted benchmarks. Table 1 showed entropy method producing higher correlation value while comparing with benchmark lena image, whereas Kapur’s method resulted better values than other three methods, while calculating correlation and SSIM with inverted benchmarks. From all above observation, its quiet clear, entropy method is better for binarization, whereas Kapur’s method can produce better results in case of inverted binarization. Unlike the previous comparative approaches [20] used by Rosin et al. or upgrading the already existing [21] techniques proposed by Su et al., our work remained focused on comparing different techniques using the resultant images, correlation and the MSSIM values obtained. Our work compared the results of different approaches for a better estimation of optimal adaptive threshold method, so that future work consisting various image processing operations may retrieve some help while choosing appropriate method for their necessary operations.

1323

2014 International Conference on Control, Instrumentation, Communication and Computational Technologies (ICCICCT)

IV. CONCLUSION Previously, lot of work has been done for the betterment of already existing adaptive threshold methods. But our paper compared different types of adaptive threshold methods and showed the effect on standard image, rather than optimizing a single method. From correlation and SSIM calculations, it became clear that entropy method gave better results than other results, although during invert calculation, Kapur’s method produced better results. Our main focus was to show the effects of different adaptive threshold methods rather than concluding one method as the best among all. Future scope may include other segmentation or adaptive threshold techniques being included. Also using a larger dataset may lead to a better convergence, which can be used in near future for further studies.

[9]

REFERENCES

[15]

[1] [2] [3]

[4]

[5]

[6] [7]

[8]

W. Niblack, “An introduction to digital image processing”, PrenticeHall, Englewood Cliffs, NJ, pp. 115–116, 1986. J. Bernsen, “Dynamic thresholding of gray level images,” Proc. Intl. Conf. on Pattern Recognition,pp. 1251–1255, 1986. J. Sauvola, T. Seppanen, S. Haapakoski, and M. Pietikainen, “Adaptive document binarization”, Proc. 4th Int. Conf. on Document Analysis and Recognition, Ulm Germany, pp. 147–152, 1997. T.R.Singh, S. Roy, O.I. Singh, T. Sinam and K.M. Singh, “A new local adaptive thresholding technique in binarization”, Int. J. Comput. Sci., Vol.8, pp. 271-277, 2011. N. Otsu, “A threshold selection method from gray-level histograms,” IEEE Trans. Systems, Man, and Cybernetics, vol. 9, Issue. 1, pp. 62–66, 1979. D. Liu and J. Yu, "Otsu Method and K-means", Ninth International Conference on Hybrid Intelligent Systems, vol.1, pp. 344 - 349, 2009. H. J. Vala, "A Review on Otsu Image Segmentation Algorithm", International Journal of Advanced Research in Computer Engineering & Technology (IJARCET), vol. 2, Issue. 2, pp.387-389, February 2013. http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MORSE/ threshold.pdf

978-1-4799-4190-2/14/$31.00 ©2014 IEEE

[10] [11]

[12] [13]

[14]

[16]

[17] [18]

[19]

[20]

[21]

J. N. Kapur, P. K. Sahoo, and A. K. C. Wong. "A new method for graylevel picture thresholding using the entropy of the histogram." Computer vision, graphics, and image processing, vol. 29, Issue. 3, pp. 273-285, 1985. S. K. Pal, N. K. Pal, “A review on image segmentation techniques ”, Pattern Recognition Letters, vol. 29, pp. 1277–1294, 1993. N. R. Pal and S. K. Pal, "Object-background segmentation using new definitions of entropy", IEE Proceedings E Computers and Digital Techniques, Volume:136 , Issue: 4 , pp. 284 - 295, 1989. N.R. Pal, "On Minimum Cross-Entropy Thresholding”, Pattern Recognition", Vol. 29, Issue. 4, pp. 575 580, 1996 A.R. Ahmad, Z. Hussain, F. Ahmad, M.H.M. Noor and S.Z Yahaya, "Gel Electrophoresis Image Segmentation with Kapur Method Based on Particle Swarm Optimization", Fifth International Conference on Computational Intelligence, Communication Systems and Networks (CICSyN), pp. 393 - 396, 2013. P. L. Rosin, “Thresholding for change detection,” computer vision and image understanding, vol. 86, pp-79-95,2002 P. L. Rosin and T. Ellis, “Image difference threshold strategies and change detection,” In Proc. British Machine Vision Conference, pp.347356,1995. M.A. Ramírez-Ortegón and R . Rojas, "Transition Thresholds for Binarization of Historical Documents", 20th International Conference on Pattern Recognition (ICPR), pp.1051-4651, 2010 S. Kullback and R. A. Leibler. On information and sufficiency. The Annals of Mathematical Statistics, vol. 22, Issue. 1, pages 79-86, 1951. L. Zhang, L. Zhang, X. Mou and D. Zhang, “FSIM: a feature similarity index for image quality assessment”, IEEE Transactions on Image Processing, vol.20, Issue. 8, pp. 2378-2386, 2011. S. S. Choi, S. H. Cha and C. Tappert, “A survey of binary similarity and distance measures. Journal of Systemics”, Cybernetics and Informatics, vol. 8, Issue. 1, pp. 43-48, 2010. P. L. Rosin and E. Ioannidis, "Evaluation of global image thresholding for change detection", Pattern Recognition Letters, vol. 24, pp. 2345– 2356, 2003. C. Su and A. Amer, "A Real-Time Adaptive Thresholding for Video Change Detection", Proc. IEEE Int. Conference on Image Processing (ICIP), Atlanta, GA, USA, pp. 157-160, October 2006.

1324