ImageProcessing6 SpatialFiltering2
ImageProcessing6 SpatialFiltering2
IMAGE ENHANCEMENT
(SPATIAL FILTERING 2)
Contents
function
Let’s consider a simple 1 dimensional example
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
A
B
Spatial Differentiation
1st Derivative
5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7
0 -1 -1 -1 -1 0 0 6 -6 0 0 0 1 2 -2 -1 0 0 0 7 0 0 0
2nd Derivative
5 5 4 3 2 1 0 0 0 6 0 0 0 0 1 3 1 0 0 0 0 7 7 7 7
-1 0 0 0 0 1 0 6 -12 6 0 0 1 1 -4 1 1 0 0 7 -7 0 0
Using Second Derivatives For Image Enhancement
x y
where the partial 1 order derivative in the x
st
f [ f ( x 1, y ) f ( x 1, y )
2
f ( x, y 1) f ( x, y 1)]
4 f ( x, y )
We can easily build a filter based on this
0 1 0
1 -4 1
0 1 0
The Laplacian (cont…)
an enhanced image
We have to do more work in order to
get our final image
Subtract the Laplacian result from the
original image to generate our final
Laplacian
sharpened enhanced image Filtered Image
Scaled for Display
g ( x, y ) f ( x, y ) f
2
Laplacian Image Enhancement
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
- =
Original Laplacian Sharpened
Image Filtered Image Image
f ( x, y ) [ f ( x 1, y ) f ( x 1, y )
f ( x, y 1) f ( x, y 1)
4 f ( x, y )]
5 f ( x, y ) f ( x 1, y ) f ( x 1, y )
f ( x, y 1) f ( x, y 1)
Simplified Image Enhancement (cont…)
This gives us a new filter which does the whole job for
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
us in one step
0 -1 0
-1 5 -1
0 -1 0
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
-1 -1 -1
-1 9 -1
-1 -1 -1
Simple Convolution Tool In Java
(a)
Laplacian filter of
bone scan (a)
(b)
Sharpened version of
bone scan achieved (c)
by subtracting (a)
and (b) Sobel filter of bone
scan (a) (d)
Combining Spatial Enhancement
Methods (cont…)
Result of applying a (h)
power-law trans. to
Images taken from Gonzalez & Woods, Digital Image Processing (2002)