<s>
Adaptive	B-Algorithm
histogram	I-Algorithm
equalization	I-Algorithm
(	O
AHE	O
)	O
is	O
a	O
computer	B-Algorithm
image	I-Algorithm
processing	I-Algorithm
technique	O
used	O
to	O
improve	O
contrast	O
in	O
images	O
.	O
</s>
<s>
It	O
differs	O
from	O
ordinary	O
histogram	B-Algorithm
equalization	I-Algorithm
in	O
the	O
respect	O
that	O
the	O
adaptive	O
method	O
computes	O
several	O
histograms	B-Algorithm
,	O
each	O
corresponding	O
to	O
a	O
distinct	O
section	O
of	O
the	O
image	O
,	O
and	O
uses	O
them	O
to	O
redistribute	O
the	O
lightness	O
values	O
of	O
the	O
image	O
.	O
</s>
<s>
A	O
variant	O
of	O
adaptive	B-Algorithm
histogram	I-Algorithm
equalization	I-Algorithm
called	O
contrast	O
limited	O
adaptive	B-Algorithm
histogram	I-Algorithm
equalization	I-Algorithm
(	O
CLAHE	O
)	O
prevents	O
this	O
by	O
limiting	O
the	O
amplification	O
.	O
</s>
<s>
Ordinary	O
histogram	B-Algorithm
equalization	I-Algorithm
uses	O
the	O
same	O
transformation	O
derived	O
from	O
the	O
image	B-Algorithm
histogram	I-Algorithm
to	O
transform	O
all	O
pixels	O
.	O
</s>
<s>
Adaptive	B-Algorithm
histogram	I-Algorithm
equalization	I-Algorithm
(	O
AHE	O
)	O
improves	O
on	O
this	O
by	O
transforming	O
each	O
pixel	O
with	O
a	O
transformation	O
function	O
derived	O
from	O
a	O
neighbourhood	O
region	O
.	O
</s>
<s>
cited	O
in	O
In	O
its	O
simplest	O
form	O
,	O
each	O
pixel	O
is	O
transformed	O
based	O
on	O
the	O
histogram	B-Algorithm
of	O
a	O
square	O
surrounding	O
the	O
pixel	O
,	O
as	O
in	O
the	O
figure	O
below	O
.	O
</s>
<s>
The	O
derivation	O
of	O
the	O
transformation	O
functions	O
from	O
the	O
histograms	B-Algorithm
is	O
exactly	O
the	O
same	O
as	O
for	O
ordinary	O
histogram	B-Algorithm
equalization	I-Algorithm
:	O
The	O
transformation	O
function	O
is	O
proportional	O
to	O
the	O
cumulative	O
distribution	O
function	O
(	O
CDF	O
)	O
of	O
pixel	O
values	O
in	O
the	O
neighbourhood	O
.	O
</s>
<s>
Simply	O
copying	O
the	O
pixel	O
lines	O
on	O
the	O
border	O
is	O
not	O
appropriate	O
,	O
as	O
it	O
would	O
lead	O
to	O
a	O
highly	O
peaked	O
neighbourhood	O
histogram	B-Algorithm
.	O
</s>
<s>
Due	O
to	O
the	O
nature	O
of	O
histogram	B-Algorithm
equalization	I-Algorithm
,	O
the	O
result	O
value	O
of	O
a	O
pixel	O
under	O
AHE	O
is	O
proportional	O
to	O
its	O
rank	O
among	O
the	O
pixels	O
in	O
its	O
neighbourhood	O
.	O
</s>
<s>
When	O
the	O
image	O
region	O
containing	O
a	O
pixel	O
's	O
neighbourhood	O
is	O
fairly	O
homogeneous	O
regarding	O
to	O
intensities	O
,	O
its	O
histogram	B-Algorithm
will	O
be	O
strongly	O
peaked	O
,	O
and	O
the	O
transformation	O
function	O
will	O
map	O
a	O
narrow	O
range	O
of	O
pixel	O
values	O
to	O
the	O
whole	O
range	O
of	O
the	O
result	O
image	O
.	O
</s>
<s>
Ordinary	O
AHE	O
tends	O
to	O
overamplify	O
the	O
contrast	O
in	O
near-constant	O
regions	O
of	O
the	O
image	O
,	O
since	O
the	O
histogram	B-Algorithm
in	O
such	O
regions	O
is	O
highly	O
concentrated	O
.	O
</s>
<s>
Contrast	O
Limited	O
AHE	O
(	O
CLAHE	O
)	O
is	O
a	O
variant	O
of	O
adaptive	B-Algorithm
histogram	I-Algorithm
equalization	I-Algorithm
in	O
which	O
the	O
contrast	O
amplification	O
is	O
limited	O
,	O
so	O
as	O
to	O
reduce	O
this	O
problem	O
of	O
noise	O
amplification	O
.	O
</s>
<s>
This	O
is	O
proportional	O
to	O
the	O
slope	O
of	O
the	O
neighbourhood	O
cumulative	O
distribution	O
function	O
(	O
CDF	O
)	O
and	O
therefore	O
to	O
the	O
value	O
of	O
the	O
histogram	B-Algorithm
at	O
that	O
pixel	O
value	O
.	O
</s>
<s>
CLAHE	O
limits	O
the	O
amplification	O
by	O
clipping	O
the	O
histogram	B-Algorithm
at	O
a	O
predefined	O
value	O
before	O
computing	O
the	O
CDF	O
.	O
</s>
<s>
The	O
value	O
at	O
which	O
the	O
histogram	B-Algorithm
is	O
clipped	O
,	O
the	O
so-called	O
clip	O
limit	O
,	O
depends	O
on	O
the	O
normalization	O
of	O
the	O
histogram	B-Algorithm
and	O
thereby	O
on	O
the	O
size	O
of	O
the	O
neighbourhood	O
region	O
.	O
</s>
<s>
It	O
is	O
advantageous	O
not	O
to	O
discard	O
the	O
part	O
of	O
the	O
histogram	B-Algorithm
that	O
exceeds	O
the	O
clip	O
limit	O
but	O
to	O
redistribute	O
it	O
equally	O
among	O
all	O
histogram	B-Algorithm
bins	O
.	O
</s>
<s>
Adaptive	B-Algorithm
histogram	I-Algorithm
equalization	I-Algorithm
in	O
its	O
straightforward	O
form	O
presented	O
above	O
,	O
both	O
with	O
and	O
without	O
contrast	O
limiting	O
,	O
requires	O
the	O
computation	O
of	O
a	O
different	O
neighbourhood	O
histogram	B-Algorithm
and	O
transformation	O
function	O
for	O
each	O
pixel	O
in	O
the	O
image	O
.	O
</s>
<s>
A	O
histogram	B-Algorithm
,	O
CDF	O
and	O
transformation	O
function	O
is	O
then	O
computed	O
for	O
each	O
of	O
the	O
tiles	O
.	O
</s>
<s>
An	O
alternative	O
to	O
tiling	O
the	O
image	O
is	O
to	O
"	O
slide	O
"	O
the	O
rectangle	O
one	O
pixel	O
at	O
a	O
time	O
,	O
and	O
only	O
incrementally	O
update	O
the	O
histogram	B-Algorithm
for	O
each	O
pixel	O
,	O
by	O
adding	O
the	O
new	O
pixel	O
row	O
and	O
subtracting	O
the	O
row	O
left	O
behind	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
denoted	O
SWAHE	O
(	O
Sliding	O
Window	O
Adaptive	B-Algorithm
Histogram	I-Algorithm
Equalization	I-Algorithm
)	O
by	O
the	O
original	O
authors	O
.	O
</s>
<s>
The	O
computational	O
complexity	O
of	O
histogram	B-Algorithm
calculation	O
is	O
then	O
reduced	O
from	O
O(N² )	O
to	O
O(N )	O
(	O
with	O
N	O
=	O
pixel	O
width	O
of	O
the	O
surrounding	O
rectangle	O
)	O
;	O
and	O
since	O
there	O
is	O
no	O
tiling	O
a	O
final	O
interpolation	O
step	O
is	O
not	O
required	O
.	O
</s>
