Professional Documents
Culture Documents
4.1 Introduction
The image denoising methods fall into two broad categories: spatial
domain methods and frequency domain methods. The term spatial domain refers
to the image plane itself, and approaches in this category are based on direct
processed for visual interpretation, the viewer is the ultimate judge of how well a
of the processing images for machine perception, the evaluation task is somewhat
leaving aside other issues such as computational requirements, the best image
processing method would be the one yielding the best machine recognition results.
imposed on the problem, a certain amount of trial and error is usually required
pixels composing an image. Spatial domain methods are procedures that operate
111
directly on these pixels. Spatial domain processes will be denoted by the
expression
g ( x, y ) T [ f ( x, y )] (4.1)
pixel-by-pixel sum of a sequence of images for noise reduction. Figure 4.1 shows
the basic implementation of equation 4.1 on a single image. The point (x, y)
shown is an arbitrary location in the image, and the small region shown containing
the point is a neighborhood of (x, y), and is much smaller in size than the image.
Figure 4.1: A 3 x 3 neighborhood about a point (x, y) in an image in the spatial domain
112
The process illustrated in figure 4.1 consists of moving the origin of the
neighborhood from pixel to pixel and applying the operator T to the pixels in the
neighborhood to yield the output at that location. Thus, for any specific location
(x, y), the value of the output image ‘g’ at those coordinates is equal to the result
For example, if the neighborhood is a square of size 3x3, and that operator
arbitrary location in an image, say (100,150). Assuming that the origin of the
neighborhood is at its center, the result, g (100, 150), at that location is computed
as the sum of f (100, 150) and its 8-neighbors, divided by 9 (i.e., the average
neighborhood is then moved to the next location and the procedure is repeated to
generate the next value of the output image g. Typically, the process starts at the
top left of the input image and proceeds pixel by pixel in a horizontal scan, one
row at a time. When the origin of the neighborhood is at the border of the image,
intensity values. The thickness of the padded border depends on the size of the
113
4.2 Fundamentals of spatial filtering
for image enhancement, noise reduction, edge detection, and sharpening. The
concept of filtering has been applied in the frequency domain, where it rejects
include median filtering, average filtering, Gaussian filtering, etc. The filtering
function sometimes called filter mask, or filter kernel. They can be broadly
classified into two different categories: linear filtering and order-static filters. In
the case of linear filtering, the operation can be accomplished by convolution, i.e.,
the value of any given pixel in the output image is represented by the weighted
sum of the pixel values of its neighborhood (a linear combination) in the input
image.
For order-static filter, the value of a given pixel in the output image is
image, such as the median filter. Those filters are normally non-linear and cannot
size, for example it may be 3x3, 5x5…. and smaller than the image itself /1,2/.
114
4.2.1 The mechanics of spatial filtering
equal to the coordinates of the center of the neighborhood, and whose value is the
each pixel in the input image. If the operation performed is on the image pixels is
linear, then the filter is said to be linear spatial filter. Otherwise, the filter is
nonlinear.
There are two closely related concepts for performing linear spatial
filtering. One is the correlation and the other is the convolution. Correlation is the
process of moving a filter mask over the image and computing the sum of
products at each location. The mechanics of the convolution are the same, except
115
intensity of 3 x 3 neighborhood centered on those pixels, the average value at any
location (x, y) in the image is determined by the sum of the nine intensity values
1 9
R Zi
9 i1
(4.2)
This linear filtering operation with 3 x 3 mask whose coefficients are 1/9
implements the desired averaging. This operation results in image smoothing /1/
The smoothing filters are used for blurring and for noise reduction.
image prior to (large) object extraction, and bridging of small gaps in lines or
curves. Noise reduction can be accomplished by blurring with a linear and also by
non-linear filtering.
The output of a smoothing, linear spatial filter is simply the average of the
pixels contained in the neighborhood of the filter mask. These filters sometimes
are called averaging filters and they are also referred as low-pass filters. The idea
filter mask. This process results in an image with reduced ‘sharp’ transitions in
However, edges (which almost always are desirable features of an image) also are
false contours that result from using an in sufficient number of gray levels. A
By ‘irrelevant’ pixel means pixel regions that are small with respect to the size of
The order-static filters are nonlinear spatial filters whose response is based
on ordering (ranking) the pixels contained in the image area encompassed by the
filter, and then replacing the value of the center pixel with the value determined
by the ranking result. The best-known example in this category is the median
filter, which as its name implies, replaces the value of a pixel by the median of the
gray levels in the neighborhood of that pixel ( the original value of the pixel is
117
4.3.3 Median Filter
The median filters are quite popular because, for certain types of random
than linear smoothing filters of similar size. These filters are particularly effective
in the presence of impulse noise, also called salt-and-pepper noise because of its
The median M, of a set of values is such that half the values in the set are
less than or equal to M, and half are greater than or equal to M. in order to perform
median filtering at a point in an image. First sort the values of the pixel in
question and its neighbors, determine their median, and assign this value to that
pixel. For example, in a 3 x 3 neighborhood the median is the 5th largest value, in
a 5 x 5 neighborhood the 13th largest value, and so on. When several values in a
For example, a 3 x 3 neighborhood has values (10, 20, 20, 20, 15, 20, and
a median of 20. Thus, the principal function of median filters is to force points
with distinct gray levels to be more like their neighbors. In fact, isolated clusters
of pixels that are light or dark with respect to their neighbors, and whose area is
less than n2/2 (one-half the filter area), are eliminated by an n x n median filter. In
this case ‘eliminated’ means forced to the median intensity of the neighbors/1/.
The median is calculated by first sorting all the pixel values from the
surrounding neighborhood into numerical order and then replacing the pixel being
118
considered with the middle pixel value. The median filter, especially with larger
window size destroys the fine image details due to its rank ordering process.
Although the median filter is by far the order-static filter used in image
processing, it is by no means the only one. The median represents the 50th
percentile of a ranked set of numbers, but from basics of statistics the ranking
lends itself to many other possibilities. For example, using the 100th percentile
results in the so called max filter, this filter is useful for finding the brightest
119
points in an image. Also because the pepper noise has very low values, it is
reduced by this filter as a result of the max selection process in the sub image
areaThe 0th percentile filter is known as the min filter. This filter is useful in
finding the darkest points in an image and also, it reduces salt noise as a result of
The midpoint filter simply computes the midpoint between the maximum
and minimum values in the area encompassed by the filter. The filter combines
the order statics and averaging. It works best for randomly distributed noise, like
smoothing images, i.e. it reduces 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 value of
A 3×3 mean filter is used for smoothing the image containing the salt and
pepper noise. Since the shot noise pixel values are often very different from the
surrounding values, they tend to significantly distort the pixel average calculated
120
4.4 Modern image denoising methods
Consider an image that has been blurred and contaminated by salt and
pepper noise. Typical sources of blur are defocus and motion of camera/3/. Salt
and pepper noise is a common model for the effects of bit errors in transmission,
Gaussian noise /3/. We focus on various methods that have an important role in
modern image denoising research /5-8/. Most methods rely on the standard model
that are encountered in practice. Here ‘h’ represents a known space-invariant blur
kernel (point spread function), ‘f’ is an ideal version of the observed image ‘g’
and ‘n’ is (usually Gaussian) noise. In this research,the focus is on the case of salt
produce inadequate results in the presence of salt and pepper noise. This fact is
illustrated in figure4.3. The top-left image in figure 4.3 is the 256x256 Lena
noise.
Excellent restoration is obtained using the state of the art denoising method
of /7/ (top-right). The bottom-left image in figure 4.3 is the same blurred Lena
image, is contaminated by salt and pepper noise of density 0.01. In this case
121
restoration using the method of /7/ is clearly inadequate (bottom-right). Note that
due to the inadequacy of the noise model, the algorithm of /7/ yields poor results
degraded by salt and pepper noise. The classical linear digital image filters, such
as averaging low pass filters, tend to blur edges and other fine image details.
Therefore, nonlinear filters /15, 16/ are most preferred over linear filters due to
preservation.
Figure 4.3: Top-left: Blurred image with Gaussian noise. Top-right: Restoration using the method of /23/.
Bottom-left: Blurred image with salt and pepper noise. Bottom-right: Restoration using the method of /23/.
122
The standard median (SM) filter /17/ is the one of the most robust
within filtering window. This filter is very popular due to its edge preserving
SM filter have been introduced, such as the weighted median (WM) /18/ filter. By
approach, the filters like switching median filters /19,20/ had shown significant
/12-14/. At high noise density, image denoising using median type filtering
but the main drawbacks of all these filters are, they are prone to edge jitters in the
cases where noise density is high and their large widow size results in blurred
modified median filter algorithm called Interpolate Median filter that employs
123
4.5 Interpolate median filter
Median Filter (IMF) is proposed. The Interpolate Median filter method considers
each pixel in the image in turn and looks at its neighbors to decide whether or not
those values. The interpolation is calculated by first sorting all pixel values from
surrounding neighborhood into numerical order and then replacing the pixel being
value is derived from the Interpolation search technique used for searching the
elements. We can also call it a Non- linear filter or order-static filter because there
response is based on the ordering or ranking of the pixels contained within the
mask.
The advantages of this filter over mean and median filter are, it gives more
robust average than both the methods, for some pixels in the neighborhood; it
creates new pixel values like mean filter and for some it will not create new pixel
value like median filter, It has the characteristics of both filters. The algorithm
where K is the ‘key’, Here we make an intelligent guess about ‘key’ which is the
mid value of the array ‘a’, and a[l ], a[h] are values of bottom and top elements in
124
The value of the ‘key’ K is used in the relation 4.4 to determine the interpolated
value
Here value ‘Mid’ gives the optimal mid-point of the array and a[mid] gives the
interpolated value. This interpolated value is the new value of the pixel.
Step 1:
Step 2:
Step 3:
The noise is added to the standard test images. In this work Salt & pepper
noise is used as it is the simplest type of noise among all. According to a given
density D more or less pixels are flipped randomly to black (0) or white (1). D is
just measure of the amount of noise to be added, not a value! This type of noise is
125
Step 4:
Step 5:
The peak signal to noise ratio (PSNR) is calculated for all the standard
images with their noisy and denoised counterparts, respectively. The PSNR values
126
4.5.3 Matlab code for the Interpolate median filter
img=uint8(img);
figure,imshow(img)
img=double(img);
%img2=uint8(img2);
%snr=20*log10(norm(img2))/norm(img2-img)
% FINDING SIGNAL TO NOISE RATIO
N = prod(size(img1));
img1= double(img1(:)); img = double(img(:));
t1 = sum((img1-img).^2); t2 = sum(img1.^2);
MSE = t1/N
PSNR = 10*log10(255*255/MSE)
128
4.7 Simulation results
The proposed method is tested on some natural grayscale test images like
Lena, Barbara and Goldhill of size 512*512 pixel, at different noise levels. Table
4.1, illustrates the comparison of PSNRs of the six denoising methods. The PSNR
2552
PSNR 10 log (dB)
MSE (3.23)
m 1 n 1 2
with MSE 1 I (i, j ) K (i, j ) , (3.24)
mn i0 j 0
where I and K being the original image and de-noised image, respectively.
The original image and the noisy image of Lena is shown in th fig. 4.5
Figure 4.5 (a): The original test image (Lena) with 512x512 pixels
Figure 4.5 (b): Lena image corrupted by salt & pepper noise(dB) (20%)
129
The performance analysis of the method for Lena and Barbara image is given in
table 4.2, the noise density is varied fron 10% to 50% in steps of 10 and PSNR
TABLE 4. 1.
PSNR Performance of Different Algorithms for Lena image corrupted with salt and pepper noise
Noise Density in dB
Algorithm
10% 20% 30%
TABLE 4.2
Performance analysis
Noise Density in
Lena Barbara
dB (in %)
10 33.86 24.83
20 30.59 23.82
30 25.75 21.80
40 20.02 19.00
50 17.23 16.08
130
4.7 Conclusions
The proposed algorithm called Interpolate Median filter employs
median filter for image denoising is a simple method and easy to implement.
References
/4/ G.R. Arce, J.L. Paredes and J. Mullan. Nonlinear Filtering for Image
Analysis and Enhancement. in A.L. Bovik (Ed.), Handbook of Image &
Video Processing, Academic Press (2000).
/5/ L. Rudin, S. Osher and E. Fatemi. Non Linear Total Variation Based Noise
Re-moval Algorithms. Physica D, 60, pp. 259-268 (1992).
/6/ L. Rudin and S. Osher. Total Variation Based Image Restoration with Free
Local Constraints. Proc. IEEE ICIP, 1, pp. 31-35, Austin TX, USA (1994).
131
/8/ J. Bect, L. Blanc-Feraud, G. Aubert and A. Chambolle. A l1-Uni ed
Variational Framework for Image Restoration. Proc. ECCV'2004, Prague,
Czech Republic, Part IV: LNCS #3024, pp. 1-13, Springer (2004).
/9/ T. Chen and H.R. Wu. Space Variant Median Filters for the Restoration of
Impulse Noise Corrupted Images. IEEE Trans. Circuits and Systems II, 48,
pp. 784-789 (2001).
/11/ G. Pok, J.-C. Liu and A.S. Nair. Selective Removal of Impulse Noise based
on Homogeneity Level Information. IEEE Trans. Image Processing, 12,
pp. 85-92 (2003).
132
/19/ H. Hwang and R. A. Haddad. Adaptive median filters: New algorithms
and results. IEEE Trans. Image Process., 4, no. 4, pp.499–502 (1995).
st
/20/ A. Bovik, Handbook of Image & Video Processing. 1 Ed. New York:
Academic (2000).
/21/ http://homepages.inf.ed.ac.uk
133