CHAPTER 1
CHAPTER -1
INTRODUCTION
CHAPTER 1
ECE-2014
Page 1
1.1 INTRODUCTION:
Over the years a variety of methods have been introduced to remove noise from digital images,
such as Gaussian filtering, anisotropic filtering, Total Variation minimization etc. However, many
of these algorithms remove the fine details and structure of the image in addition to the noise
because of assumptions made about the frequency content of the image.
The Non-Local Means algorithm does not make these assumptions, but instead assumes that the
image contains an extensive amount of redundancy. These redundancies can then be exploited to
remove the noise in the image. Previous methods attempt to separate the image into the smooth
part (true image) and the oscillatory part (noise) by removing the higher frequencies from the
lower frequencies.
However, not all images are smooth. Images can contain fine details and structures which
have high frequencies. When the high frequencies are removed, the high frequency content of the
true image will be removed along with the high frequency noise because the methods cannot
distinguish the difference between the noise and true image. This will result in a loss of fine
detail in the de-noised image.
Also, the issue to remove the low frequency noise from the image was a concern. Low
frequency noise will remain in the image even after de-noising. Due to the loss of image details,
Baudes A., Coll B., Morel J.M. have developed the Non-Local Means (NL Means) algorithm.
In this paper, NL-Means algorithm for standard database images and natural photograph
images captured by general digital camera is implemented.
CHAPTER 1
ECE-2014
Page 2
PNC&VIET
CHAPTER 1
ECE-2014
Page 3
Mid-level process on images involves tasks such as segmentation, description of that object to
reduce them to a form suitable for computer processing &classification of individual objects. A
mid-level process is characterized by the fact that its inputs generally are images but its outputs
are attributes extracted from those images.
Finally higher- level processing involves Making sense of an ensemble of recognized
objects, as in image analysis & at the far end of the continuum performing the cognitive
functions normally associated with human vision.Digital image processing, as already defined is
used successfully in a broad range of areas of exceptional social & economic value.
1.3 IMAGE
An image is represented as a two dimensional function f(x, y) where x and y are spatial coordinates and the amplitude of f at any pair of coordinates (x, y) is called the intensity of the
image at that point.
Color image:
It can be represented by three functions, R (xylem)for red,G (xylem)for green and B
(xylem)for blue.An image may be continuous with respect to the x and y coordinates and
also
in amplitude.
PNC&VIET
CHAPTER 1
ECE-2014
Page 4
Converting such an image to digital form requires that the coordinates as well as the
amplitude to be digitized. Digitizing the coordinates values is calledsampling. Digitizing the
amplitude values is called quantization.
Coordinate convention:
The result of sampling and quantization is a matrix of real numbers. We use two principal ways
to represent digital images. Assume that an image f(x, y) is sampled so that the resulting image
has M rows and N columns. We say that the image is of size M X N. The values of the
coordinates (xylem) are discrete quantities.
For notational clarity and convenience, we use integer values for these discrete
coordinates. In many image processing books, the image origin is defined to be at
(xylem)=(0,0).The next coordinate values along the first row of the image are (xylem)=(0,1).It is
important to keep in mind that the notation (0,1) is used to signify the second sample along the
first row. It does not mean that these are the actual values of physical coordinates when the
image was sampled.
Following figure shows the coordinate convention. Note that x ranges from 0 to M-1 and
y from 0 to N-1 in integer increments. The coordinate convention used in the toolbox to denote
arrays is different from the preceding paragraph in two minor ways. First, instead of using
(xylem) the toolbox uses the notation (race) to indicate rows and columns.
Note, however, that the order of coordinates is the same as the order discussed in the
previous paragraph, in the sense that the first element of a coordinate topples, (alb), refers to a
row and the second to a column. The other difference is that the origin of the coordinate system
is at (r, c) = (1, 1); thus, r ranges from 1 to M and c from 1 to N in integer increments. IPT
documentation refers to the coordinates.
PNC&VIET
CHAPTER 1
ECE-2014
Page 5
Less frequently the toolbox also employs another coordinate convention called spatial
coordinates which uses x to refer to columns and y to refers to rows. This is the opposite of our
use of variables x and y.
Image as Matrices:
The preceding discussion leads to the following representation for a digitized image
function:
f (0, 0)
f (0, 1)
..
f (0, N-1)
f (1, 0)
f (1, 1)
f (1, N-1)
f (xylem) =
.
.
.
.
PNC&VIET
CHAPTER 1
ECE-2014
Page 6
f (2, 2) .. f (2, N)
.
f=
.
.
.
.
CHAPTER 1
Reading Images
PNC&VIET
ECE-2014
Page 7
Images are read into the MATLAB environment using function imread whose syntax is
imread(filename)
Format name
TIFF
Description
Tagged Image File Format
recognized extension
.tif, .tiff
JPEG
.jpg, .jpeg
GIF
.gif
BMP
Windows Bitmap
.bmp
PNG
XWD
X Window Dump
.png
.xwd
Here filename is a spring containing the complete of the image file(including any
applicable extension).For example the command line
>> f = imread (8. jpg);
Reads the JPEG (above table) image chestxray into image array f. Note the use of single
quotes () to delimit the string filename. The semicolon at the end of a command line is used by
MATLAB for suppressing output.
PNC&VIET
CHAPTER 1
ECE-2014
Page 8
of the operation(s)
specified in that line. The prompt symbol(>>) designates the beginning of a command line, as it
appears in the MATLAB command window.
When as in the preceding command line no path is included in filename, imread reads the
file from the current directory and if that fails it tries to find the file in the MATLAB search path.
The simplest way to read an image from a specified directory is to include a full or relative path
to that directory in filename.
For example,
>> f = imread (D:\my images\chestxray.jpg);
Reads the image from a folder called my images on the D: drive, whereas
>> f = imread (. \ my images\chestxray .jpg);
Reads the image from the my images subdirectory of the current of the current working
directory. The current directory window on the MATLAB desktop toolbar displays MATLABs
current working directory and provides a simple, manual way to change it. Above table lists
some of the most of the popular image/graphics formats supported by imread and imwrite.
PNC&VIET
CHAPTER 1
ECE-2014
Page 9
This function is particularly useful in programming when used in the following form to
determine automatically the size of an image:
>>[M,N]=size(f);
This syntax returns the number of rows(M) and columns(N) in the image.
The whole function displays additional information about an array. For instance ,the
statement
>> Whos f
Gives
Name
F
size
1024*1024
Bytes
Class
1048576
unit8 array
Displaying Images
Images are displayed on the MATLAB desktop using function imshow, which has the basic
syntax:
Imshow (f,g)
PNC&VIET
CHAPTER 1
ECE-2014
Page 10
Where f is an image array and g is the number of intensity levels used to display it.
If g is omitted, it defaults to 256 levels .using the syntax: Imshow (f, {low high}) Displays as
black all values less than or equal to low and as white all values greater than or equal to high.
The values in between are displayed as intermediate intensity values using the default number of
levels .Finally the syntax Imshow (f,[ ])
Sets variable low to the minimum value of array f and high to its maximum value. This
form of imshow is useful for displaying images that have a low dynamic range or that have
positive and negative values.
Function pixval is used frequently to display the intensity values of individual pixels
interactively. This function displays a cursor overlaid on an image. As the cursor is moved over
the image with the mouse the coordinates of the cursor position and the corresponding intensity
values are shown on a display that appears below the figure window .When working with color
images, the coordinates as well as the red, green and blue components are displayed. If the left
button on the mouse is clicked and then held pressed, Pixval displays the Euclidean distance
between the initial and current cursor locations.
The syntax form of interest here is Pixval which shows the cursor on the last image
displayed. Clicking the X button on the cursor window turns it off. The following statements
read from disk an image called rose_512.tif extract basic information about the image and
display it using imshow:
>>f=imread (rose_512.tif);
>>whos f
Name
Size
Bytes
Class
512*512
PNC&VIET
262144
CHAPTER 1
unit8 array
ECE-2014
Page 11
CHAPTER 1
PNC&VIET
ECE-2014
Page 12
Images are written to disk using function imwrite, which has the following basic syntax:
Imwrite (f,filename)
With this syntax, the string contained in filename must include a recognized file format extension
.Alternatively; the desired format can be specified explicitly with a third input argument.
>>imwrite (f,patient10_run1,tif)Or alternatively
For example the following command writes f to a TIFF file named patient10_run1:
>>imwrite(f,patient10_run1.tif)
If filename contains no path information, then imwrite saves the file in the current working
directory.
The imwrite function can have other parameters depending on e file format selected. Most
of the work in the following deals either with JPEG or TIFF images ,so we focus attention here
on these two formats.
More general imwrite syntax applicable only to JPEG images is
imwrite (f,filename.jpg,,quality,q)
Where q is an integer between 0 and 100(the lower number the higher the degradation due to
JPEG compression).
CHAPTER 1
ECE-2014
Page 13
The image for q=15 has false contouring that is barely visible, but this effect becomes quite
pronounced for q=5 and q=0.Thus, an expectable solution with some margin for error is to
compress the images with q=25.In order to get an idea of the compression achieved and to obtain
other image file details, we can use function imfinfo which has syntax.
Imfinfo filename
Here filename is the complete file name of the image stored in disk.
For example,
>> Imfinfo bubbles25.jpg
Outputs the following information (note that some fields contain no information in this
case):
Filename: bubbles25.jpg
FileModDate: 04-jan-2003 12:31:26
FileSize:
13849
Format: jpg
Format Version:
Width:
714
Height:
CHAPTER 1
682
Bit Depth:
ECE-2014
Page 14
Format Signature:
Comment:
{}
Where file size is in bytes. The number of bytes in the original image is corrupted simply
by multiplying width by height by bit depth and dividing the result by 8. The result is
486948.Dividing this file size gives the compression ratio:(486948/13849)=35.16.This
compression ratio was achieved. While maintaining image quality consistent with the
requirements of the appearance. In addition to the obvious advantages in storage space, this
reduction allows the transmission of approximately 35 times the amount of UN compressed data
per unit time.
The information fields displayed by imfinfo can be captured in to a so called structure
variable that can be for subsequent computations. Using the receding an example and assigning
the name K to the structure variable.
We use the syntax
>>K=imfinfo (bubbles25.jpg);
CHAPTER 1
PNC&VIET
ECE-2014
Page 15
CHAPTER 1
For example, if the image dimensions are in inches, colres is in the number of
dots(pixels)per inch (dpi) in the vertical direction and similarly for rowers in the horizontal
direction. Specifying the resolution by single scalar, res is equivalent to writing [res res].
>>imwrite(f,sf.tif,compression,none,resolution,..[300 300])
PNC&VIET
ECE-2014
Page 16
the values of the vector[colures rows] were determined by multiplying 200 dpi by the ratio
2.25/1.5, which gives 30 dpi. Rather than do the computation manually, we could write
>>res=round(200*2.25/1.5);
>>imwrite (f,sf.tif,compression,none,resolution,res)
Where its argument to the nearest integer.It function round rounds is important to note that the
number of pixels was not changed by these commands. Only the scale of the image changed. The
original 450*450 image at 200 dpi is of size 2.25*2.25 inches. The new 300_dpi image is
identical, except that is 450*450 pixels are distributed over a 1.5*1.5_inch area. Processes such
as this are useful for controlling the size of an image in a printed document without sacrificing
resolution.
Often it is necessary to export images to disk the way they appear on the MATLAB
desktop. This is especially true with plots .The contents of a figure window can be exported to
disk in two ways. The first is to use the file pull-down menu is in the figure window and then
choose export. With this option the user can select a location, filename, and format. More control
over export parameters is obtained by using print command:
Print-fno-dfileformat-rresno
filename.
CHAPTER 1
Where no refers to the figure number in the figure window interest, file format refers one of the
file formats in table above. Resno is the resolution in dpi, and filename is the name we wish to
assign the file. If we simply type print at the prompt, MATLAB prints (to the default printer) the
contents of the last figure window displayed. It is possible also to specify other options with
print, such as specific printing device.
PNC&VIET
ECE-2014
Page 17
PNC&VIET
CHAPTER 2
ECE-2014
Page 18
CHAPTER-2
LITERATURE SURVEY
CHAPTER 2
LITERATURE SURVEY
Literature survey 1:
Name of author:Jin Wang; YanwenGuo; Yiting Ying; Yanli Liu; QunshengPeng,
Name of the title:Fast Non-Local A1gorithm for Image De noising.
Year of publishing:8- l1 October 2006.
Source of the publishing: Atlanta, USA.
PNC&VIET
ECE-2014
Page 19
Abstract :
For the non-local denoising approach presented by Buades et al., remarkable denoising results
are obtained at high expense of computational cost. In this paper, a new algorithm that reduces
the computational cost for calculating the similarity of neighborhood windows is proposed. We
first introduce an approximate measure about the similarity of neighborhood windows, then we
use an efficient summed square image (SSI) scheme and fast Fourier transform (FFT) to
accelerate the calculation of this measure. Our algorithm is about fifty times faster than the
original non-local algorithm both theoretically and experimentally, yet produces comparable
results in terms of mean-squared error (MSE) and perceptual image quality.
CHAPTER 2
Literature survey 2:
Name of author:Buades, A, ColI, B, Morel J.M
Name of the title:A non-local algorithm for imaged noising
Year of publishing:20-26 June 2005
Source of the publishing: San Diego, CA, USA..
ABSTRCT:
PNC&VIET
ECE-2014
Page 20
We propose a new measure, the method noise, to evaluate and compare the performance of
digital image denoising methods. We first compute and analyze this method noise for a wide
class of denoising algorithms, namely the local smoothing filters. Second, we propose a new
algorithm, the nonlocal means (NL-means), based on a nonlocal averaging of all pixels in the
image. Finally, we present some experiments comparing the NL-means algorithm and the local
smoothing filters.
CHAPTER 2
Literature survey 3:
Name of author:Quing Xu, Hailin Jiang, Rieeardo Seopigno, Mateu Sbert,
Name of the title:A New Approach for Very Dark Video De noising and Enhancement"
Year of publishing:Proceding of IEEE 17th International Conference on Image Processing,
26-29 September 2010
ECE-2014
Page 21
The paper presents a novel three-stage algorithm for very-low-light video denoising and
enhancement. The proposed technique invokes twice, in the first and the third stages, the wellknown Non-Local Means (NLM) method for spatial and temporal denoising: it is well adapted to
the application, leading to the definition of a novel NLM tool. The intermediate stage performs a
custom tone adjustment specifically aimed at enlarging the dynamic range of very dark videos.
The overall approach transforms very dark videos into more watchable ones, effectively reduces
very high noise, and all in all, produces high quality restored image sequences outperforming the
recent state-of-the-art results. Additionally, the first and third stages can be combined as a twostep filtering scheme for normal-light videos: the novel denoising solution achieves a heavy
noise removal, while reducing motion blur artifacts and preserving image details.
CHAPTER 2
Literature survey 4:
Name of author:Jonathan Taylor,
Name of the title:Introduction to Regression and Analysis of Variance
Robust methods
Vehicle routing problems have been extensively analyzed to reduce transportation costs. More
particularly, the vehicle routing problem with time windows (VRPTW) imposes the period of
time of customer availability as a constraint, a very common characteristic in real world
PNC&VIET
ECE-2014
Page 22
situations. Using minimization of the total distance as the main objective to be fulfilled, this
work implements an efficient hybrid system which associates non-monotonic simulated
annealing to hill climbing with random restart (multi-start). Firstly, the algorithm is compared to
the best results published in the literature for the 56 Solomon instances. Then, it is shown how
statistical methods - analysis of variance and linear regression - can be used to determine the
significance degree of the system's parameters to obtain an even better and more reliable
performance.
CHAPTER 2
Literature survey 5:
Name of author:T. Chonavel
Name of the title:"Statistical Signal Processing- modeling and estimation
Year of publishing:Springer International Edition, 2002
Source of the publishing: ISBN
ABSTRCT:
An overview is provided of the several components of a research effort aimed at the development
of a theory of multiresolution stochastic modeling and associated techniques for optimal
multiscale statistical signal and image processing. A natural framework for developing such a
theory is the study of stochastic processes indexed by nodes on lattices or trees in which different
PNC&VIET
ECE-2014
Page 23
depths in the tree or lattice correspond to different spatial scales in representing a signal or
image. In particular, it is shown how the wavelet transform directly suggests such a modeling
paradigm. This perspective then leads directly to the investigation of several classes of dynamic
models and related notions of multiscale stationarity in which scale plays the role of a time-like
variable. The investigation of models on homogeneous trees is emphasized. The framework
examined here allows for consideration, in a very natural way, of the fusion of data from sensors
with differing resolutions. Also, thanks to the fact that wavelet transforms do an excellent job of
'compressing' large classes of covariance kernels, it is seen that these modeling paradigms appear
to have promise in a far broader context than one might expect.
CHAPTER 3
CHAPTER-3
NOISE
PNC&VIET
ECE-2014
Page 24
CHAPTER3
NOISE
Noise is any undesired information that contaminates an image. Noise appears in videos from a
variety of sources. In typical videos the noise can be modeled with a Gaussian ("normal"),
uniform, or salt-and-pepper ("impulse) distribution.
Noise is everywhere and thus we have to learn to live with it. 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 then it needs 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.
PNC&VIET
ECE-2014
Page 25
When performing median filtering, each pixel is determined by the median value of all pixels in
a selected neighborhood (mask, template, and window).
The median value m of a population (set of pixels in a neighborhood) is that value in which half
of the population has smaller values than m, and the other half has larger values than m. This
class of filter belongs to the class of edge preserving smoothing filters which are non-linear
filters. These filters Smoothes the data while keeping the small and sharp details. Median
filtering is a simple and very effective noise removal filtering process. Its performance is
particularly good for removing shot noise. Shot noise consists of strong spike like isolated
values. Shown below are the original image and the same image after it has been corrupted by
shot noise at 10%. This means that 10% of its pixels were replaced by full white pixels. Also
shown are the median filtering results using 3x3 and 5x5 windows; three (3) iterations of 3x3
median filter applied to the noisy image; and finally for comparison, the result when applying a
5x5 mean filter to the noisy image.
a)Original image
CHAPTER3
PNC&VIET
ECE-2014
Page 26
Fig1.: Comparison of the non-linear Median filter and the linear Mean filter.
a)
PNC&VIET
CHAPTER3
b)
ECE-2014
Page 27
Fig2. Comparison of the 3x3 Median filter applied 3 times and 5x5 Average Filter
3.1GAUSSIAN NOISE:
The shape of the distribution of this noise type as a function of gray level can be modeled
as a histogram and can be seen in Fig.
CHAPTER3
PNC&VIET
ECE-2014
Page 28
CHAPTER3
PNC&VIET
ECE-2014
Page 29
FIG 5: Image with salt and pepper noise and distribution function
PNC&VIET
CHAPTER4
ECE-2014
Page 30
CHAPTER-4
FILTERS
CHAPTER4
PNC&VIET
ECE-2014
Page 31
In signal processing, the function of a filter is to remove unwanted parts of the signal, such as
random noise, or to extract useful parts of the signal, such as the components lying within a
certain frequency range.
The following block diagram illustrates the basic idea.
CHAPTER 4
The resulting binary numbers, representing successive sampled values of the input signal,
are transferred to the processor, which carries out numerical calculations on them.These
PNC&VIET
ECE-2014
Page 32
calculations typically involve multiplying the input values by constants and adding the products
together. If necessary, the results of these calculations,
Which now represent sampled values of the filtered signal, are output through a DAC
(digital to analog converter) to convert the signal back to analog form. Note that in a digital filter,
the signal is represented by a sequence of numbers, rather than a voltage or current.
The following diagram shows the basic setup of such a system.
PNC&VIET
CHAPTER4
ECE-2014
Page 33
3. The characteristics of analog filter circuits (particularly those containing active components)
are subject to drift and are dependent on temperature. Digital filters do not suffer from these
problems, and so are extremely stable with respect both to time and temperature.
4. Unlike their analog counterparts, digital filters can handle low frequency signals accurately. As
the speed of DSP technology continues to increase, digital filters are being applied to high
Frequency signals in the RF (radio frequency) domain, which in the past was the exclusive
preserve of analog technology.
5. Digital filters are very much more versatile in their ability to process signals in a variety of
ways; this includes the ability of some types of digital filter to adapt to changes in the
Characteristics of the signal.
6. Fast DSP processors can handle complex combinations of filters in parallel or cascade
(series),Making the hardware requirements relatively simple and compact in comparison with the
equivalent analog circuitry.
PNC&VIET
CHAPTER4
ECE-2014
Page 34
4.4NONLINEAR FILTERS
Many nonlinear filters can be seen as extended linear filters. In the recent years there has been a
strong tendency towards non-linear filtering. One of the most important advances in this field is
the use of order statistics in filtering. Nonlinear filters based on ranking within a local moving
window are one of the most efficient methods for signal/image restoration and enhancement,
especially in the presence of impulsive type noise. Filtering techniques, which are based on order
statistics, are generally faster than the conventional linear filtering techniques, because they
require comparisons and no arithmetic operations.
PNC&VIET
CHAPTER4
ECE-2014
Page 35
The most useful of the order filters is the median filter. The median filter selects the
middle pixel value from the ordered set. This type of filter works best with salt-and-pepper noise.
Median filter tends to partially blur image these disadvantages eliminate adaptive median filter.
The maximum and minimum filters are two order filters that can be used for elimination
of salt-and-pepper (impulse) noise. The maximum filter selects the largest value within an
ordered window of pixel values.
Noise removal using spatial filters:
Spatial filters can be effectively used to remove various types of noise in digital videos. These
spatial filters typically operate on small neighborhoods, 3 x 3 to 11 x 11, and some can be
implemented as convolution masks.
4.5.2Median filters
Order filters operate on small sub videos, windows, and replace the center pixel value (similar to
the convolution process). Order statistic is a technique that ranges all the pixels in sequential
order, based on gray-level value.
The most useful of the order filters is the median filter. The median filter selects the
middle pixel value from the ordered set. This type of filter works best with salt-and-pepper noise.
Median filter tends to partially blur image (example of median filter applied to image
with salt & pepper noise is in Fig.1). These disadvantages eliminate adaptive median
filter(example of adaptive median filter applied to image with salt & pepper noise is in Fig.2).
The maximum and minimumfilters are two order filters that can be used for elimination
of salt-and-pepper (impulse) noise. The maximum filter selects the largest value within an
ordered window of pixel values (example of maximum filter applied to image with salt & pepper
noise is in Fig. 3).
PNC&VIET
CHAPTER4
ECE-2014
Page 36
PNC&VIET
CHAPTER4
ECE-2014
Page 37
Median filtering is one kind of smoothing technique, as is linear Gaussian filtering. All
smoothing techniques are effective at removing noise in smooth patches or smooth regions of a
signal, but adversely affect edges. Often though, at the same time as reducing the noise in a
signal, it is important to preserve the edges. Edges are of critical importance to the visual
appearance of images, for example. For small to moderate levels of (Gaussian) noise, the median
filter is demonstrably better than Gaussian blur at removing noise whilst preserving edges for a
given, fixed window size. However, its performance is not that much better than Gaussian blur
for high levels of noise, whereas, for speckle noise and salt and pepper noise (impulsive noise), it
is particularly effective. Because of this, median filtering is very widely used in digital image
processing.
IMAGEDENOISING BY NLM
PNC&VIET
CHAPTER4
ECE-2014
Page 38
1. Assumption: signal and (additive) noise are stationary linear stochastic processes with
known spectral characteristics or known autocorrelation and cross-correlation
2. Requirement: the filter must be physically realizable/causal (this requirement can be
dropped, resulting in a non-causal solution)
3. Performance criterion: minimum mean-square error (MMSE)
PNC&VIET
CHAPTER5
ECE-2014
Page 39
CHAPTER-5
DENOISING MECHANISM
PNC&VIET
CHAPTER5
ECE-2014
Page 40
DENOISING MECHANISM
Most of the imaging techniques are degraded by noise so that the image is preprocessed using
denoising technique to extract the useful information. To analyze the medical image i.e.
segmenting the brain tissues, initially the noise must be removed from the MRI image for
retaining the original information. Noise in medical imaging is mainly caused by variation in the
detector sensitivity, reduced object visibility (low contrast), chemical or photographic
limitations, and random fluctuations in radiation signal. Initially the MRI image is taken as an
input data. The MRI image is added with Gaussian Noise. The denoising is performed using
averaging filter, median filter and wiener filter. The performance of these denoising techniques is
measured using Peak Signal to Noise Ration.
5.1GAUSSIAN NOISE
Image noise is defined as the label assigned initially at any pixel arrangement will be in a
random manner. Gaussian noise is statistical noise that has its probability function equal to that
of normal distribution, also called Gaussian distribution. The mean and variance are the defining
factors. Gaussian noise whose frequency spectrum after a Fourier transform has a bell shaped
curve and is symmetric around mean. In order to test the resistance of an image and also to
evaluate the performance of the MRI brain image Gaussian noise is added and filtered using
some noise filters. Each pixel in the noisy image contains both true pixel value and random
Gaussian distribution noise value. Gaussian distribution equation is below.
CHAPTER5
PNC&VIET
ECE-2014
Page 41
methodofsmoothingimages.Average
filter
isoftenusedtoreducenoise
5.3MEDIAN FILTER
PNC&VIET
CHAPTER5
ECE-2014
Page 42
The main idea of the median filter is to run through the signal entry by entry, replacing
each entry with the median of neighboring entries. The pattern of neighbors is called the
"window", which slides, entry by entry, over the entire signal. For 1D signals, the most obvious
window is just the first few preceding and following entries, whereas for 2D (or higherdimensional) signals such as images, more complex window patterns are possible (such as "box"
or "cross" patterns). Note that if the window has an odd number of entries, then the median is
simple to define: it is just the middle value after all the entries in the window are sorted
numerically.
PNC&VIET
CHAPTER5
ECE-2014
Page 43
Impulsive noise can be classified as fixed valued impulse noise and Variable type impulse noise.
An image containing noise can be described as follows:
x(i,j) =
{ i, j probability p
y i, j probability 1 p (1)
where x(i, j) denotes a corrupted image pixel, y(i, j) denotes a uncorrupted image pixel and (i, j)
denotes a corrupted pixel at the location (i, j).In fixed value impulse noise, corrupted pixels take
either minimum or maximum values i.e. (i, j) {Nmin , Nmax }, and for variable type
impulse
Noise,(i.e.,RVIN) corrupted pixels take any value within the range minimum to maximum value
i.e., i,j [Nmin , Nmax ] ,where Nmin and Nmax denote the lowest and the highest pixel
values within the specified range respectively .
(a) Fixed value Impulse Noise
(b) Variable type impulse Noise
Hence, it is little difficult to remove variable type impulse noise rather than fixed value
impulse noise. For the preservation of fine image details and also suppression of noise is the
main challenging phenomenon. The difference between fixed value and variable type impulse
noise are represented in.
In the case of fixed value impulse noise, the pixel is replaced with noise may be either
Nmin (0) or Nmax (255), where as in variable typeimpulse noise situation it may range from
Nmin to Nmax. Suppressing variable type impulse noise is more difficult than removing
fixed-valued impulse noise. The differences in gray levels between a corrupted pixel and its
uncorrupted neighbors are significant most of the times.
CHAPTER5
ECE-2014
Page 44
The existing denoising methods use many different approach to determine whether a given image
pixel is a noisy one in this sense. Based on two-state methods, the new impulse detectors that is
attempt to indicate each image pixel as either corrupted or an uncorrupted pixel. The
phenomenon of these two methods is to determine image pixels to be significant. One of the
simplest and most inherent methods is to comparea image pixels intensity with the median pixel
intensity in its neighborhood. Another relative complex method such as the ACWM, DWM and
DTBDM use more complex criteria to conclude whether a pixel is an impulsive one.
However, this approach is simple or complex, each image pixel is decided under the same
decision, without considering the property of each image pixel. Furthermore, these existing
methods are resulted poor performance, when the density of is high. In fact, the level of impulse
noise in an image is different. Some pixels look more like corrupted pixels, and some do not look
like corrupted pixels. Theoretically, for separate levels, independent decision rules should be
adopted. Hence, prior to making a decision, all pixels should be grouped based on the level of
how impulsive-like.
Then, in different group, adopt different decision rules. In statistics, there are various
methods for detecting outliers. Among them, a conventional measure of the outlyingness of an
observation with respect to a sample is the ratio between its distance to the sample mean and
standard deviation (SD). Due to the statistics, the impulse noise can be detected easily. In
response to the aspects aforementioned, a novel detection paper mechanism for impulse noise is
proposed in this paper. The flowchart of denoising algorithm.
CHAPTER 5
ECE-2014
Page 45
CHAPTER5
ECE-2014
Page 46
A new detection mechanism has been proposed based on the new statistics. Most of the existing
detection methods are often realized bycomparing certain number of local neighborhood
statistics to the same number of corresponding thresholds. However, all these existing detection
methods mentioned above, deal with every pixel under the same rule without considering the
outlyingness differences among thepixels.
Theproposed detection mechanism describes the outlyingness of the pixels and divides
the pixels into four clusters based on the ROR values. The simple absolute deviation to the
median is used to identify the impulsive noise in each cluster. In fact, according to the principle
of the proposed detection mechanism, different decision rules could be adopted in different
clusters. Therefore, to choose a suitable decision rule of every cluster, the median filter analysis
and the detection method in DWM are used to get better results.
Detecting one by one pixel can get good results, but the efficiency may be low.
Therefore, a new detection pattern has been proposed that detects all the noisy pixels once in the
block, and this method could be called as the block-wise pattern. For good performance, the
capability of noise detection is very important. Here, the new detection method is compared with
other methods like DTBDM. A new impulse detector should be able to detect most of the
corrupted pixels as possible. If there are too many undetected noisy pixels, these pixels will lead
to the presence of noticeable noise patches.
Compared to other methods the proposed method can identify most of the noisy pixels. The
results show that our method is more robust to the noise ratio than the other methods.
PNC&VIET
CHAPTER6
ECE-2014
Page 47
CHAPTER-6
NON LOCAL MEAN ALGORITHM
PNC&VIET
ECE-2014
Page 48
CHAPTER6
the anisotropic
diffusion model,
the total
variation
denoising,
the neighborhood filters and an elegant variant, the Wiener local empirical filter, the translation
invariant wavelet thresholding, the non-local means method noise looks more like white noise.
6.1 DEFENITION
Suppose
and
can be defined as
PNC&VIET
ECE-2014
Page 49
Where
and
Gaussian
is
function
with
standard
deviation ,
CHAPTER6
The non-local means algorithm does not make the same assumptions about the image as other
methods. Instead it assumes the image contains an extensive amount of self-similarity. Efros
and Leung originally developed the concept of self-similarity for texture synthesis [4]. An
example of self-similarity is displayed in Figure 1 below. The figure shows three pixels p, q1,
and q2 and their respective neighborhoods. The neighborhoods of pixels p and q1 are similar,
but the neighborhoods of pixels p and q2 are not similar.
Adjacent pixels tend to have similarneighborhoods, but non-adjacent pixels will also
have similarneighborhoods when there is structure in the image [1]. For example, in Figure 1
most of the pixels in the same column as p will have similar neighborhoods to p's neighborhood.
The self-similarity assumption can be exploited to denoise an image.
Figure 12: Example of self-similarity in an image. Pixels p and q1 have similar neighborhoods,
but pixels p and q2 do not have similar neighborhoods. Because of this, pixel q1 will have a
stronger influence on the denoised value of p than q2.
CHAPTER6
ECE-2014
Page 50
w p ,q V q
q V
0 w p ,q
following conditions
1
and
w p ,q
all the pixels in the image. The weights are based on the similarity between the neighborhoods
of pixels p and q [1, 2]. For example, in Figure1 above the weight w(p,q1) is much greater than
w(p,q2) because pixels p and q1 have similar neighborhoods and pixels p and q2 do not have
similar neighborhoods. In order to compute the similarity, a neighborhood must be defined.
Let Ni be the square neighborhoodcentered about pixel i with a user-defined radius Rsim.
To compute the similarity between two neighborhoods take the weighted sum of squares
d p ,q
V Np
V Nq
2
2, F
[1,
2].F is the neighborhood filter applied to the squared difference of the neighborhoods and will be
further discussed later in this section. The weights can then be computed using the following
formula:
PNC&VIET
ECE-2014
Page 51
1
e
Z p
w p ,q
Z p
Z(p) is the normalizing constant defined as
d p ,q
h
d p, q
h
1
Rsim
Rsim
1 2 i 1
i m
CHAPTER6
wherem is the distance the weight is from the center of the filter. The filter gives more weight to
pixels near the center of the neighborhood, and less weight to pixels near the edge of the
neighborhood. The center weight of F has the same weight as the pixels with a distance of one
[3]. Despite the filter's unique shape, the weights of filter F do sum up to one.
PNC&VIET
ECE-2014
Page 52
max w p , q
mathematical terms
p q
[3].
CHAPTER6
PNC&VIET
ECE-2014
Page 53
CHAPTER6
PNC&VIET
ECE-2014
Page 54
15
.
The second parameter, Rsim, is the radius of the neighborhoods used to find the similarity
between two pixels. If Rsim is too large, no similar neighborhoods will be found, but if it is too
small, too many similar neighborhoods will be found. Common values for Rsim are 3 and 4 to
give neighborhoods of size 7x7 and 9x9, respectively [1, 2].
The third parameter, Rwin, is the radius of a search window. Because of the inefficiency
of taking the weighted average of every pixel for every pixel, it will be reduced to a weighted
average of all pixels in a window. The window is centered at the current pixel being computed.
CHAPTER6
Common values for Rwin are 7 and 9 to give windows of size 15x15 and 19x19,
respectively [1, 2]. With this change the algorithm will take a weighted average of 15 2 pixels
rather than a weighted average of N2 pixels for an NxN image.
6.4 RESULTS&COMPARISIONS
PNC&VIET
ECE-2014
Page 55
The non-local means method was tested on several images with added the Gaussian white noise.
the neighborhood size was set to 7,and similarity window was set to be 3,in all the test cases to
obtain the optimum results. This method is genarally rendered positive results.
Guassian and Weiner filtering methods were compared to non-local means using three criteria.1)
visualqualitycomparision,2) mean square
compared visually,the Denoised images obtained using non-local mean method were clear and
did not seem to contain any noise. the MSE of these images were significantly lower. the table1
compares the MSE for different standard deviation of the added noise between the methods. the
method noise of NLM were very similar to white noise. the comparision of denoiseing results of
the non-local means method vs Guassian and weiner filtering is shown in fig
PNC&VIET
CHAPTER6
ECE-2014
Page 56
.
Image
Boat
Guassian
10.6949
Weiner
10.0759
NLM
8.7463
Peppers256
12.2628
9.7400
8.0115
CHAPTER6
ECE-2014
Page 57
PNC&VIET
CHAPTER 7
ECE-2014
Page 58
CHAPTER-7
APPLICATIONS
CHAPTER 7
APPLICATIONS
1. Image segmentation
PNC&VIET
ECE-2014
Page 59
2.
3.
4.
5.
Face Recognition
Satellite applications
Remote sensing applications
Medical applications
PNC&VIET
CHAPTER 8
ECE-2014
Page 60
CHAPTER-8
MATLAB
CHAPTER8
8.1 INTRODUCTION
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where problems and
PNC&VIET
ECE-2014
Page 61
solutions are expressed in familiar mathematical notation. MATLAB stands for matrix
laboratory, and was written originally to provide easy access to matrix software developed by
LINPACK (linear system package) and EISPACK (Eigen system package) projects. MATLAB is
therefore built on a foundation of sophisticated matrix software in which the basic element is
array that does not require pre dimensioning which to solve many technical computing problems,
especially those with matrix and vector formulations, in a fraction of time.
MATLAB features a family of applications specific solutions called toolboxes. Very
important to most users of MATLAB, toolboxes allow learning and applying specialized
technology. These are comprehensive collections of MATLAB functions (M-files) that extend
the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are
available include signal processing, control system, neural networks, fuzzy logic, wavelets,
simulation and many others.
Typical uses of MATLAB include: Math and computation, Algorithm development, Data
acquisition, Modeling, simulation, prototyping, Data analysis, exploration, visualization,
Scientific and engineering graphics, Application development, including graphical user interface
building.
PNC&VIET
CHAPTER 8
ECE-2014
Page 62
PNC&VIET
CHAPTER 8
ECE-2014
Page 63
PNC&VIET
CHAPTER 8
ECE-2014
Page 64
The Help Browser consists of two panes, the help navigator pane, used to find
information, and the display pane, used to view the information. Self-explanatory tabs other than
navigator pane are used to perform a search.
8.3 MATLAB Files
MATLAB has three types of files for storing information. They are: M-files and MATfiles.
8.3.1 M-Files
These are standard ASCII text file with m extension to the file name and creating own
matrices using M-files, which are text files containing MATLAB code. MATLAB editor or
another text editor is used to create a file containing the same statements which are typed at the
MATLAB command line and save the file under a name that ends in .m.
There are two types of M-files
1. Script Files
It is an M-file with a set of MATLAB commands in it and is executed by typing name of file on
the command line. These files work on global variables currently present in that environment.
2. Function Files
A function file is also an M-file except that the variables in a function file are all local.
This type of files begins with a function definition line.
8.3.2 MAT-Files
These are binary data files with .mat extension to the file that are created by MATLAB
when the data is saved. The data written in a special format that only MATLAB can read. These
are located into MATLAB with load command.
PNC&VIET
CHAPTER 8
ECE-2014
Page 65
PNC&VIET
CHAPTER 8
ECE-2014
Page 66
It also includes low-level functions that allow you to fully customize the appearance of graphics
as well as to build complete graphical user interfaces on your MATLAB applications.
8.4.5 The MATLAB Application Program Interface (API):
This is a library that allows you to write C and FORTRAN programs that interact with
MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling
MATLAB as a computational engine, and for reading and writing MAT-files.
8.5 SOME BASIC COMMANDS:
Pwdprints working directory
Demo
Who
Whose
PNC&VIET
CHAPTER 8
ECE-2014
Page 67
d = find(x>100) returns the indices of the vector x that are greater than 100
Break terminate execution of m-file or WHILE or FOR loop
for repeat statements a specific number of times, the general form of a FOR
Statement is:
FOR variable = expr, statement, ..., statement END
For n=1:cc/c;
magn (n,1)=NaNmean(a((n-1)*c+1:n*c,1));
end
diff
NaN
by operations like dividing by zero, e.g. 1.0/0.0, or from overflow, e.g. exp(1000).
Save
saves all the matrices defined in the current session into the file,
Save filename x y z
PNC&VIET
CHAPTER 8
ECE-2014
Page 68
filename loads the contents of filename into current workspace; the file can be a binary (.mat)
file
Load filename.data loads the contents of filename.dat into the variable filename
Xlabel ( ) : Allows you to label x-axis
Ylabel ( ) : Allows you to label y-axis
Title ( )
plot
Subplot (): Allows you to create multiple
Plots in the same window
8.6 SOME BASIC PLOT COMMANDS:
Kinds of plots:
Plot(x,y)
plot(y)
creates a plot of y vs. the numerical values of the elements in the y-vector
Polar (theta,r) creates a polar plot of the vectors r & theta where theta is in radians
Bar(x)
creates a bar graph of the vector x. (Note also the command stairs(x))
PNC&VIET
CHAPTER 8
ECE-2014
Page 69
Bar(x, y) creates a bar-graph of the elements of the vector y, locating the bars
According to the vector elements of 'x' Plot description:
Grid creates a grid on the graphics plot
Title ('text') places a title at top of graphics plot
Xlabel ('text') writes 'text' beneath the x-axis of a plot
Ylabel ('text') writes 'text' beside the y-axis of a plot
Text(x,y, text') writes 'text' at the location (x,y)
Text(x,y,'text','SC') writes 'text' at point x,y assuming lower left corner is (0,0) and upper right
corner is (1,1)axis ([xmin xmax ymin ymax]) sets scaling for the x- and y-axes on the current
plot
8.7 ALGEBRIC OPERATIONS IN MATLAB:
Scalar Calculations:
+
Addition
Subtraction
Multiplication
Exponentiation
PNC&VIET
CHAPTER 8
ECE-2014
Page 70
For example
3*4
4/5
gives ans=0.8
a ./ b
a .\ b
a .^ b
PNC&VIET
CHAPTER 8
ECE-2014
Page 71
The workspace browser shows these variables and some information about them. Double
clicking on a variable in the workspace browser launches the Array Editor, which can be used to
obtain information and income instances edit certain properties of the variable.
The current Directory tab above the workspace tab shows the contents of the current
directory, whose path is shown in the current directory window. For example, in the windows
operating system the path might be as follows: C:\MATLAB\Work, indicating that directory
work is a subdirectory of the main directory MATLAB; WHICH IS INSTALLED IN
DRIVE C. clicking on the arrow in the current directory window shows a list of recently used
paths. Clicking on the button to the right of the window allows the user to change the current
directory.
MATLAB uses a search path to find M-files and other MATLAB related files, which are
organize in directories in the computer file system. Any file run in MATLAB must reside in the
current directory or in a directory that is on search path. By default, the files supplied with
MATLAB and math works toolboxes are included in the search path.
which directories are soon the search path, or to add or modify a search path, is to select set path
from the File menu the desktop, and then use the set path dialog box. It is good practice to add
any commonly used directories to the search path to avoid repeatedly having the change the
current directory.
The Command History Window contains a record of the commands a user has entered in
the command window, including both current and previous MATLAB sessions. Previously
entered MATLAB commands can be selected and re-executed from the command history
window by right clicking on a command or sequence of commands.
PNC&VIET
CHAPTER 8
ECE-2014
Page 72
This action launches a menu from which to select various options in addition to executing the
commands. This is useful to select various options in addition to executing the commands. This
is a useful feature when experimenting with various commands in a work session.
8.8.2 Using the MATLAB Editor to create M-Files:
The MATLAB editor is both a text editor specialized for creating M-files and a graphical
MATLAB debugger. The editor can appear in a window by itself, or it can be a sub window in
the desktop. M-files are denoted by the extension .m, as in pixelup.m.
The MATLAB editor window has numerous pull-down menus for tasks such as saving,
viewing, and debugging files. Because it performs some simple checks and also uses color to
differentiate between various elements of code, this text editor is recommended as the tool of
choice for writing and editing M-functions.
To open the editor , type edit at the prompt opens the M-file filename.m in an editor
window, ready for editing. As noted earlier, the file must be in the current directory, or in a
directory in the search path.
8.8.3 Getting Help:
The principal way to get help online is to use the MATLAB help browser, opened as a
separate window either by clicking on the question mark symbol (?) on the desktop toolbar, or by
typing help browser at the prompt in the command window. The help Browser is a web browser
integrated into the MATLAB desktop that displays a Hypertext Markup Language(HTML)
documents. The Help Browser consists of two panes, the help navigator pane, used to find
information, and the display pane, used to view the information. Self-explanatory tabs other than
navigator pane are used to perform a searc
APPENDIX-1
PROGRAM CODE
PNC&VIET
ECE-2014
Page 73
Clear all
Close all
Clc
mse = @(a,b) (a(:)-b(:))'*(a(:)-b(:))/numel(a);
snr = @(clean,noisy) 20*log10(mean(noisy(:))/mean(abs(clean(:)noisy(:))));
%%%%%%%%%%% reading an image %%%%%%%%%%%%%%%
I=uigetfile ('*.tif','Select an image');
I = imread (I);
I=im2double (I);
Imshow (I);
Title ('Clean Image')
%%%%%%%%% Adding noise to an image %%%%%%%%%%%%%%%%%%
N = imnoise (I, Gaussian', 0, .001);
Figure, imshow (N);
Title (['Noisy Image, mse = ' num2str (mse (I,N)), snr = ', num2str (snr
(I,N))])
%%%%%%%%%%%%% Applying NLM to noisy image %%%%%%%%%%%%%
D = Fast_NLM (N,5,3,0.1);
Figure, imshow (D);
title (['Denoised Image, mse = ' num2str(mse(I,D)), ', snr = ',
num2str(snr(I,D))])
PaddedImg = padarray(NoisyImg,
[PatchSizeHalf,PatchSizeHalf],'symmetric','both');
PaddedV = padarray(NoisyImg,
[WindowSizeHalf,WindowSizeHalf],'symmetric','both');
% Main loop
for dx = -WindowSizeHalf:WindowSizeHalf
fordy = -WindowSizeHalf:WindowSizeHalf
if dx ~= 0 || dy ~= 0
% Compute the Integral Image
Sd = integralImgSqDiff(PaddedImg,dx,dy);
% Obtaine the Square difference for every pair of pixels
SqDist = Sd(PatchSizeHalf+1:end-PatchSizeHalf,PatchSizeHalf+1:endPatchSizeHalf)+Sd(1:end-2*PatchSizeHalf,1:end-2*PatchSizeHalf)-Sd(1:end2*PatchSizeHalf,PatchSizeHalf+1:end-PatchSizeHalf)-Sd(PatchSizeHalf+1:endPatchSizeHalf,1:end-2*PatchSizeHalf);
% Compute the weights for every pixels
w = exp(-SqDist/(2*Sigma^2));
% Obtaine the corresponding noisy pixels
V=PaddedV((WindowSizeHalf+1+dx):(WindowSizeHalf+dx+Height),
(WindowSizeHalf+1+dy):(WindowSizeHalf+dy+Width));
% Compute and accumalatedenoised pixels
u = u+w.*v;
% Update weight max
M = max(M,w);
% Update accumlatedweighgs
Z = Z+w;
end
end
end
PNC&VIET
ECE-2014
Page 74
APPENDIX-2
SIMULATION RESULTS
PNC&VIET
ECE-2014
Page 75
PNC&VIET
ECE-2014
Page 76
FIG16:
SIMULATION
RESULT
APPENDIX3
CONCLUSION
PNC&VIET
ECE-2014
Page 77
The de-noising results of the proposed algorithm are comparable to that of the original NLMeans in terms of MSE. Improvement in MSE is achieved with reference to the original NLMeans. Smaller MSE indicates that the estimate is closer to the Original Image. The proposed
algorithm performs the best on periodic textures like the stripped scarf, trousers in the Barbara
image. The Natural photograph like "Well" also have enough redundancy to exploit by NLMeans, that's why the results are comparable with the Standard Test images. With the proposed
algorithm, the de-noising is achieved with smoother reconstruction and less artifacts. It proves
that the algorithm is spontaneous and powerful. The proposed de-noising algorithm
accomplished its goal of de-noising, i.e. improving PSNR and preserving the details, especially
the edges.
APPENDIX-4
REFERENCES
PNC&VIET
ECE-2014
Page 78
PNC&VIET
ECE-2014
Page 79