Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture #5
Image: I , point
J J = [I ]
operator
Input Output
If I (r, c )= g
function,
Pixel: I(r,c) f J(r,c)
and f (g )= k
The transformation of image I into image J is then J (r, c )= k .
accomplished by replacing each input intensity, g, with
a specific output intensity, k, at every location (r,c)
where I(r,c) = g.
The rule that associates k with g is usually
specified with a function, f, so that f (g) = k.
If I is 3-band, then
a) each band is mapped separately using the same
LUT for each band or
b) each band is mapped using different LUTs – one
for each band.
a) J = LUT(I + 1), or
b) J (:,:, b)= LUTb (I (:,:, b)+ 1) for b = 1,2,3.
101 64
102 68
127
103 69
104 70
105 70
106 71
0
input output
...0 ... 0
cell index
contents
64
...32
a pixel with ...
is mapped to
this value this value
128 128
... ...
192 224
... ...
255 255
For example:
Let a = 2.
Let x {0,…,255}
(x ; a )=
255
1 + e a ( x 127 ) / 32
Or in Matlab:
a = 2;
x = 0:255; This is just
LUT = 255 ./ (1+exp(-a*(x-127)/32));
one example.
255
127
I k (r, c )+ g , if I k (r, c )+ g < 256
J k (r, c )=
g
255, if I k (r, c )+ g > 255
0
g 0 and k {1,2 ,3 } is the band index.
0 127 255
transform mapping
255
255-g
127
0, if I k (r, c ) g < 0
J k (r, c )=
I k (r, c ) g , if I k (r, c )
0
g 0 and k {1,2 ,3 } is the band index.
0 127 255
transform mapping
255
127
Let Tk ( r, c ) = a [I k (r, c ) 127]+ 127, where a > 1.0
0, if Tk (r, c ) < 0,
J k (r, c ) = Tk (r, c ), if 0 Tk (r, c ) 255,
0
0 127 255
255, if Tk (r, c ) > 255. k {1,2 ,3 } transform mapping
255
127
Tk ( r, c ) = a[I k (r, c ) 127]+ 127,
255
MJ
127
Let mI = min[I (r, c )], M I = max[I (r, c )],
mJ = min[J (r, c )], M J = max[J (r, c )].
Then,
I (r, c ) mI mJ
0
J (r, c )= (M J mJ ) + mJ . 0 mI 127 MI 255
M I mI transform mapping
orig
lo-c
hi-c
histograms
1999-2007 by Richard Alan Peters II
EECS490: Digital Image Processing
255
127
1/
I (r, c )
J (r, c ) = 255 for > 1.0
255
0
0 127 255
transform mapping
255
127
1/
I (r, c )
J (r, c ) = 255 for < 1.0
255
0
0 m 127 M 255
transform mapping
255
Let A = hI k (g + 1).
g =0
g g h ( + 1)
Ik
PI k (g + 1) = pI k ( + 1) = hI k ( + 1) =
1 =0
255 ,
h ( + 1)
=0 A =0
Ik
=0
g g h ( + 1)
Ik
PI k (g + 1) = pI k ( + 1) = hI k ( + 1) =
1 =0
255 ,
h ( + 1)
=0 A =0
Ik
=0
s = T ( r ) = ( L 1) pr ( w ) dw L is the number of
gray levels.
0
Cumulative Distribution Function (CDF)
Note: this same 3-bit (8 gray level) 64x64 pixel image will
be used for several examples
( )
0
Histogram Equalization
Resulting histogram
when trying to achieve
uniform* equalized
histogram
*Resulting histogram
( )
k
sk = T ( rk ) = ( L 1) pr rj
j=0 is usually not uniform
due to discrete
Must round off to nature of transform.
nearest integer value In this case we only
since only L integer
levels in output have five output
levels.
Histogram Equalization
dark
light
Low contrast
high contrast
Histogram Equalization
( )
k
sk = T ( rk ) = ( L 1) pr rj
j=0
EECS490: Digital Image Processing
Histogram Specification
G(z) would be a
straight line for
equalization.
Histogram Specification
Specified pdf
Original pdf
Actual transformed
CDF of specified pdf
image pdf
EECS490: Digital Image Processing
( )
0
s0 = T ( r0 ) = ( 8 1) pr rj = 7 pr ( r0 ) = 7 ( 0.19 ) = 1.33
= T ( r ) = ( 8 1) p ( r ) = 7 p ( r ) + 7 p ( r ) = 7 ( 0.19 ) + 7 ( 0.25 ) = 1.33 + 1.75 = 3.08
j1= 0
s1 1 r j r 0 r 1
j=0
( )
0
G ( z0 ) = ( 8 1) pz z j = 7 pz ( z0 ) = 7 ( 0 ) = 0
G ( z ) = ( 8 1) p ( z ) = 7 p ( z ) + 7 p ( z ) = 7 ( 0 ) + 7 ( 0 ) = 0
j1= 0
1 z j z 0 z 1
j=0
G ( z ) = ( 8 1) p ( z ) = 7 ( 0 ) + 7 ( 0 ) + 7 ( 0 ) = 0
2
2 z j
j=0
G ( z3 ) = 1.05 G ( z4 ) = 2.45 G ( z5 ) = 4.55 G ( z6 ) = 5.95 G ( z7 ) = 7.00
SEE GWE, Section 3.3.3 for a discussion of histogram specification using MATLAB
EECS490: Digital Image Processing
THRESHOLDING
(f>100) evaluates to 1 (true) if the pixel is >100, or 0 (false) if the pixel is 100
ROTATION
x=
778.3362
619.7249
844.4242
465.5196
y=
213.0831
327.6357
470.8264
609.6112
>> [x,y]=ginput(n)
Will input n coordinate pairs until you press return
EECS490: Digital Image Processing
Histogram
EECS490: Digital Image Processing
Histogram Equalization
EECS490: Digital Image Processing
Histogram Specification
Manually
specified
histogram h
Resulting
histogram
EECS490: Digital Image Processing
compare to global
mean mG and standard
deviation G
EECS490: Digital Image Processing
Spatial Neighborhoods
Spatial Filtering
J (r, c ) = T [I ](r, c ) =
f ({I (u, v ) u {r s,..., r,...r + s}, v {c d ,..., c,...c + d }}).
Moving Windows
Spatial Filtering
Moving-Window Transformations
Neutral
Buoyancy We’ll take a
Facility at section of
NASA this image to
Johnson demonstrate
Space
the MWT
Center