You are on page 1of 6

1/21/2009

1
Chapter 2 :
Enhancement
Part : Enhancement by Mask
Dr. Hojeij youssef
Digital image processing
1
Convolution : each pixel is replaced by theweight values of its neighborhood
pixels . that is :
Whereu& varetheweight of theusingmask(filter)
Filtering by convolution
Dr. Hojeij youssef
2

=
- =
u v
'
'
) v , u ( filter ) v j , u i ( I ) j , i ( I
) j , i ( filtre ) j , i ( I ) j , i ( I
1/21/2009
2
Smoothing filter : Hereeach pixel is replaced by theweight averaging of its
neighborhood pixels
Only thelow frequency rangepast
Thereis many sizeof averaging filter : 33, 55, 77,
Averaging filtering
Dr. Hojeij youssef
3
0 0 0
0 0.11 0
0 0 0
1 1 1
1 1 1
1 1 1
TF
1/9
S.F :33 S.F : 55 OrigineImage
Gaussian filter :
Small then limited smoothing
largethen moresmoothing
Averaging filtering
Dr. Hojeij youssef
4
( ) { }
2 2 2
2
2 / y x exp
2
1
) y , x ( filter

+ =
1 2 2 2 1
2 7 11 7 2
3 11 17 11 3
2 7 11 7 2
1 2 3 2 1
1 1 1 2 2 2 2 2 1 1 1
1 2 2 3 4 4 4 3 2 2 1
1 2 4 5 6 7 6 5 4 2 1
2 3 5 7 8 9 8 7 5 3 2
2 4 6 8 10 11 10 8 6 4 2
2 4 7 9 11 12 11 9 7 4 2
2 4 6 8 10 11 10 8 6 4 2
2 3 5 7 8 9 8 7 5 3 2
1 1 4 5 6 7 6 5 4 2 1
1 2 2 3 4 4 4 3 2 2 1
1 1 1 2 2 2 2 2 1 1 1
=0.625 (55) =1.6 (1111)
1/21/2009
3
Exponential filter:
Small then limited smoothing
largethen moresmoothing
Averaging filtering
Dr. Hojeij youssef
5
{ } ) y x ( exp
4
) y , x ( filter
2
+ =

Directional smoothing : to protect theedges fromblurring whilesmoothing.


A directional filter can beuseful. Spatial averagefilter(i,j:) arecalculatein
serval direction as :
Averaging filtering
Dr. Hojeij youssef
6

e
=
) v , u ( W
) v j , u i ( I
N
1
) : j , i ( I

u
v

0
W
1/21/2009
4
Median filtering : Heretheinput pixel is replaced by themedian of thepixels
contained in thewindows around thepixel that is :
WhereWisthesuitablychosenwindowsthealgorithmfor medianfilteringrequiresarrangingthepixel values
inthewindowsfor increasingor decreasingorder andpickingthemiddlevalue. Generallythewindowssizeis
choosingsowthat Nwisodd. if Nwiseventhenthemedianistakenastheaverageof thetwovaluesinthe
middle
Median Filtering
Dr. Hojeij youssef
7
{ } W ) v , u ( ), v j , u i ( I median ) j , i ( I

e =
Lowdegreeof intensity
noise
33 median filtering 55 median filtering
Examples :
Dr. Hojeij youssef
8
NoisyImage 33 median filter 33 averaging filter
NoisyImage 33 Gaussian filter 33 median filter 33 averaging
1/21/2009
5
Zero interlace Convolve
Zoom
Dr. Hojeij youssef
9
(

6 5 4
2 3 1
(
(
(
(

0 0 0 0 0 0
0 6 0 5 0 4
0 0 0 0 0 0
0 2 0 3 0 1
(
(
(
(

6 6 5 5 4 4
6 6 5 5 4 4
2 2 3 3 1 1
2 2 3 3 1 1
Zero
Interlace
Convolve
Zero interlace Rows and columns interpolate
Zoom
Dr. Hojeij youssef
10
(

5 4
3 1
(
(
(
(

0 0 0 0
0 5 0 4
0 0 0 0
0 3 0 1
(
(
(
(

0 0 0 0
5 . 2 5 5 . 3 4
0 0 0 0
5 . 1 3 2 1
Zero
Interlace
Interpolate
rows
(
(
(
(

25 . 1 5 . 2 75 . 1 2
5 . 2 5 5 . 3 4
2 4 75 . 2 5 . 2
5 . 1 3 2 1
Interpolate
Columns
1/21/2009
6
Inadditiontotherequirement of monochromeimageenhancement, color
imageenhancement manyrequireimprovement of color balanceor color
contract inacolor image. Enhancement of color imagesbecomesamore
difficult task not onlybecauseof addeddimensionsof thedatabut also
duetotheaddedcomplexityof color perception. A practical approachto
developingcolor imageenhancement algorithmsisshownbelow
Color image enhancement
Dr. Hojeij youssef
11
An ideal high-pass filter is 1in which its frequency responseis given by :
r(u,v) is theradial frequency thedistancefromtheorigin to thepoint(u,v)
Gaussian Filtering
Dr. Hojeij youssef
12

>
=
else 0
B ) v , u ( r 1
) v , u ( H
2 2
v u ) v , u ( r
te tan cons positive a is B
+ = -
-

< +
> +
=
0
2 2
0
2 2
R v u 0
R v u 1
) v , u ( H

You might also like