What is segmentation? INF 5300

advertisement
INF 5300
13.02.2008
Non-contextual thresholding
Adaptive thresholding
Fritz Albregtsen
F2 13.02.08
INF 5300
1
What is segmentation?
• A process that splits the image into
meaningful regions.
• One of the most important steps in a
complete image analysis system.
• In segmentation we get regions and
objects that we may later describe and
recognize.
• In the simplest case we have only two
classes:
– Foreground
– Background
F2 13.02.08
Example:
find symbols for OCR
INF 5300
2
Challenges in segmentation
• The problem is simple if we have only one object region,
and the object is homogeneous.
• More often, we have several
objects within the image.
• Same class objects are
seldom quite similar.
• Several classes of objects are
often present at the same time.
• Illumination may vary.
• Reflection, color etc. may
may vary over each object.
Where is the object?
F2 13.02.08
INF 5300
3
Thresholding
g
• From an input image f(x,y) having a bimodal
histogram we may produce a binary output image
g(x,y) by the mapping:
⎧ 0 if 0 ≤ f ( x , y ) ≤ T
g ( x, y ) = ⎨
⎩1 if T < f ( x , y ) ≤ G − 1
• The output image g(x,y)
has only two possible values.
• By a proper choice of T all pixels
having g(x,y)=1 will be object pixels.
F2 13.02.08
INF 5300
f
4
Multilevel thresholding
• If we have several classes of objects,
having different intensities,
we may extend this to M graylevel intervals
by using M-1 thresholds:
0 ≤ f ( x, y ) ≤ t1
if
⎧ 0
⎪ 1
if
⎪
g ( x, y ) = ⎨
⎪ ...
⎪⎩ M − 1 if
t1 < f ( x, y ) ≤ t2
tM −1 < f ( x, y ) ≤ G − 1
• Thresholding is a simplified case of classification.
• It is also similar to histogram transform
using just a few graylevels.
F2 13.02.08
INF 5300
5
Two Gaussian distributions
D=µ2-µ1=2σ
• Two Gaussians, same σ.
• Equal a priori probabilities.
• Bimodality determined by D.
D=µ2-µ1=3σ
0,032
0,032
0
0
0
8
16
24
32
40
48
56
0
8
16
24
32
40
48
56
0,04
0,04
• Unequal probabilities.
• Bimodality determined by D.
0
0
0
8
16
24
32
40
48
56
0,05
0
8
16
24
32
40
48
56
0
8
16
24
32
40
48
56
0,05
• Very unequal probabilities.
• Unimodal even for large D.
0
0
0
F2 13.02.08
8
INF 5300
16
24
32
40
48
56
6
Bimodality in local windows
• Even in (almost) binary images, local bimodality of
histogram is determined by the fraction of each class
falling within local window.
Bimodal, OK fraction
Bimodal, small fraction
Unimodal
F2 13.02.08
INF 5300
7
Histograms, normalized, scaled
• An example (G=64):
• Two Gaussians
0,15
– (background and foreground)
• µ1 = 16 , σ1 = 3
• µ2 = 36 , σ2 = 8
• Normalized histograms:
0
• Scaled by a priori
0
8
16
24
32
40
48
56
0
8
16
24
32
40
48
56
0,04
probabilities
P1 =0.2, P2 = 1-P1 = 0.8
•
This is the actual histogram!
• Both the minimum and the
optimal threshold are shifted.
F2 13.02.08
INF 5300
0
8
Classification error by thresholding
- Background
- Foreground
Threshold t
Foreground classified as
background by threshold t
Background classified as
foreground by threshold t
F2 13.02.08
INF 5300
9
Classification error by thresholding
•
•
•
•
Given a histogram that is a sum of two distributions b(z) and f(z).
b and f are normalized background and foreground histograms.
Let B and F be a priori probabilities (B+F=1)
The normalized image histogram is then
p ( z ) = B ⋅ b( z ) + F ⋅ f ( z )
• The probabilities of erroneous classification of a pixel, given a
threshold value t, may be found from the normalized distributions:
t
EB (t ) =
∫ f ( z )dz
−∞
∞
EF (t ) = ∫ b( z )dz
t
F2 13.02.08
INF 5300
10
The total error
• We have found the fraction of orror for each distribution.
• The total error is obtained by multiplication with the
a priori probabilities of foreground and background:
E (t ) = F ⋅ EB (t ) + B ⋅ E F (t )
=F
t
∞
−∞
t
∫ f ( z )dz + B ∫ b( z )dz
• A high or a low threshold gives a big error.
• We seek the minimum error,
and the corresponding t = T.
F2 13.02.08
INF 5300
11
Find the T that minimizes the error
t
∞
−∞
t
E (t ) = F ∫ f ( z )dz + B ∫ b( z )dz
• The derivative of E(t) with respect to t
from Leibnitz’ Rule for derivation of integrals.
• Minimum => derivative = 0 :
IMPORTANT
!!!
dE (t )
= 0 ⇒ F ⋅ f (T ) = B ⋅ b(T )
dt
• Note that this is a general solution of the problem.
• There are no restrictions on the distributions b og f !
F2 13.02.08
INF 5300
12
Thresholding of two Gaussians
• Assume that background- and foreground intensities are
given by two Gaussian distributions, b(z) and f(z),
so that the normalized histogram may be written as
p( z ) =
B
e
σ B 2π
−
( x − µB )2
2σ B 2
+
−
F
( x − µF )2
e
σ F 2π
2σ F 2
• F and B are the two a priori probabilities.
• µB and µF are the mean values.
• σB2 and σF2 are the variances.
F2 13.02.08
INF 5300
13
Optimal solution – two Gaussians
F ⋅ f (T ) = B ⋅ b(T )
• An optimal solution is given by
• Substituting for b(z) og f(z):
B
e
σ B 2π
−
( T − µ B )2
2σ B
2
=
F
σ F 2π
−
e
( T − µ F )2
2σ F 2
• Simplifying and using the logarithm:
(T − µ B )2 − ln⎛⎜ B ⎞⎟ = (T − µ F )2 − ln⎛⎜ F ⎞⎟
⎜σ ⎟
⎜σ ⎟
2σ B2
2σ F2
⎝ F⎠
⎝ B⎠
• We get the equation:
(σ B2 − σ F2 )T 2 + 2(µBσ F2 − µFσ B2 )T + σ B2 µF2 − σ F2 µB2 + 2σ B2σ F2 ln⎛⎜⎜ BFσσ F ⎞⎟⎟ = 0
B ⎠
⎝
• We may have two solutions for T.
F2 13.02.08
INF 5300
14
Two thresholds - when?
• If the standard deviations of the two Gaussians are different
– and the intersection of the distributions (scaled by a priori probability)
is within the range of image graylevels.
0,032
• One threshold value
for each intersection.
• For pixel values
between the two thresholds,
the majority are background.
• Elsewhere,
the majority are foreground.
0
0
F2 13.02.08
8
16
24
32
40
48
56
INF 5300
15
Where is the optimal threshold?
• Given the equation:
⎛ Bσ F
− σ F2 T 2 + 2 µ Bσ F2 − µ F σ B2 T + σ B2 µ F2 − σ F2 µ B2 + 2σ B2 µ F2 ln⎜⎜
⎝ Fσ B
• Assuming (σB= σF= σ) we may simplify:
(σ
2
B
)
(
)
⎞
⎟⎟ = 0
⎠
⎛B⎞
2( µ B − µ F )T − ( µ B + µ F )( µ B − µ F ) + 2σ 2 ln⎜ ⎟ = 0
⎝F⎠
c
σ2
(µ B + µ F )
⎛F⎞
T=
+
ln⎜ ⎟
2
(µ B − µ F ) ⎝ B ⎠
• If F ≈ B, we have a very simple solution:
T=
F2 13.02.08
( µB + µF )
2
INF 5300
16
What if we assume PB=PF
• An example:
• µB = 20 and µF= 44,
σF = σB = 8,
gives
T = (µF+µB)/2= 32
which is an OK threshold,
even though PB =0.6 ≠ PF.
0,032
0
0
8
16
24
32
40
48
56
40
48
56
0,05
• For PB =0.9 ≠ PF
the error will be significant.
0
0
F2 13.02.08
8
16
24
32
INF 5300
17
When parameters are unknown ...
• We are to threshold an image.
• We do not know B, F, µB, µF,, σB or σF .
• We may estimate µB and µF , given an initial threshold
value tk that we re-compute iteratively:
G −1
⎤
⎡ tk
1
1 ⎢ ∑ z =0 zp ( z ) ∑ z =tk +1 zp ( z ) ⎥
t k +1 = [µ1 (t k ) + µ 2 (t k )] =
+
2
2 ⎢ ∑tk p ( z ) ∑G −1 p ( z ) ⎥
z =t k +1
⎦
⎣ z =0
• The class means µ1(tk) and µ2(tk) are estimated from
truncated distributions (truncated at the threshold tk)
F2 13.02.08
INF 5300
18
The method of Ridler and Calvard
1.
2.
3.
4.
Initial threshold value t = mean value of all image pixels
Find mean (µ1(t)) of all pixels darker than threshold
Find mean (µ2(t)) of all pixels brighter than threshold.
Let new threshold value be given by
tk +1 =
1
[µ1 (tk ) + µ2 (tk )]
2
5. Repeat 2 – 4 until threshold value converges.
F2 13.02.08
INF 5300
19
Generalization to multi-thresholding
• The algorithm may be generalized to M thresholds:
• Select a set of initial thresholds: t1, t2, ..., tM
• Iteratively compute new set of thresholds until all M
thresholds converge:
t1 =
µ (0, t1 ) + µ (t1 + 1, t 2 )
2
M
tM =
µ (t M −1 , t M ) + µ (t M + 1, G − 1)
2
• The procedure usually converges rapidly.
F2 13.02.08
INF 5300
20
Otsu’s method - motivation
• Given a G graylevel image, f(x,y) =i, [0 ≤ i ≤ G]
having a normalized histogram p(i).
• Motivation:
We seek a threshold value T so that
– The classes are homogeneous:
minimize the within-class variances.
– The separation between the calsses is large:
maximize the difference of means.
F2 13.02.08
INF 5300
21
Otsu’s method – getting started
• A posteriori probabilities of the two classes:
t
P1 (t ) = ∑ p (i ),
P2 (t ) =
i =0
G −1
∑ p(i) = 1 − P (t )
1
i =t +1
• Mean gray level values within the two classes:
∑
µ (t ) =
∑
∑
µ (t ) =
∑
t
i =0
t
1
i =0
ip(i )
p (i )
G −1
i =t +1
G −1
2
i =t +1
=
ip(i )
p (i )
µ (t )
P1 (t )
∑
t
µ (t ) ≡ ∑ ip(i )
,
i =0
ip(i ) − ∑i =0 ip(i )
G −1
=
i =0
t
P2 (t )
=
µ − µ (t )
1 − P1 (t )
,
µ ≡ ∑i =0 ip(i )
G −1
• Variance within the two classes:
σ
2
1
∑ [i − µ (t )] p(i ) =
(t ) =
σ
2
2
∑ [i − µ (t )] p(i ) =
(t ) =
2
t
i =0
1
P1 (t )
G −1
F2 13.02.08
i =t +1
2
2
P2 (t )
1
[i − µ1 (t )]2 p(i )
P1 (t )
1
[i − µ2 (t )]2 p(i )
1 − P1 (t )
INF 5300
22
Otsu’s metode – I
The total variance is defined by
σ
2
Tot
G −1
= ∑ (i − µ ) 2 p (i )
i =0
and may be split into
σ
t
G −1
= ∑ (i − µ ) p(i ) + ∑ (i − µ ) 2 p(i )
2
Tot
2
i =0
i =t +1
In each summation we may add and subtract the a posteriori class means
2
t
G −1
2
σ Tot
= ∑ [i − µ1 (t ) + µ1 (t ) − µ ] p(i ) + ∑ [i − µ2 (t ) + µ2 (t ) − µ ] 2 p(i )
i =0
i =t +1
2
t
2
t
t
= ∑ [i − µ1 (t )] p(i ) + ∑ [µ1 (t ) − µ ] p (i ) + 2∑ [i − µ1 (t )][µ1 (t ) − µ ] p(i )
i =0
+
i =0
2
G −1
i =0
2
G −1
G −1
∑ [i − µ (t )] p(i ) + ∑ [µ (t ) − µ ] p(i ) + 2 ∑ [i − µ (t )][µ (t ) − µ ]p(i )
2
2
i =t +1
2
i = t +1
2
i =t +1
F2 13.02.08
INF 5300
23
Otsu’s method – II
The first part of each of the last two lines may be expressed by the
definitions of σ12(t) and σ22(t).
The second part may be expressed by P1(t) and P2(t), since µ, µ1(t)
and µ2(t) are independent of the summation variable
i. Hence:
t
2
2
2
σ Tot = P1 (t )σ 1 (t ) + (µ1 (t ) − µ ) P1 (t ) + 2(µ1 (t ) − µ )∑ [i − µ1 (t )]p(i )
i =0
G −1
+ P2 (t )σ 22 (t ) + (µ2 (t ) − µ ) P2 (t ) + 2(µ2 (t ) − µ ) ∑ [i − µ2 (t )]p (i )
i =t +1
The two sums at the end are zero, because
2
t
t
t
i =0
i =0
i =0
∑ [i − µ1 (t )]p(i ) =∑ ip(i ) − ∑ µ1 (t ) p(i ) = µ1 (t ) P1 (t ) − µ1 (t ) P1 (t ) = 0.
G −1
G −1
G −1
i =t +1
i =t +1
i =t +1
∑ [i − µ2 (t )]p(i ) = ∑ ip(i ) − ∑ µ2 (t ) p(i ) = µ2 (t ) P2 (t ) − µ2 (t ) P2 (t ) = 0.
The total variance is the sum of σW(t) and σB(t) !
2
2
2
σ Tot
= P1 (t )σ 12 (t ) + (1 − P1 (t ) )σ 22 (t ) + (µ1 (t ) − µ ) P1 (t ) + (µ2 (t ) − µ ) (1 − P1 (t ) ) = σ W2 (t ) + σ B2
F2 13.02.08
INF 5300
24
Otsu’s method:
• We want to minimize σW2(t) and simultaneously maximize σB2(t)
• Since σTot2 is constant: find t that maximizes σB2(t).
• The expression for B2(t) can be written as (see previous page):
σ B2 (t ) = (µ1 (t ) − µ )2 P1 (t ) + (µ2 (t ) − µ )2 (1 − P1 (t ))
2
2
⎡ µ (t )
⎤
⎡ µ − µ (t )
⎤
=⎢
− µ ⎥ P1 (t ) + ⎢
− µ ⎥ (1 − P1 (t ))
⎣ P1 (t )
⎦
⎣ 1 − P1 (t )
⎦
=
=
[µ (t ) − µP1 (t )]2 + [µ − µ (t ) − µ + µP1 (t )]2
1 − P1 (t )
P1 (t )
[µ (t ) − µP1 (t )]2 (1 − P1 (t ) ) + P1 (t )[− µ (t ) + µP1 (t )]2
P1 (t )(1 − P1 (t ))
[µ (t ) − µP1 (t )]
2
=
P1 (t )(1 − P1 (t ))
• Otsu’s method: Search for maximum value of σB2(t)
for all values of t where 0 < P1(t)< 1.
F2 13.02.08
INF 5300
25
Minimum error thresholding
•
•
Kittler and Illingworth (1985) assume a mixture of two Gaussian distributions.
Find T that minimizes the Kullback-Leibler distance between observed
histogram and model distribution:
J (t ) = 1 + 2[P1 (t ) ln σ 1 (t ) + P2 (t ) ln σ 2 (t )]
− 2[P1 (t ) ln P1 (t ) + P2 (t ) ln P2 (t )]
•
•
•
•
•
As t varies, all five model parameters change.
Compute J(t) for all t; find minimum.
The criterion function has local minima at the boundaries of the gray scale.
An unfortunate starting value for an iterative search
may cause the iteration to terminate at a nonsensical threshold value.
Use Otsu’s threshold as starting value for iterative search.
F2 13.02.08
INF 5300
26
A comparison
• For PB =0.9, PF =0.1, µB = 20, µF= 44, σF = σB = 8:
• The Otsu threshold is significantly in error.
• The Kittler and Illingworth threshold is OK.
0,05
0,05
0
0
0
8
16
24
32
40
48
F2 13.02.08
56
0
8
16
24
32
40
48
56
INF 5300
27
Uniform error thresholding
•
•
•
A uniform error threshold implies that E1(t) = E2(t)
Suppose we knew the background area α(t), and class membership of pixels.
For a given threshold t, let
• p(t) = fraction of background pixels above t
• q(t) = fraction of object pixels with gray level above t.
•
•
The uniform error threshold is then found when
p(t) = 1 – q(t) Ù φ – 1 = 0, where φ = p + q
Now define
a = Probability of (one pixel gray level > t)
b = Probability of (two neighbouring pixels both > t)
c = Probability of (four neighbouring pixels all > t)
•
•
We may find these probabilities by examining all 2 x 2 neighbourhoods.
Alternatively, the above probabilities may be written
a = α p + (1 – α) q
b = α p2 + (1 – α) q2
c = α p4 + (1 – α) q4
F2 13.02.08
INF 5300
28
Uniform error thresholding - II
•
Now we note that
[
[
]
]
b2 − c (α 2 − α ) p 4 + 2αp 2 q 2 (1 − α ) + (1 − α ) − (1 − α ) q 4 ( p 2 − q 2 )
2
= 2
=
= ( p + q) = ϕ 2
2
2
2
2
2
a − b (α − α ) p + 2αpq(1 − α ) + (1 − α ) − (1 − α ) q
( p − q)
2
2
•
•
Select gray level t where |φ – 1| is a minimum.
|φ – 1| is a monotonously decreasing function => Root-finding algorithm.
•
No assumptions about underlying distributions, or about a priori
probabilities. Only estimates of a, b and c for each trial value of t.
•
For all 2 x 2 neighbourhoods,
pixels g1, g2, g3, g4 are sorted.
•
In a single pass through the image,
a table may be formed,
giving estimates of (a, b, c)
for all values of t.
Compute φ from (a, b, c)
and find t that gives |φ – 1|minimum
•
F2 13.02.08
threshold
singles pairs 4-tuples
t < g1
4
6
g1≤t≤g2
3
3
g2≤t≤g3
2
1
g3≤t≤g4
1
1
INF 5300
29
Cooccurrence matrices
• Cooccurrence matrices (GLCM) are 2-D histograms.
• Quantify the occurrence of
– A pixel having graylevel i while a neighboring pixel
at a distance d in a direction θ has graylevel j.
• We may write this as C(i,j|d,θ).
– For (d,θ) = (1,0) we regard the nearest neighbor in x-direction
– For (d,θ) = (1,π/2) we regard first neighbor in y-direction
• We may add matrices from two directions:
0.5*[C(i,j|d=1,θ=0) + C(i,j|d=1,θ=π/2)]
gives a cooccurrence matrix in both directions (x and y).
F2 13.02.08
INF 5300
30
GLCM thresholding
• Given a coccurrence matrix C(i,j|d,θ).
• Find the threshold that gives the minimum number of
transitions from 0 to 1 or 1 to 0 horizontally and vertically.
0
• Number of transitions from 0 to 1
Obf =
G −1
T
T
∑ ∑ c (i , j | d , θ )
• Number of transitions from 1 to 0
O fb = ∑
bb
bf
fb
ff
T
i =T +1 j =0
T
G-1
G −1
∑ c (i , j | d , θ )
G-1
i =0 j =T +1
j
• Least complexity: Find T to minimize Obf + Ofb
F2 13.02.08
INF 5300
31
Entropy-based thresholding
• For two distributions separated by a threshold t
the sum of the two class entropies is
t
• Using
ψ (t ) = − ∑
z =0
t
⎡ p( z ) ⎤
p ( z ) ⎡ p( z ) ⎤ G −1 p ( z )
−∑
ln ⎢
ln ⎢
⎥
P1 (t ) ⎣ P1 (t ) ⎦ z =t +11 − P1 (t ) ⎣1 − P1 (t ) ⎥⎦
H (t ) = − ∑ p( z ) ln[ p( z )],
z =0
G −1
H (G ) = − ∑ p( z ) ln[ p( z )]
z =0
the sum of the two entropies may be written as
H ( t ) H (G ) − H ( t )
ψ (t ) = ln[P1 (t )(1 − P1 (t ) )] +
+
P1 (t )
1 − P1 (t )
• The discrete value T of t which maximizes ψ(t)
is the threshold that maximizes the information gain.
F2 13.02.08
INF 5300
32
i
Two-feature entropy
• For two distributions and a threshold pair (s,t) where
(s; t) denote e.g. gray level and local average gray level,
the sum of the two entropies is
⎡ p ⎤ G −1 G −1 pij
⎡ p ⎤
ln ⎢ ij ⎥ − ∑ ∑
ln ⎢ ij ⎥
i =0 j =0 Pst
⎣ Pst ⎦ i = s +1 j =t +1 1 − Pst ⎣1 − Pst ⎦
s
t
H
H − H st
= ln[Pst (1 − Pst )]+ st + GG
,
Pst = ∑∑ pij
Pst
1 − Pst
i =0 j =0
s
t
ψ ( s, t ) = − ∑∑
pij
• where the system entropy HGG and partial entropy Hst are
H GG = −
G −1 G −1
∑
∑ pij ln( pij ), H st = − ∑∑ pij ln( pij )
s
i = s +1 j =t +1
t
i =0 j =0
• The discrete pair (S; T) which maximizes ψ(s; t)
are now the threshold values which maximize
the gain in information by introducing the two thresholds.
F2 13.02.08
INF 5300
33
Exponential Convex Hull
• ”Convex deficiency” obtained by {convex hull – histogram}.
• This may work even if no ”valley” exists.
• Upper concavity of histogram tail regions eliminated
by considering ln{p(z)} instead of the histogram p(z).
• In ln{p(z)}-domain, upper concavities are produced by bimodality or
shoulders, not by tail of normal or exponential, nor by extension of
histogram.
–
–
–
–
Transform histogram p(z) by ln{p(z)},
compute the convex hull,
transform convex hull back to histogram domain by he(k) = exp(h(k)),
compute exponential convex hull deficiency.
• Threshold is found by sequential search for maximum exponential
convex hull deficiency.
F2 13.02.08
INF 5300
34
Adaptive thresholding
• Local variations in background
and contrast may be handled.
• One may use
– Overlapping windows
– non-overlapping windows
• Window size may be important ...
F2 13.02.08
INF 5300
35
Nieblack’s method ...
• Compute mean and standard deviation within a moving
(w x w) vindow.
• Let the local threshold value be given by
t (i , j ) = µ (i , j ) + k σ (i , j )
• Let the output image be given by
⎧ 0 hvis f (i, j ) ≤ t (i, j )
g (i , j ) = ⎨
⎩1 hvis f (i, j ) > t (i, j )
• Ex.: for w = 31, k = - 0.8 :
F2 13.02.08
INF 5300
36
Bernsen’s method
• One of thee simplest locally adaptive methods:
• For each pixel:
– Find highest and lowest pixel value within w x w window centered at (x,y)
– If window contrast zhigh – zlow > C
• Let threshold be given by
t ( x, y ) =
(z
high
− zlow )
2
– If contrast is too low, window contains only one class
– Image noise may be a problem:
• Use second highest/lowest pixel value
F2 13.02.08
INF 5300
37
Adaptiv thresholding by interpolation
• This is known as Chow and Kaneko’s method,
but several variations on the theme exist!
– LEVEL I: divide image into sub-images.
• For sub-images having bi-modal histogram:
– Find local threshold value Tc(i,j)
assign this to center pixel (i,j) of window.
• For sub-images having uni-modal histogram:
– Find local threshold value by interpolation.
– LEVEL II: Pixel-by-pixel interpolation:
• Run through all pixel positions
– Find adaptive threshold value T(x,y)
by interpolation between the local threshold values Tc(i,j).
• Finally, threshold each pixel value f(x,y) of image by T(x,y).
F2 13.02.08
INF 5300
38
A variation on Otsu’s method
• Eikvil, Taxt, Moen’s method:
• Uses two concentric windows:
a small window S inside a larger window L.
• Compute Otsu’s threshold T based on all pixels within L.
• If difference between class means > C,
– then pixels within S are thresholded using threshold value T.
• If difference between class means < C
– all pixels of S are assigned to class with closest mean.
• Uses non-overlapping windows S.
F2 13.02.08
INF 5300
39
Yanowitz and Bruckstein’s method
• A gradient magnitude image is computed, using one out
of many available methods (Sobel, Canny, ...).
• A potential surface passing through the image at local
maxima of the gradient is used as thresholding surface.
• The image is binarized using this thresholding surface.
• For all detected objects:
– Perform edge following of pixels 4-connected to background.
– If average gradient of these pixels < Tp, remove object.
F2 13.02.08
INF 5300
40
Thresholding summary- I
• Given two distributions f(z) and b(z), the minimum error
threshold is ALWAYS found at the intersection
dE (t )
=0
dt
⇒
F ⋅ f (T ) = B ⋅ b(T )
• Ridler and Calvard’s method is simple and useful
– Provided the a priori probabilities arn’t too different.
• Otsu’s method will maximize the separation of two
Gaussian distributions having similar P and σ.
• Kittler and Illingworth’s method handles different P and σ.
• There are a number of interesting alternatives!
F2 13.02.08
INF 5300
41
Thresholding summary- II
• Locally adaptive methods based on one running window:
– Nieblack’s method based on mean and standard deviation.
– Bernsen’s method based on highest and lowest pixel value.
• Locally adaptive methods based on two running windows:
– Eikvil et al.’s method extracts Otsu threshold from large window,
applies threshold to smaller window.
• Methods based on interpolation:
– Chow and Kaneko’s method uses two levels of interpolation.
• Methods based on gradient magnitude:
– Yanowitz and Bruckstein’s method uses potential surface passing
through the image at local maxima of the gradient
• A validation step that may improve almost any method:
– Check that edge of object coincides with high gradient in image.
F2 13.02.08
INF 5300
42
Download