Removal of Salt and Pepper Noise of An Image using

2nd National Conference on Emerging Trends in Electronics and Communication (NCETEC-94)
2015
Removal of Salt and Pepper Noise of An
Image using Hybrid Median Filter
Sharfia, Geetha S M, Suchithra H S
VIII Semester BE Students, Department of Electronics and Communication Engineering
Bahubali College of Engineering, Shravanabelegola, India
E-mail:[email protected],[email protected],[email protected]
Abstract-Image is a representation of the external form of a person or thing in art. Images are captured by
the camera and processed and stored in memory. During this process the images are corrupted due to
impulse noises. The image pixels are getting damaged due to these noises. The different types of noises occur
due to transmission errors, malfunctioning pixel elements in the camera sensors, faulty memory location,
timing errors in analog-to-digital conversion. In this paper we are considering only salt and pepper noise.
There are different types of filtering techniques have been used, which are Median filter, Weiner filter and
Hybrid Median filter in order to remove the salt and pepper noise from the image. Finally we compared all
the filter output and concluded that Hybrid median filter is the better noise removal than other filters and
MATLAB simulation is used for performance analysis of filters.
Keywords- Filter, Median Filter, Weiner Filter, Hybrid Median Filter.
I.
INTRODUCTION
Images are often corrupted by impulse noise due to transmission errors, malfunctioning pixel elements
in the camera sensors, faulty memory locations, and timing errors in analog-to-digital conversion. In most
applications, denoising the image is fundamental to subsequent image processing operations. The goal of noise
removal is to suppress the noise while preserving image details. A variety of techniques have been proposed to
remove impulse noise. Noise is perturbations of the pixel values. Noise arises in the sensor or the imaging
process. Noise may degrade the visual interpretation. Noise may be removed by filtering. Of course, noise
cannot be perfectly removed. Noise removal, reconstructs the correct pixel values. Generic filters such as the
mean filters, order statistics filters are used to remove the noise in an image.
Image filters produce a new image from an original by operating on the pixel values. Filters are used to
suppress noise, enhance contrast, find edges, and locate features. If we want to enhance the quality of images,
we can use various filtering techniques which are available in image processing. There are various filters which
can remove the noise from images and preserve image details and enhance the quality of image. The common
noise which contains the image is impulse noise. The impulse noise is salt and pepper noise (image having the
random black and white dots). Mean filter is not perfect for remove impulse noise. Impulse noise can be
removed by order statistics filter. The median filter is the filter that removes most of the noises in image. But
there is advanced filter called hybrid median filter. Hybrid median filter is the combination of Wiener filter and
median filter to remove the upcoming noises in image enhancement. It maintains intensity, luminance and
density of image. The hybrid filter removes blurredness at one time, which preserves corner with removal of
impulse noise.
Digital image which are related to digital signals are normally corrupted by many types of noise,
including impulse noise. Impulse noise is a set of random pixels, which has a very high contrast compared to the
surroundings. Image de-noising is a key component of image processing workstation. Denoising is nothing but
reducing the noise in homogeneous areas while preserving image detail.
There is any type of noise which is added to the input image and image gets degraded. The image
degradation should not be there in image processing. For that we have to remove noise in an image as much as
1
©2015 ISRASE
ISRASE eXplore Digital Library
2nd National Conference on Emerging Trends in Electronics and Communication (NCETEC-94)
2015
possible. In order to remove these types of noise we use various types of filters. Impulse noises are classified
into two major types:
 Salt and pepper noise (equal height impulses) impulse values are represented as 0 and 255. Typical
noise sources include flecks of dust inside the camera and overheated or faulty CCD elements.
 Random-valued impulse noise (unequal height impulses) impulse values are between 0 and 255.
Filters are used to remove noise from digital image while keeping the details of image conserved is a
necessary part of image processing. Filters can be described by different categories spatial and frequency
domain filtering.
Advantages of Hybrid Median Filter



