You are on page 1of 18

DSP PROJECT

Noise Reduction
In Medical Images

Submitted To Submitted By
Ms. Neelu Jain Samir Dutt
Course Instructor (DSP) 051283
E&EC
DECLARATION

I hereby declare that the project entitled “Noise Reduction in Medical Images” is an authentic
record of my own work carried as a requirement for the course of Digital Signal Processing in
the 7th semester for the award of degree of B.E. Electronics and Electrical Communication,
Punjab Engineering College (Deemed University), Chandigarh, under the guidance of Ms. Neelu
Jain.

SAMIR DUTT
051283
Date:

Certified that the above statement made by the student is correct to the best of our knowledge
and belief.

Ms. Neelu Jain


Course Instructor (DSP)
E&EC Department
Punjab Engg. College
(Deemed University)
Chandigarh
ACKNOWLEDGMENT

I express my sincere gratitude to Ms. Neelu Jain, our instructor for the course of Digital Signal
Processing for giving me a wonderful opportunity for working on Image Processing and
motivating me throughout for this project.

SAMIR DUTT

051283

E&EC
INDEX

Title Pg. No.


Cover Page i

Declaration ii

Acknowledgement iii

Index iv

Introduction 1

Noise in Images 2

Noise Types 2

Noise Removal Methods 3

Simulation of Median Filters for Image Noise Reduction using MATLAB 4

Median Filter 4

Adaptive Median Filter 12

Conclusion 24
Introduction
Noise reduction is the process of removing noise from a signal. Noise reduction techniques are
conceptually very similar regardless of the signal being processed, however a priori knowledge
of the characteristics of an expected signal can mean the implementations of these techniques
vary greatly depending on the type of signal.

All recording devices, analog or digital, have traits which make them susceptible to noise. Noise
can be random or white noise with no coherence or coherent noise introduced by the devices
mechanism or processing algorithms.

In electronic recording devices, a major form of noise is hiss caused by random electrons that,
heavily influenced by heat, stray from their designated path. These stray electrons influence the
voltage of the output signal and thus create detectable noise.

In the case of photographic film and magnetic tape, noise (both visible and audible) is introduced
due to the grain structure of the medium. In photographic film, the size of the grains in the film
determines the film's sensitivity, more sensitive film having larger sized grains. In magnetic tape,
the larger the grains of the magnetic particles (usually ferric oxide or magnetite), the more prone
the medium is to noise.

To compensate for this, larger areas of film or magnetic tape may be used to lower the noise
level to an acceptable point. But this is not enough and various Noise Reduction algorithms are
used for this purpose.

Noise is undesirable, but in some areas it is very important to get rid of it. But since it is
omnipresent, we have to live with it. But some Image Processing Techniques have been
developed which lower the effect of noise. In medical imaging, the need for removal of noise is
very important as noise in the X-Rays and other medical problems may lead to improper
diagnosis of the problem.

This project aims at studying the filters that can remove the noise in medical images
Noise in Images
Images taken with both digital cameras and conventional film cameras will pick up noise from a
variety of sources. Many further uses of these images require that the noise be (partially)
removed - for aesthetic purposes, as in artistic work or marketing, or for practical purposes such
as computer vision.

Noise Types
In salt and pepper noise (sparse light and dark disturbances), pixels in the image are very
different in color or intensity from their surrounding pixels; the defining characteristic is that the
value of a noisy pixel bears no relation to the color of surrounding pixels. Generally this type of
noise will only affect a small number of image pixels. When viewed, the image contains dark
and white dots, hence the term salt and pepper noise. Typical sources include flecks of dust
inside the camera, or with digital cameras, faulty CCD elements.

In Gaussian noise, each pixel in the image will be changed from its original value by a (usually)
small amount. A histogram, a plot of the amount of distortion of a pixel value against the
frequency with which it occurs, shows a normal distribution of noise. While other distributions
are possible, the Gaussian (normal) distribution is usually a good model, due to the central limit
theorem that says that the sum of different noises tends to approach a Gaussian distribution.

In either case, the noises at different pixels can be either correlated or uncorrelated; in many
cases, noise values at different pixels are modeled as being independent and identically
distributed, and hence uncorrelated.

The project focuses on Salt and Pepper Noise as Medical Images are mainly prone to this type of
noise.
Noise Removal Methods
Linear smoothing filters

