cvl – daeyong @ gist, korea date : 2014. 11. 18 presenter : dae-yong cho
TRANSCRIPT
Adaptive thresholding in binarization
CVL – Daeyong @ GIST, Korea
Date : 2014. 11. 18Presenter : Dae-Yong Cho
2
Contents
CVL – Daeyong @ GIST, Korea
What is binarization?
Binarization Method• Otsu’s• Sauvola’s
References
3
What is binarization?
CVL – Daeyong @ GIST, Korea
Divide image’s intensities into 0 or 255 (Foreground and Background )
Color Image
Gray Image
Binary Image
Thresholding
𝑇
𝟎 , 𝑖𝑓 𝐼<𝑇𝐼𝑏𝑖𝑛𝑎𝑟𝑦=¿𝟏 , h𝑜𝑡 𝑒𝑟𝑤𝑖𝑠𝑒
Used for OCR System to segment characters from background
5
Binarization Method - Otsu
CVL – Daeyong @ GIST, Korea
h𝐴𝑙𝑔𝑜𝑟𝑖𝑡 𝑚
1. Compute histogram of input image
2. Compute probabilities of each intensity level (0 to 255)
3. Step through all possible thresholds
4. Select threshold corresponds to the
(Assumption : There are only two classes in histogram)
6
Binarization Method - Otsu
CVL – Daeyong @ GIST, Korea
h𝐴𝑙𝑔𝑜𝑟𝑖𝑡 𝑚
1. Compute histogram of input image
2. Compute probabilities of each intensity level (0 to 255)
3. Step through all possible thresholds
4. Select threshold corresponds to the
(Assumption : There are only two classes in histogram)
Histogram
Gray Scale Image
7
Binarization Method - Otsu
CVL – Daeyong @ GIST, Korea
1. Compute histogram of input image
2. Compute probabilities of each intensity level (0 to 255)
3. Step through all possible thresholds
4. Select threshold corresponds to the
(Assumption : There are only two classes in histogram)
𝐶𝑙𝑎𝑠𝑠 1 𝐶𝑙𝑎𝑠𝑠 2
𝝎𝟏 𝝎𝟐
𝑡𝑖
•
•
•
h𝐴𝑙𝑔𝑜𝑟𝑖𝑡 𝑚
8
Binarization Method - Otsu
CVL – Daeyong @ GIST, Korea
1. Compute histogram of input image
2. Compute probabilities of each intensity level (0 to 255)
3. Step through all possible thresholds
4. Select threshold corresponds to the
(Assumption : There are only two classes in histogram)
𝑡𝑖𝐶𝑙𝑎𝑠𝑠 1 𝐶𝑙𝑎𝑠𝑠 2
𝝎𝟏 𝝎𝟐
𝜎𝜔2 (𝑡 )=𝜔1 (𝑡 )𝜎1
2 (𝑡 )+𝜔2 (𝑡 )𝜎22 (𝑡 )
𝜎 𝑏2 (0 )=𝛼 ,𝜎 𝑏
2 (1 )=𝛽 ,𝜎𝑏2 (2 )=𝛾 , …
h𝐴𝑙𝑔𝑜𝑟𝑖𝑡 𝑚
𝜇1 𝜇2𝑚
9
Binarization Method - Otsu
CVL – Daeyong @ GIST, Korea
1. Compute histogram of input image
2. Compute probabilities of each intensity level (0 to 255)
3. Step through all possible thresholds
4. Select threshold corresponds to the
(Assumption : There are only two classes in histogram)
𝑡𝑖𝐶𝑙𝑎𝑠𝑠 1 𝐶𝑙𝑎𝑠𝑠 2
𝝎𝟏 𝝎𝟐
𝜎 𝑏2 (0 )=𝛼
𝜎 𝑏2 (1 )=𝛽
𝜎 𝑏2 (2 )=𝛾
𝜎 𝑏2 (255 )=𝛿
Select which makes largest
h𝐴𝑙𝑔𝑜𝑟𝑖𝑡 𝑚
11
Binarization Method - Otsu
CVL – Daeyong @ GIST, Korea
Result
Input Image Otsu Alg. Output
Effect of Global Method
12
Binarization Method - Sauvola
CVL – Daeyong @ GIST, KoreaCVL – Daeyong @ GIST, Korea
Local Method Do not use histogram anymore
Compute threshold for each pixel
I
𝑻 𝟏 𝑻 𝒏
𝑻 𝒌 𝑻 𝒑
To overcome Otsu’ algorithm’s problem
13
Binarization Method - Sauvola
CVL – Daeyong @ GIST, KoreaCVL – Daeyong @ GIST, Korea
Local Threshold Value t(x,y)
𝑡 (𝑥 , 𝑦 )=𝑚 (𝑥 , 𝑦 ) [1+𝑘( 𝑠 (𝑥 , 𝑦 )𝑅
−1)]
(𝑥 , 𝑦 )
14
Binarization Method - Sauvola
CVL – Daeyong @ GIST, KoreaCVL – Daeyong @ GIST, Korea
Local Threshold Value
𝑡 (𝑥 , 𝑦 )=𝑚 (𝑥 , 𝑦 ) [1+𝑘( 𝑠 (𝑥 , 𝑦 )𝑅
−1)] ,𝑘=[0.2,0 .5]
𝐹𝑜𝑟 𝑤𝑖𝑛𝑑𝑜𝑤𝑠𝑖𝑧𝑒=3 (𝑥 , 𝑦 )
•
𝑤𝑥
𝑤𝑦
•
𝑂 (𝑤2𝑀𝑁 )
15
Binarization Method - Sauvola
CVL – Daeyong @ GIST, KoreaCVL – Daeyong @ GIST, Korea
Input Image Sauvola Alg. Output (with k = 0.5)
Result
16
Binarization Method - Sauvola
CVL – Daeyong @ GIST, KoreaCVL – Daeyong @ GIST, Korea
Input Image
Sauvola Alg. Output (Elapsed time : 484msec)
Comparison
Otsu Alg. Output (Elapsed time : 16msec)
Computation Cost Results of Reference [2]
17
References
CVL – Daeyong @ GIST, Korea
1. WikiPedia : http://en.wikipedia.org/wiki/Otsu's_method
2. T. Romen Singh, Sudipta Roy, O. Imocha Singh, Tejmani Sinam, and Kh. Manglem Singh, “A
New Local Adaptive Thresholding Technique in Binarization”, International Journal of Com-
puter Science Issuses(IJCSI), Vol. 8, Issue 6, No 2, November 2011.
3. Faisal Shafait, Daniel Keysers, and Thomas M. Breuel, “Effiecient Implementation of Local
Adaptive Thresholding Techniques Using Integral Images”, International Society for Optics and
Photonics(SPIE), 2008.