Title: EE4328, Section 005 Introduction to Digital Image Processing Nonlinear Image Filtering Zhou Wang Dep
1EE4328, Section 005 Introduction to Digital
Image ProcessingNonlinear Image FilteringZhou
WangDept. of Electrical EngineeringThe Univ.
of Texas at ArlingtonFall 2006
2Previous Lectures
- Spatial Domain Linear Filters
- Smoothing Averaging, Gaussian
- Sharpening
-
- Frequency (2D-DFT) Domain Filters
- Lowpass, highpass, bandpass
- Orientation selective
- Orientation radial selective
- ..
- Linear Image Restoration Filters
- Inverse, pseudo-inverse, radially-limited inverse
- Wiener, Wiener denoising
All Linear !
3Nonlinear Filtering
- Motivation Limitation of Linear Filters
- Frequency shaping
- enhance some frequency components and suppress
the others - For individual frequency component, cannot
differentiate its desirable and undesirable
parts - Nonlinear Filters
- Cannot be expressed as convolution
- Cannot be expressed as frequency shaping
- Nonlinear Means Everything (other than linear)
- Need to be more specific
- Often heuristic
- We will study some nice ones
4Impulsive (Salt Pepper) Noise
- Definition
- Each pixel in an image has a probability pa or pb
of being contaminated by a white dot (salt) or a
black dot (pepper)
X noise-free image, Y noisy image
with probability pa
noisy pixels
with probability pb
clean pixels
with probability 1 - pa - pb
add salt pepper noise
5Median Filters
- Order Statistics (OS)
- Given a set of numbers
- Denote the OS as
- such that
- Median
- Define
- Applying Median Filters
- to Images
- Use sliding windows
- (similar to spatial linear filters)
- Typical windows
- 3x3, 5x5, 7x7, other shapes
max value
min value
middle value
6Median Filters
original
noisy (pa pb 0.1)
median filtered 3x3 window
median filtered 5x5 window
From MATLAB sample images
7Iterative Median Filters
- Idea repeatedly apply median filters
1 time
2 times
3 times
From Gonzalez Woods
8Switching Median Filters
- Motivation
- Regular median filters change both bad and
good pixels - Idea
- Detect/classify bad and good pixels
- Filter bad pixels only
From Wang Zhang
9Switching Median Filters
original
noisy (pa pb 0.1)
regular 5x5 median filtered
switching 5x5 median filtered
From MATLAB sample images
10Order Statistics (OS) Filters
- Recall Order Statistics
- For
- OS
- such that
- OS filter General Form
- Special Cases
where
(M1)-th
11Order Statistics (OS) Filters
- Note An OS Filter is Uniquely Defined by wi
- Example 1
- Example 2
(M1)-th
M-th
(M2)-th
then
then
12Examples
- A 4x4 grayscale image is given by
impulse?
impulse?
- Filter the image with a 3x3 median filter, after
zero-padding at the image borders
median filtering
zero-padding
13Examples
- Filter the image with a 3x3 median filter, after
replicate-padding at the image borders
median filtering
replicate -padding
impulse cleaned!
14Examples
- Filter the image with a 3x3 OS filter, after
replicate-padding at the image borders. The
weighting factors of the OS filter are given by
wi i 1, , 9 0, 0, 0, ¼, ½, ¼, 0, 0, 0
OS filtering
replicate -padding
15Homomorphic Filters
f(x, y) i(x, y) r(x, y)
H(u, v)
illumination (slowly varying) (low-frequency)
reflectance (fastly varying) (high-frequency)
freq.
lnf(x, y) lni(x, y) lnr(x, y)
0
Key linear separation
16Homomorphic Filters
before
after
From Stockham