Basic 2
Basic 2
Basic 2
sr
Image negative
s L 1 r
For 8-bit image ; s 255 r
Log transformation
s c log(1 r )
Where c = constant; r0
Power law transformation
s cr
where
<1
correction Dark levels have to be compressed
>1
Piecewise linear transformation function
Gray level slicing
h( rk ) nk
h( rk ) nk
p( rk )
n n
p(r ) 1
k
k
p(rk) =h(rk)/n
rk = 255
p(r ) 1
k
k
Uniformly distributed
histogram yields
Hence, histogram
processing requires the
stretching of gray level
uniformly over the entire
gray level range.
p(r)
r =1
Histogram equalization
p(s)
s
0 1
1. Requires the distribution of histogram peaks
uniformly over the entire gray level range
Continuous and
r 1 White
s T (r ) ; 0 r 1
Let us require that the transformation
function T(r) should satisfy
2. 0 T(r) 1 for 0 r 1
s
T(r) Single valued
and
monotonically increasing
r
s T(r) Not single valued
T(r)
s
r
Transformation Transformation
from black white from white black
Hence the requirements:
1. T(r) should be single valued which ensures the
output image
ps ( s ) ds pr (r ) dr
To make the histogram uniform:
Put, ps ( s ) 1
ds pr ( r ) dr
s r
ds p ( ) d
0 0
r
r
s p ( ) d T (r )
0
r
r
s T (r )
0
pr ( ) d
nk
pr ( rk ) , k 0, 1, ..... L 1
n
k
sk T ( rk ) p (r )
j 0
r j
k nj
sk T ( rk ) n
j 0
, for k 0, 1, ...., L 1
This will do the histogram equalization
AUTOMATICALLY
Image averaging
g( x , y ) f ( x , y ) ( x , y )
where
f ( x, y) Original image
( x, y) Noise
K
1
g( x , y )
K
g ( x, y)
i 1
i
1 K K
K i 1
fi
i 1
i
Take expectation either side
1 K K
E ( g ) E ( f i ) E ( i )
K i 1 i 1
E{ f i } f i
&
E{i } 0
E{ g( x, y )} f ( x, y )
K=8 K=16
K=64 K=128