It improves the quality of the image by removing impulse noise.
It produces the brightness difference.
It also validates the presence of noise in image and does processing accordingly.
The rest of the paper is organized as follows: Section II presents an overview of the methodology used. Section
III gives simulation results and analysis. Finally section IV gives the concluding remarks.
II.
METHODOLOGY
In this section we detail the implementations done. Consider the structure of a hybrid filter as shown in
figure 1.
Fig.1: Hybrid Filter
We first feed input into median filter, we arrange median filter first, the median is calculated by first
sorting all the pixel values from the surrounding neighbourhood into numerical order and then replacing the
pixel being considered with the middle pixel value. When the quantity of impulse noise is increased the median
filter doesn‟t give best result. Since edges are minimally degraded, median filters can be applied repeatedly, if
necessary. The median filter tends to preserve brightness differences across signal steps, resulting in minimal
blurring of regional boundaries.
Next we will feed into Weiner filter. The most important role of Weiner filter is to removal of blur in
images due to linear motion or unfocussed optics is the Wiener filter. Then it is feed into hybrid median filter
efficiently removes salt and pepper noise from digital images while preserving thin lines and edges in the
original image.
a) Median Filtering
Median filtering is a non-linear filtering technique that is well known for the ability to remove
impulsive-type noise, while preserving sharp edges. The median filter is an order statistics filter. Also Mean
filter is used to remove the impulse noise. Mean filter replaces the mean of the pixels values but it does not
preserve image details. Some details are removes with the mean filter. But in the median filter, we do not
replace the pixel value with the mean of neighbouring pixel values, we replaces with the median of those values.
The median is calculated by first sorting all the pixel values from the surrounding neighbourhood into numerical
order and then replacing the pixel being considered with the middle pixel value.
In median filter, the pixel value of a point p is replaced by the median of pixel value of 8neighbourhood of a point „p‟. The operation of this filter can be expressed as:
2
©2015 ISRASE
ISRASE eXplore Digital Library
2nd National Conference on Emerging Trends in Electronics and Communication (NCETEC-94)
2015
g(p)= median{f(p),where p € N8(p)}
Fig. 2 : Pixels of an Image
Consider figure 2. Neighbourhood value: 115,119,120,123,124,125,126,127,150.
Median values: 124.
The median filter gives the best result when the impulse noise percentage is less than 0.1%. When the
quantity of impulse noise is increased the median filter not gives good result. The median filter also tends to
preserve the positions of boundaries in an image, making this method useful for both visual examination and
measurement. In addition, application of a median filter may be repeated until there are no further changes in the
filtered image. Multiple applications of the median filter (with smaller neighbourhood masks) can improve noise
suppression at the expense of a loss in image detail. With repeated applications of the filter, pasteurization can
occur. Normally median filters have not been used for spatial grain-suppression because grain noise is not
impulsive. But have found wide application in the suppression of impulsive noise. Median filtering is also used
in television applications, for example in the generation of an image sequence with progressive scanning from
an interlaced original.
Unlike filtering by convolution (linear filtering) non-linear filtering uses neighbouring pixels according
to a non-linear law. The median filter (specific case of rank filtering), which is used in this exercise, is a
classical example of these filters. Just like the linear filters, a non-linear filter is performed by using a
neighbourhood.
b) Weiner Filter
The most important technique for removal of blur in images due to linear motion or unfocussed optics
is the Wiener filter. Image filtering algorithms are applied on images to remove the different types of noise that
are either present in the image during capturing or injected into the image during transmission. The performance
of the Wiener Filter after de-noising for Speckle and Gaussian noisy image is better than Median filter. The
performance of the Median filter after de-noising for Salt & Pepper noisy image is better than Wiener filter.
c)
Hybrid Median Filter
This method incorporates improved adaptive wiener filter and adaptive median filter to reduce salt and
pepper noise respectively. The fundamental superiority of the proposed operator over most other operators is
that it efficiently removes salt and pepper noise from digital images while preserving thin lines and edges in the
original image. It is as show in figures 3 and 4.
Fig. 3: Hybrid Filter
3
©2015 ISRASE
ISRASE eXplore Digital Library
2nd National Conference on Emerging Trends in Electronics and Communication (NCETEC-94)
2015
Fig. 4: Structure of Hybrid Filter
The complete procedure involved in the process is detailed in the flow chart shown in figure 5. When an
image captured by the camera due to transmission errors, malfunctioning pixel elements in the camera sensors,
faulty memory locations, and timing errors in analog-to-digital conversion. An original image will get corrupted
by salt and pepper noise in order to remove these noises. We have used filtering technique like Median filter,
Wiener filter and Hybrid median filter. First we have passed an noisy image to Median filter in order to remove
noise from image then the output of Median filter is then passed into Weiner filter which is use to remove the
blurness from the image. Since we know the combination of Median filter and Weiner filter is Hybrid median
filter. We have reconstructed the original image.
Fig. 5: Flowchart of the Proposed Algorithm
4
©2015 ISRASE
ISRASE eXplore Digital Library
2nd National Conference on Emerging Trends in Electronics and Communication (NCETEC-94)
III.
2015
SIMULATION RESULTS AND ANALYSIS
The following below figures shows the how the image get corrupted while images are captured by the
camera and processed and stored in memory. In order to de-noise the corrupted image we have considered three
filters like median filter, weiner filter and hybrid median filter. First let us consider Median Filter as we know
median filter preserves the sharp edges and remove the salt and pepper noise which is less than 0.1% as shown
in fig.9. Second is Weiner Filter removes the noise better than median filter as shown in fig.10. Third is Hybrid
Median Filter which is advance version to remove the salt and pepper noise efficiently and preserves the edges
better than Median Filter as shown in the fig. 11. We can also see the SNR of three filters and conclude that
Hybrid Median Filter removes the noise better and improves the signal power and minimize the noise in the
image.
Fig 7.Original Image
Fig 8.Noisy Image
5
©2015 ISRASE
ISRASE eXplore Digital Library
2nd National Conference on Emerging Trends in Electronics and Communication (NCETEC-94)
2015
Fig 9.Median Filter output
Fig 10.Weiner Filter output
Fig 11.Hybrid Median Filter output
SL.NO
FILTERS
MSE
SNR
1
Median
Filter
82.14
29.0193
6
©2015 ISRASE
ISRASE eXplore Digital Library
2nd National Conference on Emerging Trends in Electronics and Communication (NCETEC-94)
2
3
Weiner
Filter
Hybrid
Median
Filter
33.93
32.8590
10.13
38.1104
2015
Table 1.Comparision of three filters
IV.
CONCLUSION
In this project we intended to remove the salt and pepper noise from the image by using the hybrid median
filter. We have applied various filters like Median filter, Weiner filter and Hybrid Median filter to noisy image
finally we found that Hybrid median filter is better to remove the salt and pepper noise efficiently. For repeated
application the hybrid median filter does not excessively smooth image details, Edge treating is possible, Hybrid
median filter preserves edges better than a median filter, Preserves brightness difference., Simple to understand
The HMF has some disadvantages also in IP.
REFERENCES
[1]. L. R. Rabiner, M. R. Sambur, and C. E. Schmidt, “Applications of a nonlinear smoothing algorithm to speech processing,”
ZEEE Trans. Acoust., Speech, Signal Processing, vol. ASSP-23, pp. 552-557, Dec. 1975.
[2]. N. S. Jayant, “Average and median-based smoothing techniques for improving digital speech quality in the presenceof
transmission errors,”IEEE Trans. Commun., vol. COM-24, pp. 1043-1045, Sept. 1976.
[3]. W. K. Pratt, “Median filtering,” in Semiannual Report, Image Processing Institute, Univ. of Southern California, Sept. 1975.
[4]. S. G. Tyan, “Fixed points of running medians” (unpublished report), Dep. Elec. Eng. Electrophysics, Polytechnic Inst. Of Ne w
York, Brooklyn, NY, 1977.
[5]. B. Justusson, “Statistical properties of median filters in signal and image processing” (unpublished report), Math. Inst., Royal
Inst. of Technology, Stockholm, Sweden, Dec. 1977.
[6]. Gonzalez and Woods, Digital image processing, 2nd edition, Prentice Hall, 2002. [1] Rafael C. Gonzalez, Richard E. Woods,
“Digital ImageProcessing”, 2nd edition, Prentice Hall, 2002.
[7]. Maria Petrou, PanagiotaBosdogianni, “Image Processing:The Fundamental”, John Wiley & Sons Ltd, 2000.
7
©2015 ISRASE
ISRASE eXplore Digital Library