You are on page 1of 12

Salt & Pepper Noise Reduction

from Gray-Scale Images using


Adaptive Median Filter
Abstract

The existence of impulse noise is one of the most frequent problems in


many digital image processing applications. So for the removal of such impulse
noise median based filter becomes widely used. However, there are many
variations of median filter in literature. In addition to standard median filter,
there are weighted median filter, recursive median filter, iterative median filter,
directional median filter, adaptive median filter and switching median filter.
In this project a simple, yet efficient way to remove impulse noise from
digital images is presented. Linear and nonlinear filters are available for the
removal of impulse noise; however the removal of impulse noise often brings
about blurring which results in edges being distorted and poor quality. Therefore
the necessity to preserve the edges and fine details during filtering is the
challenge faced by researchers today. In this project, we present a new median
filter based technique, which is a combination of adaptive median filter and
hybrid median filter.

This method consists of noise detection followed by the removal of detected noise by Adaptive
median filter using selective pixels that are not noise themselves in gray level images. Noise
detection is based on only the two intensity values i.e. 0 & 255; the pixels are roughly divided
into two classes, which are “noise-free pixel” and “noise pixel”. In impulse noise elimination,
only the “noise pixels” are processed. The “noise-free pixels” are copied directly to the output
image. The method adaptively changes the size of the median filter based on the number of the
“noise- pixels” in the neighborhood. For the filtering, only “noise-free pixels” are considered for
the finding of the median value. Computer simulations were carried out to analyze the
performance of this method.
Contents

Chapter 1: Introduction

1.1 Overview

1.2 Objective

Chapter 2: Digital Image Processing

Chapter 3: Noise in digital images

Chapter 4: Image filtering techniques

Chapter 5: Noise Reduction by proposed filtering approach

Chapter 6: Mat lab code

Chapter 7: Conclusion

Chapter 8: Scope of future work


Chapter 1

Introduction

1.1 Overview

Digital images 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. So, even a small percentage of impulse noise distorts the image
greatly compared to other noises.

Image noise removal plays a vital role in image processing as a pre-


processing stage. The non-ideal imaging systems introduce potential
degradations in digital images. Noise disturbances may also be caused by
electronic imaging sensors, film granularity, and channel noise. High levels of
noise are always undesirable; hence noise removal has to be employed before
the image could be used for further analysis.

Salt and pepper noise is an impulse type of noise, which is also referred to as intensity spikes.
This is caused generally due to dead pixels, analog-to-digital converter errors, errors in data
transmission, malfunctioning of pixel elements in the camera sensors, faulty memory
locations, or timing errors in the digitization process. It has only two possible values, ‘a’ and
‘b’. The probability of each is typically less than 1. The corrupted pixels are set alternatively
to the minimum or to the maximum intensity values, giving the image a “salt and pepper”
like appearance. Unaffected pixels remain unchanged. For an 8-bit image, the typical
intensity value for pepper noise is 0 and for salt noise 255.

1.2 Objectives
The objective of this project is analysis of Adaptive Median filter and
improving its performance by using hybrid median technique on grayscale
images.
CHAPTER 2

DIGITAL IMAGE PROCESSING

Pictures are the most common and convenient means of conveying or


transmitting information. A picture is worth a thousand words. Pictures
concisely convey information about positions, sizes and inter-relationships
between objects. They portray spatial information that we can recognize as
objects. Human beings are good at deriving information from such images,
because of our innate visual and mental abilities. About 75% of the information
received by human is in pictorial form.

In the present context, the analysis of pictures that employ an overhead


perspective, including the radiation not visible to human eye are considered. Thus
our discussion will be focusing on analysis of remotely sensed images. These
images are represented in digital form. When represented as numbers, brightness
can be added, subtracted, multiplied, divided and, in general, subjected to statistical
manipulations that are not possible if an image is presented only as a photograph.
Although digital analysis of remotely sensed data dates from the early days of
remote sensing, the launch of the first Landsat earth observation satellite in 1972
began an era of increasing interest in machine processing (Cambell, 1996 and
Jensen, 1996). Previously, digital remote sensing data could be analyzed only at
specialized remote sensing laboratories. Specialized equipment and trained
personnel necessary to conduct routine machine analysis of data were not widely
available, in part because of limited availability of digital remote sensing data and a
lack of appreciation of their qualities.
Chapter 3

Noise in digital images

Noise gets introduced into the data via any electrical system used for storage,
transmission, and/or processing. In addition, nature will always plays a "noisy" trick
or two with the data under observation.

When encountering an image corrupted with noise you will want to improve
its appearance for a specific application. The techniques applied are application-
oriented. Also, the different procedures are related to the types of noise introduced to
the image. Some examples of noise are: Gaussian or White, Rayleigh, Shot or
Impulse, periodic, sinusoidal or coherent, uncorrelated, and granular.

Noise

ii. Salt and Pepper Noise

Salt and pepper noise is an impulse type of noise, which is also referred to as intensity
spikes. This is caused generally due to dead pixels, analog-to-digital converter errors,
errors in data transmission, malfunctioning of pixel elements in the camera sensors,
faulty memory locations, or timing errors in the digitization process.


