Min filter

advertisement
Basis beeldverwerking (8D040)
dr. Andrea Fuster
Prof.dr. Bart ter Haar Romeny
dr. Anna Vilanova
Prof.dr. Marcel Breeuwer
Noise and Filtering
Contents
• Noise
• Mean Filters
• Order-statistic filters
• Median
• Alpha-trimmed
2
Gaussian Noise
• Gaussian noise follows a Gaussian distribution
Average =
Standard deviation =
• Good approximation of
noise that occurs in
practical cases.
Additive Gaussian Noise Example
Impulse Noise Model
• Bipolar impulse noise follows the following
distribution
If
or
is zero, we have unipolar impulse noise
If both are nonzero, and almost equal, this is also
called salt-and-pepper noise
Impulse Noise
• Impulses
•
•
•
•
can be positive and negative
are often very large
can go out of the range of the image
appear as black and white dots, saturated peaks
Impulse Noise Example
Periodic Noise
• Periodic noise can be generated during image
acquisition due to electrical interference
Original Image
Abs of Fourier Transform
Contents
• Noise
• Mean Filters
• Order-statistic filters
• Median
• Alpha-trimmed
9
Mean Filters
• Blurring used to smooth images by e.g. convolution
with smoothing kernel
• Can be used to
suppress noise
10
Arithmetic Mean Filter
• Arithmetic mean filter replaces the current pixel with
a uniform weighted average of the neighbourhood
11
Geometric Mean Filter
• Like arithmetic mean filter, but loses less detail
12
Harmonic Mean Filter
• Works well for Gaussian noise
• Works well for salt noise, but fails for pepper noise
13
Contraharmonic Mean Filter
• Is very effective in eliminating Salt-and-Pepper noise
Q is the order of the filter
14
Contraharmonic Mean Filter
•
•
•
•
If Q=0, this is the arithmetic mean filter
If Q=-1, this is the harmonic mean filter
If Q<0, salt noise is eliminated
If Q>0, pepper noise is eliminated
• For examples, see book page 324-325
15
Contents
• Noise
• Mean Filters
• Order-statistic filters
• Median
• Alpha-trimmed
16
Order-statistic filters
• Result is based on ordering pixel values in the
neighbourhood
• Examples: median, max, min filters
min
median
max
17
Contents
• Noise
• Mean Filters
• Order-statistic filters
• Median
• Alpha-trimmed
18
Median Filter
• Replaces value of a pixel by the median of its
neighbourhood
19
Median filter
• Can be used to reduce random noise
• Less blurring than linear smoothing filter
• Very effective for impulse noise (salt-and-pepper
noise)
Mean filtering
Median
filtering9x9
3x3
3x3
9x9
20
Max and min filters
• Max filter:
− Take maximum of ordered pixel values
− Find brightest points of an image (so: filters pepper
noise)
• Min filter:
− Take minimum of ordered pixel values
− Find darkest points of an image (filters salt noise)
21
rd
st
Max
filtered
Original
Salt-and-Pepper
filtered
3Midpoint
quartile
filtered noise
1
Median
quartile
Min filtered
filtered
filtered
22
Contents
• Noise
• Mean Filters
• Order-statistic filters
• Median
• Alpha-trimmed
23
Alpha-trimmed mean filter
• Delete d/2 lowest and d/2 highest values of
from neighbourhood
•
remains
• d=0
arithmetic mean filter
• d=mn-1
median filter
24
• Alpha-trimmed mean filter works good for
combination of S&P noise and Gaussian noise
Alpha-trimmed
image
(5x5,
d=6) noise
Image
with
Median
S&Pfiltered
noise
and
image
Gaussian
(5x5)
25
Download