Está en la página 1de 7

OtsusThresholdingMethod (1979)

Basedonaverysimpleidea:Findthe
thresholdthatminimizestheweighted
withinclassvariance.
Thisturnsouttobethesameasmaximizing
thebetweenclassvariance.
Operatesdirectlyonthegraylevel
histogram[e.g.256numbers,P(i)],soits
fast(oncethehistogramiscomputed).

Otsu:Assumptions
Histogram(andtheimage)arebimodal.
Nouseofspatialcoherence,noranyother
notionofobjectstructure.
Assumesstationarystatistics,butcanbe
modifiedtobelocallyadaptive.(exercises)
Assumesuniformillumination(implicitly),
sothebimodalbrightnessbehaviorarises
fromobjectappearancedifferencesonly.

Theweightedwithinclassvarianceis:

(t) q1 (t) (t) q2 (t) (t)


2
w

2
1

2
2

Wheretheclassprobabilitiesareestimatedas:
t

q1 (t) P(i)

q2 (t)

i 1

P(i)

i t 1

Andtheclassmeansaregivenby:
I

iP(i)
1 (t)
i 1 q1 (t)

iP(i)
2 (t)
i t 1 q2 (t )

Finally,theindividualclassvariancesare:
t

P(i)
(t) [i 1 (t)]
q1 (t)
i1
2
1

P(i)
(t) [i 2 (t)]
q2 (t)
i t 1
2
2

Now,wecouldactuallystophere.Allweneedtodoisjust
runthroughthefullrangeoftvalues[1,256]andpickthe
w2 (t)
valuethatminimizes.
Buttherelationshipbetweenthewithinclassandbetween
classvariancescanbeexploitedtogeneratearecursion
relationthatpermitsamuchfastercalculation.

Between/Within/TotalVariance
Thebookgivesthedetails,butthebasic
ideaisthatthetotalvariancedoesnot
dependonthreshold(obviously).
Foranygiventhreshold,thetotalvarianceis
thesumofthewithinclassvariances
(weighted)andthebetweenclassvariance,
whichisthesumofweightedsquared
distancesbetweentheclassmeansandthe
grandmean.

Aftersomealgebra,wecanexpressthetotalvarianceas...

(t) q1 (t)[1 q1 (t)][1 (t) 2 (t)]


2

2
w

Withinclass,
frombefore

2
Betweenclass, B (t)

Sincethetotalisconstantandindependentoft,theeffectof
changingthethresholdismerelytomovethecontributionsof
thetwotermsbackandforth.
So,minimizingthewithinclassvarianceisthesameas
maximizingthebetweenclassvariance.
Thenicethingaboutthisisthatwecancomputethequantities
2

inrecursivelyaswerunthroughtherangeoftvalues.
B (t)

Finally...
Initialization...

q1 (1) P(1) ; 1 (0) 0

Recursion...
q1 (t 1) q1 (t) P(t 1)

q1 (t) 1 (t) (t 1)P(t 1)


1 (t 1)
q1 (t 1)

q1 (t 1)1 (t 1)
2 (t 1)
1 q1 (t 1)

También podría gustarte