Comparative study of Salt & Pepper filters and Gaussian filters
1. [February 2012]
Comparative study of Salt & Pepper filters and Gaussian filters
By
Ankush Srivastava
[Email: anksrizzz@gmail.com, anksri000@gmail.com]
Abstract: This article attempts to integers, called pixels, representing a
undertake the study of two types of physical quantity such as scene
noise such as Salt & Pepper Noise and radiance, stored in a digital memory,
Gaussian Noise. Different noise have and processed by computer or other
been removed by using various type digital hardware [25]. The importance
of filters as Minimum Filter, Maximum of image sequence processing is
Filter, Mean Filter, Rank Order Filter, constantly growing with the ever
Median Filter, Blur Method, Gaussian increasing use of digital television and
Filter and Weight Median Filter. The video systems in consumer,
comparative study is conducted with commercial, medical, and
the help of Peak Signal to Noise Ratio communicational applications. Digital
(PSNR). image processing has many
advantages over analog image
Introduction: Digital image processing; it allows a much wider
processing is a rapidly evolving field range of algorithms to be applied to
with growing application in science the input data and can avoid problems
and engineering [1]. Various such as build-up of noise and signal
techniques have been developed in distortion during processing. So noise
Image Processing during the last four cancellation/filtering are an
to five decades. Image processing important task in image processing.
holds the possibility of developing the
ultimate machine that could perform Image Noise: Noise represents
the visual functions of all living being. unwanted information which
The primary purpose of image deteriorates image quality. It is
processing is to convert image into defined as a process which affects the
valuable information [7]. The term acquired image and is not part of the
digital image processing generally sense. Noise is introduced into images
refers to processing of a two- usually while transferring and
dimensional picture by the digital acquiring them.
computer [1]. Digital image
processing is a subset of the electronic Types of Noise: The main type of
domain wherein the image is noise added while image acquisition
converted to an array of small is called Gaussian noise while
2. Impulsive noise is generally ideally should smooth the distinct
introduced while transmitting image parts of the image. A universal noise
data over an unsecure communication removing scheme is implemented
channel, while it can also be added by which weighs each pixel with respect
acquiring. to its neighborhood and deals with
Gaussian noise. Such noise is usually
Salt & Pepper Noise: The salt and introduced during image acquisition.
pepper noise is caused by sharp,
sudden disturbances in the image Filters: Various techniques are
signal; its appearance is randomly employed for the removal of these
scattered white or black (or both) types of noise based on the properties
pixels over the image [25]. Salt & of their respective noise models.
Pepper Noise or impulse noise Image filtering is not only used to
generally is digitized as extreme (pure improve image quality but also is used
white or black) values in an image. An as a preprocessing stage in many
image containing salt-and-pepper applications including image
noise will have dark pixels in bright encoding, pattern recognition, image
regions and bright pixels in dark compression and target tracking, to
regions. This type of noise can be name a few. General-purpose image
caused by dead pixels, analog-to- filters lack the flexibility and
digital converter errors, and bit errors adaptability of un-modeled noise
in transmission. In the case of types.
impulsive noise removal, the aim of Noise reduction is a two-step process:
optimal filtering is to design noise 1) Noise detection and
reduction algorithms that would 2) Noise replacement.
affect only corrupted image pixels, In first step location of noise is
whereas the undistorted image pixels identified and in second step detected
should be invariant under the filtering noisy pixels are replaced by estimated
operation. Thus, an impulse detector value. Efficiency of noise reduction
can be employed to classify each pixel algorithm depends on both noise
in the noisy images as noise or not detection and noise replacement.
prior to filtering.
Salt & Pepper Noise Removal
Gaussian Noise: Gaussian noise is a
set of values taken from a zero mean Noise detection: if the intensity value
Gaussian distribution which are of pixel is less than or equal to 0 then
added to each pixel value. Impulsive there is Pepper noise and if the
noise involves changing a part of the intensity value of pixel is greater than
pixel values with random ones. or equal to 255 then there is Salt noise
Gaussian Noise removal algorithms
3. [17]. These pixels are being
processed.
Intensity value of pixel at position (x,
y) ={
Histogram of corrupted image
Minimum Filtering: Minimum filter
removes the white (salt) dots because
any single white pixel within the
selected filter region is replaced by
one of its surrounding pixels with a
Original Image smaller value [2], [5].
I’ (u, v) ← min {I (u+i, v+j) | (i, j) ∈ R}
Steps:
1. Put pixel value of surrounding (of
noisy pixel) pixels in a single dim
array.
2. Sort this array in ascending order.
3. The noisy pixel value is replays by
first element of the sorted array.
Histogram of Original Image
Applying Minimum Algorithm
Image corrupted by Salt & Pepper Noise
4. Histogram
Histogram
Mean Filtering: In mean filtering, we
Maximum Filtering: Minimum filter replace the desired pixel intensity
removes the black (pepper) dots with the arithmetic mean of its
because any single black pixel within surrounding pixel’s intensity value
the selected filter region is replaced [5].
by one of its surrounding pixels with a Steps:
greatest value [2], [5]. 1. Take the arithmetic mean of
I’ (u, v) ← max {I (u+i, v+j) | (i, j) ∈ R} surrounding (of noisy pixel) pixel
Steps: values.
1. Put pixel values of surrounding (of 2. The noisy pixel value is replays by
noisy pixel) pixels in a single dim the resulted arithmetic mean of its
array surrounding pixels.
2. Sort this array in ascending order.
3. The noisy pixel value is replays by
last element of the sorted array.
Applying Mean Algorithm
Applying Maximum Algorithm
5. Histogram Histogram
Rank Order Filtering: In rank order Median Filtering: In median filtering,
filtering, first we sort the surrounding first we sort the surrounding pixels of
pixels of desired pixel behalf of its desired pixel behalf of its intensity
intensity value then desired pixel will value then desired pixel will be
be replaced by as per user define replaced by middle element of sorted
order [23]. pixel values [2], [5].
Steps: I’ (u, v) ← mid {I (u+i, v+j) | (i, j) ∈ R}
1. Put pixel values of surrounding (of Steps:
noisy pixel) pixels in a single dim 1. Put pixel values of surrounding (of
array noisy pixel) pixels in a single dim
2. Sort this array in ascending order. array
3. Take the order ‘r’ of element from 2. Sort this array in ascending order.
the user. 3. The noisy pixel value is replays by
middle element of the sorted array.
The noisy pixel value is replays by rth
element of the sorted array.
Applying Median Algorithm
Applying Rank Order Algorithm with order 2
6. Applying Proposed Method 1
Histogram
Histogram
Proposed Method 1: In proposed
method 1, first we sort the Proposed Method 2: In proposed
surrounding pixels of desired pixel method 2, first we sort the
behalf of its intensity value then we surrounding pixels of desired pixel
take the arithmetic mean of middle-1, behalf of its intensity value then we
middle, middle+1 of sorted pixel take the arithmetic mean of minimum
values and this will replays the and maximum element of sorted pixel
desired pixel value. values and this will replays the
Steps: desired pixel value.
1. Put pixel values of surrounding (of Steps:
noisy pixel) pixels in a single dim 1. Put pixel values of surrounding (of
array noisy pixel) pixels in a single dim
2. Sort this array in ascending order. array
3. Now take arithmetic mean of 2. Sort this array in ascending order.
(middle-1), (middle) and 3. Now take arithmetic mean of first
(middle+1) element of the sorted and last element of the sorted
array. array.
The noisy pixel value is replays by The noisy pixel value is replays by
resulted arithmetic mean value. resulted arithmetic mean value.
7. Applying Proposed Method 2 Proposed Method 1 37.3239
Proposed Method 2 34.7473
Gaussian Noise Removal
Noise detection: We compare and
take absolute difference of each pixel
from original image and corrupted
image. If there is any difference then
that pixel is noisy pixel and being
process for the noise removal.
Histogram
Experimental Results: The
performance evaluation of the
filtering operation is quantified by the
PSNR (Peak Signal to Noise Ratio) and
MSE (Mean Square Error) calculated
using formula:
PSNR = ⁄
√
Where MSE is stands for Mean Square
Error and calculated by the following
formula,
∑ ∑
MSE = Original Image
Where M is with of the image, N is
height of the image, i and j are the
pixel positioning coordinates.
o PSNR value of noisy image is
31.4395 dB.
Filter Type PSNR value
of image (in
dB)
Minimum 32.8731
Maximum 30.7662 Histogram
Mean 37.1102
Rank Order with 34.4930
order is 2
Median 37.3239
8. Image corrupted by Gaussian Noise Applying Blur
Histogram Histogram
Blur Method: In blur method, we Gaussian Filter:
replace the noisy pixel intensity with In Gaussian Filter, the noisy pixel is
the arithmetic mean of its replays by the resulted value of
surrounding pixel’s intensity value. multiplication of kernel matrix and
Steps: selected region from the image. [2][3]
1. Take the arithmetic mean of Steps:
surrounding (of noisy pixel) pixel 1. First we create the kernel matrix
values. by using he following formula:
2. The noisy pixel value is replays by K[x, y] =
the resulted arithmetic mean of its
2. Take addition of all the elements of
surrounding pixels.
kernel matrix.
3. Multiply the kernel matrix and
selected region of the image and
9. take the addition of these values in Steps:
another variable. 1. Put pixel values of surrounding (of
4. And divide this value with the noisy pixel) pixels in a single dim
addition of kernel matrix. array
5. Now the noisy pixel is replays by 2. Sort this array in ascending order.
resulted value comes from step 4. 3. The noisy pixel value is replays by
middle element of the sorted array.
Applying Gaussian Algorithm
Applying Median Algorithm
Histogram
Histogram
Median Filter: In median filtering,
first we sort the surrounding pixels of Weight Median Filter:
desired pixel behalf of its intensity In weight median filter, the noisy pixel
value then desired pixel will be is replays by the middle element of
replaced by middle element of sorted the sorted array which full of pixel
pixel values. [2][5] values [5].
I’ (u, v) ← mid {I (u + i, v + j) | (i, j) ∈ Steps:
R}
10. 1. First we create weight matrix with Experimental Results: The
following values: performance evaluation of the
filtering operation is quantified by the
PSNR (Peak Signal to Noise Ratio) and
MSE (Mean Square Error) calculated
2. Put the values of surrounding using formula:
(noisy pixel) pixels in single dim
array with the repetitive values PSNR = ⁄
√
according to the values of weight
matrix. Where MSE is stands for Mean Square
4. Sort this array in ascending order. Error and calculated by the following
5. The noisy pixel value is replays by formula,
middle element of the sorted array. ∑ ∑
MSE =
Where M is with of the image, N is
height of the image, i and j are the
pixel positioning coordinates.
o PSNR value of noisy image is
32.4583 dB.
Filtering Type PSNR value of
image(in dB)
Blur Method 33.6072
Gaussian 33.1504
Median 33.5380
Weight Median 33.4232
Applying Weight Median Algorithm
Conclusion: This paper highlighted
the noise removal algorithms for gray
scale images as well as color images
corrupted by Salt & Pepper and
Gaussian noise. This work primarily
focuses on comparing the efficiency of
noise removal algorithms. The
comparative study is explained by
with the help of Peak Signal to Noise
Ratio (PSNR). For removing the salt &
Histogram Pepper noise we applied various noise
filtering algorithms such as Minimum,
Maximum, Mean, Rank Order and
11. Median Filters. The Median Filter Noise from Remote Sensing
produces the correct image as Image”.
compare to all other filtering 11. Paul Murry and Stephen Marshall,
algorithms. In other side for removing “A Fast Method for compute the
Gaussian noise we applied Blur output of rank order filters within
method, Gaussian, Median and Weight arbitrarily shaped windows”.
Median filtering algorithms and 12. Gajanand Gupta, “Algorithm for
compare these algorithms with help Image Processing Using Improved
of Peak Signal to Noise Ratio (PSNR) Median Filter and Comparison of
value. Mean, Median and Improved
Median Filter”.
References: 13. Shitong Wang, Yueyang Li, Fu-lai
1. Anil K. Jain, “Fundamentals of Chung and Min Xu, “An Iterative
Digital Image Processing”. Self-adaptive Algorithm to
2. Rafael C. Gonzalez, Richard E. Impulse Noise Filtering for Color
Woods, “Digital Image Images”.
Processing”. 14. Krisana Chinnasarn, “Removing
3. Alasdair McAndrew, “An Salt-and-Pepper Noise in
Introduction to Digital Image Text/Graphics Images”.
Processing with MATLAB”. 15. Minakshi Kumar, “Digital Image
4. Bernd Jahne, “Digital Image Processing”.
Processing”. 16. Dr. K. Sri Rama Krishna, A. Guruva
5. Wilhelm Burger, Mark J. Burge, Reddy, Dr. M.N. Giri Prasad, Dr. K.
“Principles of Digital Image Chandrabushan Rao, M. Madhavi,
Processing”. “Genetic Algorithm Processor for
6. Nick Efford, “Digital Image Image Noise Filtering Using
Processing”. Evolvable Hardware”.
7. Dr. Puneet Misra, “A Primary 17. Manohar Annappa Koli, “Robust
Study on Digital Image Algorithm for Impulse Noise
Processing”. Detection”.
8. Mark Nixon and Alberto Aguado, 18. K.M.M. Rao, “Overview of Image
“Feature Extraction & Image Processing”.
Processing”. 19. John Eakins, Margaret Graham,
9. Gerhard X. Ritter and Joseph N. “Content-based Image Retrieval”.
Wilson, “Computer Vision 20. Ziv Yaniv, “Median Filtering”.
Algorithms in Image Algebra”. 21. Mahmoud Saeidi, Khadijeh Saeidi,
10. Mr. Salem Saleh Al-amri, Dr. N.V. Mahmoud Khaleghi, “Noise
Kalyankar and Dr. Khamitkar S.D, Reduction in Image Sequences
“A Comparative Study of Removal
12. using an Effective Fuzzy Corrupted by Additive Gaussian
Algorithm”. Noise”.
22. Ce Liu, William T. Freeman, 30. L. Nataraj, A. Sarkar and B. S.
Richard Szeliski, Sing Bing Kang, Manjunath, “Adding Gaussian
“Noise Estimation from a Single Noise to Denoise JPEG for
Image”. Detecting Image Resizing”.
23. Anthony Edward Nelson,
“Implementation of Image
Processing Algorithms on FPGA
Hardware”.
A. Gasteratos, I. Andreadis and Ph.
Tsalides, “Realization of Rank
Order Filters based on Majority
Gate”.
24. Er. Harish Kundra, Er. Monika
Verma, Er. Aashima, “Filter for
Removal of Impulse Noise by
Using Fuzzy Logic”.
25. Yiqiu Dong, Raymond H. Chan, and
Shufang Xu, “A Detection Statistic
for Random-Valued Impulse
Noise”.
26. Umesh Ghanekar, “A Novel
Impulse Detector for filtering of
Highly Corrupted images”.
27. Jian-Feng Cai, Raymond H. Chan,
and Mila Nikolova, “Two-Pahse
approach for Deblurring Images
Corrupted by Impulse Plus
Gaussian Noise”.
28. Naga Sravanthi Kota, G.
Umamaheswara Reddy “Fusion
Based Gaussian noise Removal in
the Image using Curvelets and
Wavelets with Gaussian Filter”.
29. Shyam Lal, Mahesh Chandra and
Gopal Krishna Upadhyay, “Noise
Removal Algorithm for Images