EC
E/O
PT
I533 Digital Im
age Processing class notes 137 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
MO
TIVA
TION
•R
ecord
ed
ima
ges o
ften
exh
ibit p
rob
lem
s s
uch
as:
• to
o d
ark
• to
o lig
ht
• n
ot e
nou
gh
con
trast
•Im
ag
e e
nh
an
cem
en
t aim
s to
imp
rove v
isu
al q
ua
lity
“Cosm
etic
” p
rocessin
g
•U
su
ally
em
piric
al te
ch
niq
ues, w
ith a
d h
oc p
ara
mete
rs (“
wh
ate
ver
work
s”)
•D
istin
ct fro
m “
resto
ratio
n,”
wh
ich
is p
rocessin
g d
esig
ned
to
recover tru
e o
bje
ct u
sin
g b
lur a
nd
nois
e re
du
ctio
n o
n a
deg
rad
ed
im
ag
e
EC
E/O
PT
I533 Digital Im
age Processing class notes 138 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
IMA
GE D
ISPLA
Y
•In
pu
t qu
an
tized
ima
ge p
ixel v
alu
es (in
teg
ers
): Dig
ital N
um
ber
(DN
)
•O
utp
ut q
ua
ntiz
ed
ima
ge p
ixel v
alu
es (in
teg
ers
): Gre
y L
evel (G
L)
GLs a
re in
dis
pla
y s
pa
ce, ty
pic
ally
[0..2
55
] in e
ach
colo
r (red
, gre
en, b
lue)
DN
1LU
TGL
RD
/A
RGB
DN
2LU
TGL
GD
/A
DN
3LU
TGL
BD
/A
RGB
colo
r im
ag
e
EC
E/O
PT
I533 Digital Im
age Processing class notes 139 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
•M
ap
pin
g fro
m D
Ns to
GLs m
ay b
e d
on
e w
ith d
iscre
te h
ard
wa
re o
r softw
are
Look-U
p Ta
ble
s (L
UTs
)
•Con
trast e
nh
an
cem
en
t tech
niq
ues a
re d
esig
ned
to fin
d a
LU
T tha
t yie
lds “
op
tima
l,” o
r at le
ast “
good
,” d
isp
layed
vis
ua
l qu
ality
Resu
lt is a
rad
iom
etric
en
ha
ncem
en
t of th
e d
isp
layed
ima
ge, i.e
fea
ture
s in
the
ima
ge b
ecom
e m
ore
ea
sily
seen
GL
LU
TD
N(
)=
EC
E/O
PT
I533 Digital Im
age Processing class notes 140 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
IMA
GE S
TATIS
TICS
•Glo
ba
l ima
ge D
N s
tatis
tics u
sefu
l fo
r desig
nin
g a
n im
ag
e-s
pecific
LU
T fo
r en
tire im
ag
e
•Loca
l ima
ge D
N s
tatis
tics u
sefu
l for
“a
da
ptiv
e” c
on
trast e
nh
an
cem
en
t a
lgorith
m, w
ith v
ary
ing
LU
T acro
ss
ima
ge
•N
eig
hb
orh
ood D
N s
tatis
tics u
sefu
l fo
r nois
e p
rocessin
g a
nd
sp
atia
l filte
ring
en
ha
ncem
en
t, not c
on
trast
en
ha
ncem
en
t“g
lob
al”
“lo
ca
l”
“n
eig
hb
orh
ood
”
EC
E/O
PT
I533 Digital Im
age Processing class notes 141 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
Ima
ge H
isto
gra
m
•N
um
ber o
f pix
els
with
the s
pecific
D
N, ta
bu
late
d fo
r all D
Ns
•D
ivid
e b
y th
e to
tal n
um
ber o
f pix
els
in
the im
ag
e N
to n
orm
aliz
e
An
alo
gou
s to
the c
on
tinu
ou
s P
rob
ab
ility
Den
sity
Fu
nctio
n (P
DF) o
f sta
tistic
s
•Con
tain
s n
o in
form
atio
n a
bou
t the
sp
atia
l dis
tribu
tion
of p
ixels
histD
Npixel count
DN
()
=
no
rmh
istDN
countD
N(
)N⁄
PD
FD
N(
)≈
=
Exa
mp
le n
orm
aliz
ed
ima
ge
his
tog
ram
com
pa
red
to th
e
eq
uiv
ale
nt G
au
ssia
n
dis
tribu
tion
0
0.05
0.1
0.15
020
4060
80100
Gaussian
image
fraction of total pixels
DN
µµ
+ σµ
− σ
EC
E/O
PT
I533 Digital Im
age Processing class notes 142 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
Cu
mu
lativ
e H
isto
gra
m
•N
um
ber o
f pix
els
with
a D
N le
ss
tha
n o
r eq
ua
l to th
e s
pecifie
d D
N
•D
ivid
e b
y th
e to
tal n
um
ber o
f pix
els
in
the im
ag
e N
to n
orm
aliz
e
An
alo
gou
s to
the C
um
ula
tive D
istrib
utio
n
Fu
nctio
n (C
DF) o
f sta
tistic
s
•M
on
oto
nic
fun
ctio
n o
f DN
chistD
Nh
istDN
DN
DN
min
= DN
∑=
no
rmch
istDN
chistD
NN⁄
CD
FD
N(
)≈
=
Exa
mp
le n
orm
aliz
ed
ima
ge
cu
mu
lativ
e h
isto
gra
m
com
pa
red
to th
e e
qu
iva
len
t Ga
ussia
n C
DF
0
0.2
0.4
0.6
0.8 1
020
4060
80100
Gaussian
image
fraction of total pixels
DN
EC
E/O
PT
I533 Digital Im
age Processing class notes 143 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
RA
DIO
METR
IC E
NH
AN
CEM
EN
T
•Poin
t pro
cessin
g
every
pix
el u
nd
erg
oes th
e s
am
e
tran
sfo
rma
tion
pa
ram
ete
rs o
f the tra
nsfo
rma
tion
are
:
• fix
ed
, from
glo
ba
l sta
tistic
s (e
ntire
ima
ge) o
r
• a
da
ptiv
e, fro
m lo
ca
l sta
tistic
s
•D
istin
ct fro
m n
eig
hb
orh
ood
p
rocessin
g (c
on
volu
tion
) or g
lob
al
tran
sfo
rms (e
.g. F
ou
rier)
•O
nly
imp
roves v
isu
al c
on
ten
t; does
not a
dd
info
rma
tion
to th
e d
ata
EC
E/O
PT
I533 Digital Im
age Processing class notes 144 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
Min
-Ma
x M
ap
pin
g G
L255
DN
ma
xD
Nm
in–
--------------------------------------D
ND
Nm
in–
()
=
050
100
150
200
250
300
0
2000
4000
6000
8000
10000
12000
14000
DN
050
100
150
200
250
0
2000
4000
6000
8000
10000
12000
14000
GL
DN
ma
xD
Nm
in
DN
GL
255
0D
Nm
ax
DN
min
EC
E/O
PT
I533 Digital Im
age Processing class notes 145 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
His
tog
ram
Mod
ifica
tion
•n
on
linea
r “stre
tch
ing
” o
f the d
ata
to im
pro
ve c
on
trast
ba
sed
on
glo
ba
l or re
gio
na
l ima
ge s
tatis
tics
EC
E/O
PT
I533 Digital Im
age Processing class notes 146 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
His
tog
ram
Eq
ua
liza
tion
•M
od
ify h
isto
gra
m to
ach
ieve u
nifo
rm d
istrib
utio
n o
f GL
•Look a
t con
tinu
ou
s d
istrib
utio
ns fo
r “p
roof”
Ma
pp
ing
fun
ctio
n fro
m in
pu
t to o
utp
ut:
Ou
tpu
t PD
F re
late
d to
inp
ut P
DF a
s:
desire
ou
tpu
t PD
F th
at is
flat, i.e
. un
iform
dis
tribu
tion
con
sid
er a
tran
sfo
rma
tion
M th
at is
the C
DF o
f x: (w
e k
now
the a
nsw
er!)
yM
x()=
PD
Fy()
PD
Fx() d
xd
y------
xM
1–y()
==
yM
x()P
DF
α()
αd∞– x∫
==
EC
E/O
PT
I533 Digital Im
age Processing class notes 147 D
r. Robert A
. Schowengerdt 2003
IM
AGE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
then
su
bstitu
ting
into
ab
ove e
qu
atio
n fo
r PD
F(y
):
•D
iscre
te c
ase is
sim
ply
,
dy
dx
------P
DF
x()=
PD
Fy()
PD
Fx()
1P
DF
x()--------------------
⋅x
M1–
y()=
=
1[]
xM
1–y()
==
1=
GL
int
255ch
istD
N(
)[
]=
DN
GL 2550
DN
ma
xD
Nm
in
EC
E/O
PT
I533 Digital Im
age Processing class notes 148 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
ou
tpu
t his
tog
ram
050
100
150
200
250
0
2000
4000
6000
8000
10000
12000
14000
GL
EC
E/O
PT
I533 Digital Im
age Processing class notes 149 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
His
tog
ram
Ma
tch
ing
•M
od
ify h
isto
gra
m to
ma
tch
“re
fere
nce” h
isto
gra
m, e
.g. G
au
ssia
n
•Ca
n a
lso b
e u
sed
to m
atc
h h
isto
gra
m o
f on
e im
ag
e to
tha
t of
an
oth
er, e
.g m
ultid
ate
ima
gery
of s
am
e s
cen
e
GL
no
rmch
istref 1–n
orm
chist
DN
()
[]
=
DN
0 1
normchist
DN
ref
0 1
normchistref
EC
E/O
PT
I533 Digital Im
age Processing class notes 150 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
ou
tpu
t his
tog
ram
ma
tch
ed
to G
au
ssia
n
•Pro
du
ces “
softe
r” c
on
trast th
an
his
tog
ram
eq
ua
liza
tion
050
100
150
200
250
0
2000
4000
6000
8000
10000
12000
14000
GL
EC
E/O
PT
I533 Digital Im
age Processing class notes 151 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
AD
APTIV
E C
ON
TRA
ST S
TRETC
H
•A
da
pts
to “
loca
l” c
on
trast
diffe
ren
ces
•R
esu
lting
con
trast is
more
un
iform
a
cro
ss e
ntire
ima
ge
EC
E/O
PT
I533 Digital Im
age Processing class notes 152 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
Loca
l Ra
ng
e M
od
ifica
tion
(LR
M)
•Pa
rtition
ima
ge in
to a
dja
cen
t b
locks, X
x Y
in s
ize
•Fin
d th
e m
inim
um
DN
L a
nd
m
axim
um
DN
H in
ea
ch
blo
ck
MIN
1 ,M
AX
1
MIN
2 ,M
AX
2
MIN
3 ,M
AX
3
MIN
4 ,M
AX
4
MIN
8 ,M
AX
8
MIN
12 ,M
AX
12
MIN
5 ,M
AX
5
MIN
6 ,M
AX
6
MIN
7 ,M
AX
7
MIN
11 ,M
AX
11
MIN
10 ,M
AX
10
MIN
9 ,M
AX
9
MIN
13 ,M
AX
13
MIN
14 ,M
AX
14
MIN
15 ,M
AX
15
MIN
16 ,M
AX
16
X
YL
A,H
AL
B ,HB
LC ,H
C
LG
,HG
LE ,H
EL
D,H
D
LH
,HH
LF ,H
F
LI ,H
I
y
x
EC
E/O
PT
I533 Digital Im
age Processing class notes 153 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
•Fin
d th
e n
eig
hb
orin
g m
inim
um
an
d m
axim
um
L a
nd
H v
alu
es a
t th
e in
ters
ectin
g n
od
es, e
.g.
•In
the c
orn
ers
an
d a
lon
g th
e e
dg
es, e
.g.
,
MIN
6m
inim
um
LA
LB
LD
LE
,,
,(
)=
MA
X6
ma
ximu
mH
AH
BH
DH
E,
,,
()
=
MIN
1L
A=
MA
X1
HA
=
MIN
5m
inim
um
LA
LD
,(
)=
MA
X5
ma
ximu
mH
AH
D,
()
=
EC
E/O
PT
I533 Digital Im
age Processing class notes 154 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
•Lin
ea
rly in
terp
ola
te th
e e
xp
ecte
d o
utp
ut G
L m
inim
um
an
d
ma
xim
um
at e
ach
pix
el fro
m th
ese v
alu
es
•Lin
ea
r inte
rpola
tion
insu
res th
at w
e’re
alw
ays w
ithin
a s
pecifie
d
ou
tpu
t ran
ge, e
.g. [0
..25
5]
GL
min
xX ----M
IN7
⋅X
x–X
------------
M
IN6
⋅+
Yy
–Y------------
⋅=
+
xX ----M
IN11
⋅X
x–X
------------
M
IN10
⋅+
yY ---⋅
GL
ma
xxX ----
MA
X7
⋅X
x–X
------------
M
AX
6⋅
+Y
y–Y
------------
⋅
=
+
xX ----M
AX
11⋅
Xx
–X------------
MA
X10
⋅+
yY ---⋅
MIN
GL
min
MA
X≤
≤
MIN
GL
ma
xM
AX
≤≤
EC
E/O
PT
I533 Digital Im
age Processing class notes 155 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
•Fin
ally
, ca
lcu
late
a lin
ea
r stre
tch
at e
ach
pix
el u
sin
g th
e
estim
ate
d m
inim
um
an
d m
axim
um
ran
ge v
alu
es
•Sen
sitiv
e to
blo
ck s
ize
too la
rge p
rod
uces little
ad
ap
tivity
to lo
ca
l con
trast
too s
ma
ll pro
du
ces “
ha
lo” a
rtifact n
ea
r hig
h c
on
trast b
ou
nd
arie
s
find
“b
est”
blo
ck s
ize b
y tria
l-an
d-e
rror
•R
efe
ren
ce:
J. D. F
ah
nesto
ck a
nd
R. A
. Sch
ow
en
gerd
t, "Sp
atia
lly - v
aria
nt C
on
trast E
nh
an
cem
en
t u
sin
g L
oca
l Ra
ng
e M
od
ifica
tion
,” O
pt. E
ng
., 22
(3), p
. 37
8 - 3
81
, Ma
y - Ju
ne 1
98
3.
GL
255G
Lm
ax
GL
min
–------------------------------------
DN
GL
min
–(
)=
EC
E/O
PT
I533 Digital Im
age Processing class notes 156 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
IMA
GE E
XA
MPLES
orig
ina
l
EC
E/O
PT
I533 Digital Im
age Processing class notes 157 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
min
-ma
x s
tretc
hed
EC
E/O
PT
I533 Digital Im
age Processing class notes 158 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
his
tog
ram
eq
ua
lized
EC
E/O
PT
I533 Digital Im
age Processing class notes 159 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
Ga
ussia
n s
tretc
hed
EC
E/O
PT
I533 Digital Im
age Processing class notes 160 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
LR
M s
tretc
hed
(blo
ck s
ize =
10
0)
EC
E/O
PT
I533 Digital Im
age Processing class notes 161 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
LR
M s
tretc
hed
(blo
ck s
ize =
50
)
EC
E/O
PT
I533 Digital Im
age Processing class notes 162 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
CO
LO
R IM
AGE C
ON
TRA
ST
EN
HA
NCEM
EN
T
•Ca
n a
pp
ly m
on
och
rom
e te
ch
niq
ues
to e
ach
colo
r com
pon
en
t (“b
an
d”)
•Som
etim
es le
ad
s to
un
desira
ble
colo
r sh
ifts a
nd
poor c
olo
r ba
lan
ce
•M
ore
late
r on
colo
r ima
ge
en
ha
ncem
en
t . . .
EC
E/O
PT
I533 Digital Im
age Processing class notes 163 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
exa
mp
le o
rigin
al
EC
E/O
PT
I533 Digital Im
age Processing class notes 164 D
r. Robert A
. Schowengerdt 2003
IMA
GE E
NH
AN
CEM
EN
T I (RA
DIO
METR
IC)
his
tog
ram
eq
ua
lized
in e
ach
ba
nd