One method to remove noise is by convolving the original image with a mask that represent a
low-pass filter or smoothing operation. For example, the Gaussian mask comprises elements
determined by a Gaussian function. This convolution brings the value of each pixel into closer
harmony with the values of its neighbors. In general, a smoothing filter sets each pixel to the
average value, or a weighted average, of itself and its nearby neighbors; the Gaussian filter is just
one possible set of weights.

Smoothing filters tend to blur an image, because pixel intensity values that are significantly
higher or lower than the surrounding neighborhood would "smear" across the area. Because of
this blurring, linear filters are seldom used in practice for noise reduction; they are, however,
often used as the basis for nonlinear noise reduction filters.

Nonlinear filters

A median filter is an example of a non-linear filter and, if properly designed, is very good at
preserving image detail. To run a median filter:
1. consider each pixel in the image
2. sort the neighboring pixels into order based upon their intensities
3. replace the original value of the pixel with the median value from the list
A median filter is a rank-selection (RS) filter, a particularly harsh member of the family of rank-
conditioned rank-selection (RCRS) filters; a much milder member of that family, for example
one that selects the closest of the neighboring values when a pixel's value is extreme in its
neighborhood, and leaves it unchanged otherwise, is sometimes preferred, especially in
photographic applications.

Median and other RCRS filters are good at removing salt and pepper noise from an image, and
also cause relatively little blurring of edges, and hence are often used in computer vision
applications.
Simulation of Median Filters for Image Noise Reduction using MATLAB
MATLAB has built in functions for noise addition to image files. The various noise types are
defined in MATLAB, and their properties can also be varied. Similarly, the different types of
Filters are also defined in MATLAB. The following algorithm is used to remove the noise.

Median Filter
The median filter works with the following algorithm.

The median filter is a spatial filter and it replaces the center value in the window with the median
of all the pixel values in the window. The kernel is usually square but can be any shape. An
example of median filtering of a single 3x3 window of values is shown below.

in order: 0, 2, 3, 3, 4, 6, 10, 15, 97

Center value (previously 97) is replaced by the median of all nine values (4).
Program Code for Median Filter:

clear all;

t=imread('humanbrain1.jpg');

size(t);

td=double(t);

pause;

t2=td(:,:,1);

t3=mat2gray(t2);

t4=t3;

imshow(t4);

size(t4);

pause;

x1=imnoise(t4,'salt & pepper',0.3);

imshow(x1);

size(x1);

pause;

output=medfilt2(x1,[3,3]);

imshow(output);
Outputs:

Original Image
Image with Noise
Filtered Image
Adaptive Median Filter
The adaptive median filter successfully removes impulsive noise from images. It does a
reasonably good job of smoothening images that contain non-impulsive noise.

When both types of noise are present, the algorithm is not as successful in removing
impulsive noise and its performance deteriorates.

Program Code:

clear all;

t=imread(‘humanbrain1.jpg');

size(t);

td=double(t);

pause;

t2=td(:,:,1);

t3=mat2gray(t2);

t4=t3;

imshow(t4);

size(t4);

pause;

x2=imnoise(t4,'salt & pepper',0.3);

imshow(x2);

pause;

% adaptive median filter

smax=7

g = x2;

[m n]= size(g);

% Initial setup.

f = g;
f(:)=0;

% begin filtering

for k=3:2:smax

zmin=ordfilt2(g,1,ones(k,k),'symmetric');

zmax=ordfilt2(g, k*k ,ones(k,k),'symmetric');

zmed=medfilt2(g,[k,k],'symmetric');

processusinglevelb = (zmed > zmin )&(zmax >zmed );

zb = ( g > zmin)&(zmax > g);

outputzxy=processusinglevelb & zb;

outputzmed = processusinglevelb &~zb;

f(outputzxy)=g(outputzxy);

f(outputzmed)=zmed(outputzmed);

end

x1 = f;

imshow(x1);
OUTPUTS:

Original Image
Image with Noise
Filtered Image
Conclusion
The application of the two filters to the medical image shows clearly that the Adaptive Median
Filter method is better as far as the removal of noise is removed. These two filters work best if
the image has only the Salt and Pepper type of noise. In case of the presence of any other type of
noise, these filters introduce dispersion. Also, these filters work best in those cases where the
density of noise in the image is either very low or very high.

You might also like