UCSE715 - Slide 3
UCSE715 - Slide 3
Intensity Transformation
Spatial Filtering
Image Enhancement
UNIT- II
► Spatial domain
image plane itself, directly process the intensity values of
the image plane
► Transform domain
process the transform coefficients, not directly process the
intensity values of the image plane
1
08-08-2024
g ( x, y ) T [ f ( x, y )])
f ( x, y ) : input image
g ( x, y ) : output image
T : an operator on f defined over
a neighborhood of point ( x, y)
2
08-08-2024
3
08-08-2024
Image Negatives
Image negatives
s L 1 r
Small
lesion
4
08-08-2024
Log Transformations
Log Transformations
s c log(1 r )
5
08-08-2024
s cr
6
08-08-2024
s r1/ 2.5
7
08-08-2024
Piecewise-Linear Transformations
► Contrast Stretching
— Expands the range of intensity levels in an image so that it spans
the full intensity range of the recording medium or display device.
► Intensity-level Slicing
— Highlighting a specific range of intensities in an image often is of
interest.
8
08-08-2024
9
08-08-2024
Bit-plane Slicing
Bit-plane Slicing
10
08-08-2024
Bit-plane Slicing
Histogram Processing
► Histogram Equalization
► Histogram Matching
11
08-08-2024
Histogram Processing
Histogram h( rk ) nk
rk is the k th intensity value
nk is the number of pixels in the image with intensity rk
nk
Normalized histogram p( rk )
MN
nk : the number of pixels in the image of
size M N with intensity rk
12
08-08-2024
Histogram Equalization
The intensity levels in an image may be viewed as
random variables in the interval [0, L-1].
Let pr (r ) and ps ( s) denote the probability density
function (PDF) of random variables r and s.
Histogram Equalization
s T (r ) 0 r L 1
13
08-08-2024
Histogram Equalization
s T (r ) 0 r L 1
ps (s)ds pr (r)dr
Histogram Equalization
r
s T ( r ) ( L 1) pr ( w)dw
0
ds dT (r ) d r
( L 1) pr ( w)dw
dr dr dr 0
( L 1) pr ( r )
pr ( r ) dr pr ( r ) p (r ) 1
ps ( s ) r
ds ds ( L 1) pr (r ) L 1
dr
14
08-08-2024
Example
Suppose that the (continuous) intensity values
in an image have the PDF
2r
, for 0 r L-1
pr (r ) ( L 1) 2
0, otherwise
Example
r
s T ( r ) ( L 1) pr ( w)dw
0
r 2w
( L 1) dw
0 ( L 1) 2
r2
L 1
15
08-08-2024
Histogram Equalization
Continuous case:
r
s T (r ) ( L 1) pr ( w)dw
0
Discrete values:
k
sk T (rk ) ( L 1) pr (rj )
j 0
k nj L 1 k
( L 1) nj k=0,1,..., L-1
j 0 MN MN j 0
16
08-08-2024
0
s0 T ( r0 ) 7 pr ( rj ) 7 0.19 1.33 1
j 0
1
s1 T (r1 ) 7 pr ( rj ) 7 (0.19 0.25) 3.08 3
j 0
s2 4.55 5 s3 5.67 6
s4 6.23 6 s5 6.65 7
s6 6.86 7 s7 7.00 7
17
08-08-2024
1 3 4 2
18