Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Computing
Abstract—By analyzing the basic principle of Otsu method and W1 = {0,1,2, ⋅⋅⋅䯸 T } and
such that
its application in image segmentation, and according to the
distribution characteristics of the target and background, an W2 = {T + 1䯸 T + 2䯸⋅⋅⋅,L-1} , where L is the total
improved threshold image segmentation algorithm based on
number of the gray levels of the image. Let the number of
the Otsu method is developed. By narrowing the selection L-1
range of threshold and searching the minimum variance ratio,
the improved algorithm selects the optimal threshold. Through pixels at i gray level be ni , and N = ¦ n i be the total
the compared with the Otsu method and other methods, the i =0
results show that the new improved algorithm has these number of pixels in a given image. The probability of
advantages such as high segmentation precision and fast occurrence of gray level i is defined as
computation speed. ni L-1
pi = 䯸 p i ≥ 0䯸¦ p i = 1 . W1 and W2 are normally
Keywords- Otsu method; image segmentation; optimal N i =0
threshold; selection range; minimum variance ratio corresponding to the object of interested and the background,
the probabilities of the two classes are
I. INTRODUCTION T
Image segmentation is one of the basic problems of the Pw1 = ¦ pi and Pw 2 = ¦ pi = 1-Pw1 .
i =0
image processing and machine vision, its key point is: the
image is divided into a number of sets that do not mutual The means of the classes W1 and W2 can be computed
overlapping zones; these zones either have meaning to as:
currently mission or help to explain correspondence between T
i * pi
them and the actual object or some parts of object. Image
segmentation have a wide range of applications in practice,
μ w1 = ¦ (1)
i = 0 Pw1
such as: industry automation, product online detection,
L −1
manufacturing and process control, remote sensing image i * pi
processing, biomedical image analysis, etc [1][2]. μ w1 = ¦ (2)
Threshold is a commonly used method that improves the i =T +1 Pw 2
image segmentation effect obviously, meanwhile it is So we can get the equivalent formula:
simpler and easier to implement. However, it fails when the σ 2 (T ) = Pw1Pw 2 ( μ w1 − μ w 2 ) 2 (3)
difference of the two within-class variances is large and the
*
result of Otsu method may be present twin peaks or more The optimal threshold T can be obtained by
peaks [3]. By studying the principle of the Otsu method and maximizing the between-class variance.
its application in image segmentation, an improved threshold T * = Arg max σ 2 (T ) (4)
image segmentation algorithm based on the Otsu method is 0<T< L-1
developed. By narrowing the selection range of threshold The Otsu method is simple and has a stable affection, so
and searching the minimum variance ratio, the improved it has been widely applied in image segmentation in practice
algorithm selects the optimal threshold. The results of the .It play an important role in the automatic selection of
simulation by different images were analyzed, studied, threshold. However, we found that the Otsu method is very
compared. The results show that the improved Otsu sensitive about noise and the size of target. It is only
algorithm has these advantages such as high segmentation effective to the image with single peak variance after the
precision and fast computation speed. experiments to many kinds of images. When the difference
of the two intra-class variances is large, the threshold of the
II. OTSU METHOD Otsu method tends to be closer to the class with larger intra-
Otsu proposed a dynamic threshold selection method in class class variance, which means that more pixels of this
1979. This method suggests maximizing the weighted sum of class will be classified into the another class [5], so the
between-class variances of foreground and background segmentation result needs to be improved.
pixels to establish an optimum threshold [4]. We can
partition the image into two classes W1 and W2 at gray T
136
σ 2W
λ= (10)
σ 2i
The inter-class variance σ 2i indicates the different of
class W1 and W2 . There are more differences between class
W1 and W2 , the larger the σ 2 i will be. The intra-class
2
variance W means the discrete degree of the class W and 1
W2 .The more concentrated the gray in the class W1 and W2 ,
the littler the σ W will be. Both of the inter-class variance
2
Swan Orange
Pixel number 154401 160000
Maximum gray value 255 255
Minimum gray value 12 20
Average gray values 89.6796 189.7138
Lower threshold 175 186
High threshold 194 220
(a)
137
(a)
(b)
Figure 3. The histogram of the image: (a) Swan, (b) Orange
(a)
(a)
(b)
(b)
Figure 4. Segmentation results by Otsu method: (a) Swan, (b) Orange Figure 6. Segmentation results by proposed method: (a) Swan, (b) Orange
138
B. Results analysis is more close to the real threshold, so it is a more practical
Compared the proposed method with Otsu method and and effective image threshold segmentation method
the method [6] by repeat the test 100 times. The test results
ACKNOWLEDGMENT
showed in table II.
This work is supported by the National Natural Science
TABLE II. OPTIMAL THRESHOLD AND COMPUTING TIME Foundation of China under Grant No. 71161007, the Social
Science Fund Project of Ministry of Education under Grant
Swan Orange No. 10YJCZH049, the Key Science and Technology
Otsu method
Optimal threshold 139 177 Program of Haikou under Grant No. 2010-0067 and the
Average time /ms 12.78636 12.84267 Scientific Research Initiation Fund Project of Hainan
Method in Optimal threshold 173 185 University under Grant No. kyqd1042.
[6] Average time /ms 20.35641 19.29573
Proposed Optimal threshold 175 186 REFERENCES
method Average time /ms 13.25282 13.24611
[1] He Jun, Ge Hong, Wang Yu-feng,” Survey on the methods of image
Following conclusions from table II can be gained. The segmentation research,” Computer engineering &science, vol.31,
no.12, 2009.
threshold of Otsu method getting optimal threshold is
[2] M. Sezgin and B. Sankur. “Survey over image thresholding
smaller than that the method [6] and the proposed method techniques and quantitative performance evaluation”, Journal of
get. From the histogram of the image Swan and Orange, we Electronic Imaging, pp.146-156, 2003.
can find that the size of background and target is very [3] P. K. Sahoo, S.Soltani, A.K. Wong, and Y. C. Chan, “A survey of
different. The variance of background is big and the variance thresholding techniques”, Computer Vision Graphics, and Image
of target is small. According to the principle that when the Processing, vol.41, pp. 233-260, 1998
difference of the two variances is large, the threshold of the [4] N. Otsu, “A threshold selection method from gray-level histogram”,
Otsu method tends to be closer to the class with larger IEEE Transactions on Systems Man Cybernet, SMC-8 pp. 62-66,
variance, which means that threshold will be small than the 1978.
real threshold. This means that the thresholds of the method [5] Xu Xiang-yang, Song En-min, JIN Liang-hai, “Characteristic
in [6] and the proposed method is more close to the real Analysis of Threshold Based on Otsu Criterion”, Acta Electronica
Sinica, vol.33, no.14, pp. 188-189, 2007.
threshold than the threshold of the Otsu method. Meanwhile,
the time of Otsu method and the proposed method consume [6] Qu Zhong, “Research On Image Segmentation Based on the
Improved Otsu Algorithm “, Computer Science, vol.36, no.5, pp. 276-
is less than that the method [6] need. The reason is that the 278, 2009.
complexity of the proposed method and the method [6] are
[7] Jiang Qin-yu, Li Ping, Sun Lan,”Application of Otsu method in
increased, but the time of the proposed method is reduced by motion detection system”, Journal o f Computer Applications, vol.31,
narrowing the range of threshold selection. no.1, pp. 260-262,2011.
[8] Hu Chang-hua, Nie Zhi-fei, Zhou Zhi-jie, ”Maximum Classes Square
V. CONCLUSIONS Error Bi-histogram Algorithm”, System Simulation Technology,
By analyzing the basic principle of Otsu method and its vol.6, no.4, pp. 259-262,2010.
application in image segmentation, and according to the [9] Chen S D, Ram Li A R. “Contrast enhancement using recursive
mean-separate histogram equalization for scalable brightness
distribution characteristics of the target and background, an preservation”, IEEE Transactions on Consumer Electronics, vol.49,
improved threshold image segmentation algorithm based on no.4, pp. 1301-1309, 2003.
the Otsu method is developed. By narrowing the selection [10] H. Lee, R. H. Park. “Comments on an optimal threshold scheme for
range of threshold and searching the minimum variance image segmentation”, IEEE Trans. Syst.Man Cybern, SMC-20,
ratio, the improved algorithm selects the optimal threshold. pp.741-742, 1990.
Through the compared with the Otsu method and other [11] J. Z. Liu, W. Q. Li, “The Automatic thresholding of gray-level picture
methods, the results show that the new improved algorithm via two-dimensional Otsu method”, Acta Automatica Si.19, pp.101-
105, 1993.
139