CSC566-Tutorial Thresholding
CSC566-Tutorial Thresholding
Week 9
Chapter 6 (Segmentation using Thresholding)
QUESTION
Figure 1
Figure 1 shows the original image. Perform segmentation on the image using thresholding.
Given the steps as follow:
1. Select initial estimate for T and T0. Let T0 = 5 and T is the mean of the pixels.
3. Compute average gray levels μ1 and μ2 for the two regions, G1 and G2.
5. Repeat Steps 2 – 4 until difference between two successive thresholds, (Ti + 1 - T) < T0
If (f(x,y) > Ti + 1)
then f(x,y) = 1 //region G1
else f(x,y) = 0 //region G2
CSC566/Image Processing
Prepared by: Nur Nabilah Abu Mangshor
Nov 2020
ANSWER
T0 =5
CSC566/Image Processing
Prepared by: Nur Nabilah Abu Mangshor
Nov 2020
1.T = 112.40
µ1
=(7*2)+(9*1)+(11*2)+(12*1)+(15*1)+(21*1)+(24*2)+(25*1)+(48*1)+(64+*1)+(81*1)+(160*1)+(109*1)+(1
11*2)/18
= 798/18
=44.33
µ2
=(113*1)+(117*2)+(130*2)+(131*2)+(143*2)+(144*1)+(145*1)+(149*7)+(150*1)+(160*1)+(170*1)+(177
*1)+(177*1)+(180*1)/14
=4597/30
=153.23
= 197.57/2
= 98.79
Stop
Else
T = T1+1 = 95.79
CSC566/Image Processing
Prepared by: Nur Nabilah Abu Mangshor
Nov 2020
2.T = 98.79
µ1
=(7*2)+(9*1)+(11*2)+(12*1)+(15*1)+(21*1)+(24*2)+(25*1)+(48*1)+(64*1)+(81*1)+(108*1)+(109*1)+(11
1*2)+(81*1)
= 359/14
=25.64
µ2
=
(108*1)+(109*1)+(111*2)+(113*1)+(117*2)+(130*2)+(131*2)+(143*2)+(144*1)+(145*1)+(149*7)+(150*
1)+(160*1)+(170*1)+(177*1)+(180*1)/42
=5036/34
=148.12
= 173.76/2
= 86.88
CSC566/Image Processing
Prepared by: Nur Nabilah Abu Mangshor
Nov 2020
3.T = 86.88
µ1
=(7*2)+(9*1)+(11*2)+(12*1)+(15*1)+(21*1)+(24*2)+(25*1)+(48*1)+(64*1)+(81*1)+(108*1)+(109*1)+(11
1*2)+(81*1)
= 359/14
=25.64
µ2
=
(108*1)+(109*1)+(111*2)+(113*1)+(117*2)+(130*2)+(131*2)+(143*2)+(144*1)+(145*1)+(149*7)+(150*
1)+(160*1)+(170*1)+(177*1)+(180*1)/42
=5036/34
=148.12
= 173.76/2
= 86.88
CSC566/Image Processing
Prepared by: Nur Nabilah Abu Mangshor
Nov 2020
If(f(x,y) > T1 +1 )
thenf(x,y) = 1 //region G1
Else
f(x,y)=0 //region G2
T1+1 = 86.88
1 1 0 1 1 1
1 1 0 0 1 1
1 1 0 0 0 1
1 1 0 0 0 0
1 1 0 0 0 0
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
CSC566/Image Processing
Prepared by: Nur Nabilah Abu Mangshor
Nov 2020