<s>
In	O
image	B-Algorithm
processing	I-Algorithm
,	O
the	O
balanced	B-Algorithm
histogram	I-Algorithm
thresholding	I-Algorithm
method	O
(	O
BHT	O
)	O
,	O
is	O
a	O
very	O
simple	O
method	O
used	O
for	O
automatic	O
image	O
thresholding	B-Algorithm
.	O
</s>
<s>
Like	O
Otsu	B-Algorithm
's	I-Algorithm
Method	I-Algorithm
and	O
the	O
Iterative	O
Selection	O
Thresholding	B-Algorithm
Method	O
,	O
this	O
is	O
a	O
histogram	B-Algorithm
based	O
thresholding	B-Algorithm
method	O
.	O
</s>
<s>
The	O
BHT	O
method	O
tries	O
to	O
find	O
the	O
optimum	O
threshold	O
level	O
that	O
divides	O
the	O
histogram	B-Algorithm
in	O
two	O
classes	O
.	O
</s>
<s>
This	O
method	O
weighs	O
the	O
histogram	B-Algorithm
,	O
checks	O
which	O
of	O
the	O
two	O
sides	O
is	O
heavier	O
,	O
and	O
removes	O
weight	O
from	O
the	O
heavier	O
side	O
until	O
it	O
becomes	O
the	O
lighter	O
.	O
</s>
<s>
Given	O
its	O
simplicity	O
,	O
this	O
method	O
is	O
a	O
good	O
choice	O
as	O
a	O
first	O
approach	O
when	O
presenting	O
the	O
subject	O
of	O
automatic	O
image	O
thresholding	B-Algorithm
.	O
</s>
<s>
The	O
following	O
listing	O
,	O
in	O
C	B-Language
notation	O
,	O
is	O
a	O
simplified	O
version	O
of	O
the	O
Balanced	B-Algorithm
Histogram	I-Algorithm
Thresholding	I-Algorithm
method	O
:	O
</s>
<s>
The	O
following	O
,	O
is	O
a	O
possible	O
implementation	O
in	O
the	O
Python	B-Language
language	I-Language
:	O
</s>
