Chapter4 - Image Filtering and Restoration
Chapter4 - Image Filtering and Restoration
PROCESSING
TMM24
43
CHAPTER4 - IMAGE FILTERING AND
RESTORATION
Depending on the
element values, a kernel
can cause a wide range of
effects.
Median Filter
There are also nonlinear neighborhood operations that can be
performed for the purpose of noise reduction that can do a better job
of preserving edges than simple smoothing filters.
One such method is known as median filtering.
In median filtering, the neighboring pixels are ranked according to
brightness (intensity) and the median value becomes the new value
for the central pixel.
Median filters can do an excellent job of removing certain types of
noise, in particular, salt and pepper noise in which some individual
pixels have extreme values.
In the median filtering operation, the pixel values in the
neighborhood window are ranked according to intensity, and the
middle value (the median) becomes the output value for the pixel
under evaluation.
Median Filter
Median Filter
Median Filter
The Median filters offer three advantages:
No reduction in contrast across steps, since output values
available consist only of those present in the neighborhood (no
averages).
Median filtering does not shift boundaries, as can happen with
conventional smoothing filters (a contrast dependent problem).
Since the median is less sensitive than the mean to extreme
values (outliers), those extreme values are more effectively
removed.
Median Filter
The median is, in a sense, a more robust average than the
mean, as it is not affected by outliers (extreme values).
Since the output pixel value is one of the neighboring values,
new unrealistic values are not created near edges.
Since edges are minimally degraded, median filters can be
applied repeatedly, if necessary.
Considerations:
The median filter is more expensive to compute than a
smoothing filter.
Median filters are nonlinear:
Median[A(x)+B(x)] ~= median[A(x)]+median[B(x)]
Median Filter
Mean Filter
Mean filtering is a simple, natural and easy to implement
method of smoothing images, i.e. reducing the amount of
intensity variation between one pixel and the next. It is often
used to reduce noise in images.
The idea of mean filtering is simply to replace each pixel value
in an image with the mean (`average') value of its neighbors,
including itself. This has the effect of eliminating pixel values
which are unrepresentative of their surroundings.
Often a 33 square kernel is used, although larger kernels (e.g.
55 squares) can be used for more severe smoothing. (Note
that a small kernel can be applied more than once in order to
produce a similar but not identical effect as a single pass with a
large kernel.)
Mean Filter
Original Image
Filtered Image
Wiener filter
It is a linear filter that is extensively used to restore images
degraded by additive white Gaussian noise .
It attempts to reduce the mean square error (MSE) between the
original and the estimated images.
Likewise, this filter processes degraded images in the frequency
domain.
The equation of Wiener filter is:*
H
R
*
I
2
| H |
hg m , n e
( m 2 n 2 )
2 2
h m,n
hg m , n
h
m
n g
-1
-1
-1
-4
-8
-1
-1
-1
-1
-1
Histogram Equalization
This method usually increases the global contrast of many images,
especially when the usable data of the image is represented by close
contrast values.
Through this adjustment, the intensities can be better distributed on the
histogram.
This allows for areas of lower local contrast to gain a higher contrast.
Histogram equalization accomplishes this by effectively spreading out the
most frequent intensity values.
The method is useful in images with backgrounds and foregrounds that
are both bright or both dark.
In particular, the method can lead to better views of bone structure in xray images, and to better detail in photographs that are over or underexposed.
The calculation is not computationally intensive.
Histogram Equalization
It may increase the contrast of background noise, while
decreasing the usable signal.
Histogram equalization often produces unrealistic effects in
photographs; however it is very useful for scientific images like
thermal, satellite or x-ray images.
Suppose that u have the following matrix:
8
14
11
15
14
12
15
19
10
13
10
16
12
14
16
12
19
14
19
14
13
16
11
17
14
12
12
11
15
10
13
18
14
13
10
18
12
11
16
18
12
14
17
10
13
Histogram Equalization
Histogram Equalization
Histogram Equalization
Histogram Equalization
Normalization
Normalization
AD X j,k X ( j ,k ) / MN
J 1 k 1
quality .
NAE i 1 j 1
M
[f i,j ]
i 1 j 1
1
RMSE MSE
MN
[
X
j
,
k
X
j
,
k
]
j 1 k 1
Max
PSNR 10 log10
dB
MSE
2
Images
AD
Images
AD
NAE
PSNR
RMSE
-6.5228e-005
Images
1st Image GB
(R=1)
AD
-1.0626e005
NAE
PSNR
RMS
E
0.045 29.272 0.001
0
9
2
THE END