3.5 Smoothing (Lowpass) Spatial Filters - Lowpass Gaussian Filter Kernels
3.5 Smoothing (Lowpass) Spatial Filters - Lowpass Gaussian Filter Kernels
Let
3.5 Smoothing (Lowpass) Spatial Filters
- Lowpass Gaussian Filter Kernels
Let
distance r
3.5 Smoothing (Lowpass) Spatial Filters
- Lowpass Gaussian Filter Kernels
Let
Example.
K = 1 and σ = 1
Max Filter
-- the 100th percentile filter
Min Filter
-- the 0th percentile filter
Median Filter
Max Filter
-- the 100th percentile filter
Min Filter
-- the 0th percentile filter
Salt-and-pepper 19 x 19 Gaussian
7x7 median lter
noise image lowpass lter, σ = 3
fi
fi
3.6 Sharpening (Highpass) Spatial Filters
- Foundation
First Derivative:
Second Derivative:
3.6 Sharpening (Highpass) Spatial Filters
- Foundation
• First derivative:
- Zero in areas of constant intensity
- Nonzero at the onset of an intensity step or ramp
- Nonzero along ramps
• Second derivative:
- Zero in areas of constant intensity
- Nonzero at the onset and end of an intensity step or ramp
- Zero along ramps of constant slope
3.6 Sharpening (Highpass) Spatial Filters
- Foundation
First derivative for edge detection
What is edge?
Intensity profile 1
0.5 Edge
p(x)
0
20 40 60 80 100 120 140 160 180 200
0.2
1st derivative
0.1
dp
dx 0
0 50 100 150 200
0.05
2nd derivative
0
d2p
dx 2 -0.05
0 50 100 150 200
3.6 Sharpening (Highpass) Spatial Filters
- Foundation
Second derivative for sharpening
Intensity profile 1
0.5 Edge
p(x)
0
20 40 60 80 100 120 140 160 180 200
0.2
1st derivative
0.1
dp
dx 0
0 50 100 150 200
0.05
2nd derivative
0
d2p
dx 2 -0.05
0 50 100 150 200
3.6 Sharpening (Highpass) Spatial Filters
- Foundation
Second derivative for sharpening Laplacian
1.5
p(x) 0.5
1
2
d p
p( x ) − 10 0.5
dx 2
0
After sharpening
-0.5
0 50 100 150 200
d2p
p( x ) − 10 2
Laplacian sharpening results in larger intensity discontinuity dx
near the edge.
3.6 Sharpening (Highpass) Spatial Filters
- the Laplacian
The simplest isotropic derivative kernel is the Laplacian
¶ 2
f ¶ 2
f
Ñ2 f = 2 + 2
¶ x ¶ y
Discrete form: ¶2 f
= f ( x + 1, y ) + f ( x - 1, y ) - 2 f ( x, y )
¶ x
2
¶2 f
= f ( x, y + 1) + f ( x, y - 1) - 2 f ( x, y )
¶ y
2
We then have:
Ñ 2 f = [ f ( x + 1, y ) + f ( x - 1, y ) + f ( x, y + 1) + f ( x, y - 1)]
- 4 f ( x, y )
3.6 Sharpening (Highpass) Spatial Filters
- the Laplacian
Ñ 2 f = [ f ( x + 1, y ) + f ( x - 1, y ) + f ( x, y + 1) + f ( x, y - 1)]
- 4 f ( x, y )
3.6 Sharpening
p(x)
(Highpass) Spatial Filters
1
0.5
- the Laplacian 0
-0.5
0 50 100 150 200
1.5
1
2
d p
Recall that p( x ) − 10 0.5
dx 2
0
-0.5
0 50 100 150 200
g ( x, y ) = f ( x, y ) - Ñ f 2
Laplacian image
Original image
g ( x, y ) = f ( x, y ) - Ñ 2 f
Laplacian kernel
g ( x, y ) = f ( x, y ) - Ñ 2 f
3.6 Sharpening (Highpass) Spatial Filters
- the Laplacian
The entire enhancement can be combined into a single
ltering operation
g ( x, y ) = f ( x, y ) - Ñ 2 f
= 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)
other variant:
fi
3.6 Sharpening (Highpass) Spatial Filters
- the Laplacian
Example of Laplacian image sharpening
3.6 Sharpening (Highpass) Spatial Filters
- Unsharp Masking and Highboost Filtering
Original Image
Blurred Image
Mask
fi
3.6 Sharpening (Highpass) Spatial Filters
- the Gradient
Two other de nition:
Roberts Cross-
Gradient Operators
Sobel Operators
fi
3.6 Sharpening (Highpass) Spatial Filters
- the Gradient
Example of using the gradient for edge enhancement:
Ch 3. Intensity Transformations
and Spatial Filtering
Kuan-Wen Chen