Professional Documents
Culture Documents
g( x , y ) f ( x , y ) ( x , y )
where
f ( x, y)
( x, y)
If the noise
Original image
Noise
(x,y) = 0
{ gi ( x , y )}
1
g( x , y )
K
g ( x, y)
i 1
fi
K i 1
K
i 1
1
E ( g ) E ( f i )
K i 1
E ( i )
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
unscaled
=
scaled
unscaled
scaled
Subimage
a, b are integers
Linear filter:
g( x , y )
w( s, t ) f ( x s, y t )
sa t b
eg.,
for an average filter of mask 3x3, each coefficient
should be 1/9
W=
1/9
W=
1/16
Weighted average
g( x , y )
w( s, t ) f ( x s, y t )
sa t b
w( s, t )
sa t b
(a)
(b)
Padding
Mask size
--, 3
5,9
15, 35
Non-linear filters:
e.g., Median filter, variance filter
of similar size
5, 7, 4, 5, 3, 6, 8, 7, 12, 1, 0, 4, 14, 1, 3
a) Arrange them as
0, 1, 1, 3, 3, 4, 4, 5, 5, 6, 7, 7, 8, 12, 14
Median = 5
Arrange them
45, 55, 63, 65, 67, 67, 75, 80, 87, 87, 87, 87, 92, 98
Noisy image
Comparison
a) Max filter
The pixel value is replaced by the maximum calculated
from the neighborhood.
b) Min Filter
The pixel value is replaced by the minimum calculated
from the neighborhood.
f
f ( x 1) f ( x ) ;
x
x is discrete
Position
Gray level
Properties::
a) Must be zero in the flat region
b) Must be non-zero at the onset of a gray level
step or ramp
c) Must be non-zero along the ramps.
y-derivative
x-derivative
Taylor series:
f h f
f ( x h) f ( x ) h
....
2
x 2! x
2
Again,
f h f
f ( x h) f ( x ) h
....
2
x 2! x
2
f
f ( x 1) f ( x 1) 2 f ( x )
2
x
2
Properties::
a) Must be zero in the flat region
Effect of noise on
edge detection!!!!!
In conclusion
1st order derivatives generally produce thicker
edges in an image.
1st order derivatives have stronger response to
the gray level steps in the image.
2nd order derivatives have a stronger response
to fine details such as thin lines and isolated
points.
2nd order derivatives produce a double response
at the step changes in gray level.
2 f
f ( x , y 1) f ( x , y 1) 2 f ( x , y )
2
y
2
2
f
2
f
2
2
x
y
f ( x 1, y ) f ( x 1, y ) f ( x , y 1) f ( x , y 1) 4 f ( x , y )
w( s , t ) f ( x s , y t )
0
-4
w =
Simplification
g( x , y ) f ( x , y ) 2 f ( x , y )
f ( x , y ) f ( x 1, y ) f ( x 1, y ) .... 4 f ( x , y )
5 f ( x , y ) f ( x 1, y ) .....
-1
-1
-1
-1
w =
Composite mask
f edge ( x, y ) f ( x, y ) f ( x, y )
fedge(x,y) = edge of the image f(x,y)
f(x,y) is the blurred version of f(x,y)
f s ( x , y ) f edge ( x , y ) f ( x , y )
f ( x, y) f ( x, y) f ( x, y)
f hb ( x, y ) Af ( x, y ) f ( x, y )
where
A 2
f hb ( x, y ) ( A 1) f ( x, y ) f ( x, y ) f ( x, y )
f hb ( x, y ) ( A 1) f ( x, y ) f edge ( x, y )
Recall:
f edge ( x, y ) f ( x, y )
f hb ( x , y ) ( A 1) f ( x , y ) 2 f ( x , y )
Central coefficient is -
or
f hb ( x , y ) ( A 1) f ( x , y ) 2 f ( x , y ) Central coefficient is+
Composite mask
-1
-1
A+3
-1
-1
w =
A=1
A=2.0
A=2.7