It has only two possible values, ‘a’ and ‘b’. The probability of each is typically
less than 1. The corrupted pixels are set alternatively to the minimum or to the
maximum intensity values, giving the image a “salt and pepper” like
appearance. Unaffected pixels remain unchanged.

Usually, for an 8-bit image, a =1(black) and b=0 (white)
The probability density function for this type of noise is shown in figure below:

(a) (b)

Figure 1: a) Salt and pepper noise image b) PDF for salt and pepper noise
Chapter 4

Image filtering techniques


The existence of impulse noise is one of the most frequent problems in many
digital image processing applications. So for the removal of such impulse noise
median based filter becomes widely used. However, there are many variations of
median filter in literature. In addition to standard median filter, there are weighted
median filter, recursive median filter, iterative median filter, directional median filter,
adaptive median filter and switching median filter. Among all these, the standard
median filtering and adaptive median filtering techniques are discussed below.

A. Standard median filter (SMF)

The standard median filter is a simple rank selection filter also called as
median smoother, introduced by tukey in 1971 that attempts to remove impulse noise
by changing the luminance value of the center pixel of the filtering window with the
median of the luminance values of the pixels contained within the window. Although
the median filter is simple and provides a reasonable noise removal performance, it
removes thin lines and blurs image details even at low noise densities. A Median filter
belongs to the class of non-linear filters. The median filter follows the moving
window principle.
e.g.:- A 3x3, 5x5, or 7x7 kernel of pixels is scanned over the pixel matrix of the entire
image. The median of the pixel values in the window is computed, and the centre
pixel of the window is replaced with the computed median.
The median is just the middle value of all the values of the pixels in the
neighborhood. This is not the same as the average (or mean); instead, the median has
half the values in the neighborhood larger and half smaller. The median is a stronger
"central indicator" than the average.
The Standard Median filtering (SMF) is done by first sorting all the pixel
values from the surrounding neighborhood into numerical order and then replacing
the pixel being considered with the middle pixel value.
123 125 126 130 140

120 124 126 127 135

118 120 150 125 134

119 115 119 123 133

111 116 110 120 130

Figure 8: Calculating the median value of a pixel neighborhood in 3x3 window

Here, neighborhood values are:


115,119,120,123,124,125,126,127,150
arranged in increasing order.
Median value: 124
Central pixel value: 150
Now, the central pixel value 150 in the 3x3 window is replaced with the median value
of 124.

The disadvantage of the SMF:-


Although SMF is a useful non-linear image smoothing and enhancement
technique. It also has some disadvantages.


The SMF removes both the noise and the fine detail since it can't tell the
difference between the two.


Anything relatively small in size compared to the size of the neighborhood will
have minimal affect on the value of the median, and will be filtered out.


In other words, the SMF can't distinguish fine detail from noise.
Chapter 5

NOISE REDUCTION BY PROPOSED FILTERING APPROACH

The proposed filtering approach is the combination of adaptive median filter and the hybrid
median filter. First of all the adaptive median filter is used to remove salt and pepper noise
from a gray-scale image and then hybrid median filter is used to retain the edges and fine
details of the image.

Chapter 6

Matlab code

>> i=imread(‘Naveed.jpg');
>> imshow(i)
>> i=imread(‘Naveed.jpg');
>> imshow(i)
K= medfilt2(noisy_img);
close all;
subplot(211);imshow(noisy_img); subplot(212); imshow(k);

Chapter 7

Conclusion
In this project, we analyze the images that are corrupted with high density of
impulse noises based on different PSNR and MSE values. Adaptive filtering is an
improved filtering technique as compare to median filter in which the filtering is applied
only to corrupted pixels in the image while the uncorrupted pixels are left unchanged. The
Adaptive filtering approach is used to reduce the number of noisy pixels during filtering.
The advantage of Adaptive filter is that it is retaining the edge information in the case of
high density impulse noises. The Adaptive filter is found to be retaining finer details in the
image and the images restored are with an improved visual quality. The detail preservation
ability of the adaptive filter makes it suitable for medical image denoising, where also
detail preservation is an important issue.
The edges and fine details of the image are preserved by using the hybrid median
filter. The hybrid median filters have some of the advantages in image processing. 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.

From the simulation result of PSNR and MSE, I have found that after combining the adaptive
median filter and hybrid median filter, image denoising is enhanced. It produces better result.
However for adaptive median filter it is found that for Smax=3 and Salt-pepper noise
density=10%, image denoising is better as compared to standard median filter. The higher the
PSNR value, the higher will be the quality of the image. Also, lower the value of MSE, higher
will be the quality of the image.

Chapter 8

Scope of future work


In Future the adaptive algorithm can be improved for removing the image noise
completely without visible distortion. The main techniques involved for this improvement
are: - (1) adaptive noise detection, (2) non-linear filter. For this adaptive processing, three
parameters with MSE, local background and PSNR can further improve. The PSNR and
MSE can be dynamically modified according to local image features. Furthermore, the
improved adaptive filter can be very appropriate for a VLSI chip implementation in real-
time systems. Therefore, this adaptive approach can be able to provide better performance
in video noise reduction and morphological operations in real-time applications

You might also like