SlideShare una empresa de Scribd logo
1 de 36
ESTIMATING NOISE PARAMETER
&
FILTERING
Dr.S.SHAJUN NISHA,
MCA.,M.Phil.,M.Tech.,MBA.,Ph.D
Assistant Professor &Head
PG & Research Dept. of Computer Science
Sadakathullah Appa College
Shajunnisha_s@yahoo.com
+91 99420 96220
2
Estimating Noise Parameter
The parameters of periodic noise typically are estimated by
analyzing the Fourier spectrum of the image.
Periodic noise tends to produce frequency spikes that often
can be detected even by visual inspection.
In the case of noise in the spatial domain, the parameters of
the PDF may be known partially from sensor
specifications. However, it is often necessary to estimate
them from sample images. 
Estimating Noise Parameter Cont…
In general, the relationships between the mean, m, and
variance, , of the noise, and the parameters a and b
required to completely specify the noise PDFs of interest
(see Table 5.1).
Problem: Estimating mean and variance from the sample
image(s) and then using them to solve for a and b.
4
Estimating Noise Parameter – cont...
Let zi be a discrete random variable that denotes intensity
levels in an image. Note that a random number generator
usually produces numbers in the range [0 1].
You need to multiply that with the Max intensity value to
get the intensity. Assume p(zi), I = 0, 1, 2, …, L-1, be the
corresponding normalized histogram, where L is the
number of possible intensity values.
The central moments (moments around the mean) is
defined as:
Where n is the moment order, and m is the mean:
Note that histogram is normalized,
so sum of all p’s is 1.
From the first equation on the previous page, we can
determine that = 1, and = 0.
and:




1
0
)(
L
i
ii zpzm




1
0
2
2 )()(
L
i
ii zpmz
6
Estimating Noise Parameter – cont…
Is the variance. We only go this far up (second
component).
Function statmoments computes the mean and central
moments up to order n, and returns them in row vector v.
statmoments ignores these two moments and instead lets
v(1) = m and v(k) = for k = 2,3, …, n.
0 1
7
Example:
Consider this 4x4 image and
computed the first three central
moments.
m = 9
p0 = 2/16 , p4 = 4/16 , p8 = 1/16,
p10 = 6/16, p20 = 3/16












4102010
8440
1010410
2010020




1
0
)()(
L
i
i
n
in zpmz
10  01  2
8
Estimating Noise Parameter – cont.
In MATLAB: [u , unv] = statmoments(p, n)
Where p is the histogram vector and n is the number of
moments to compute. p must be 2q for unitq images.
Output vector u contains the normalized moments based on
values of the random variable that have been scaled to the
range [0, 1]. All the moments are also in the same range.
Vector unv contains the same moments as v, but computed
with the data in its original range of values.
Example:
If length(p) = 256 and v(1) = 0.5, then unv(1) would have
the value 127.5, which is half of the range [0 255].
9
Estimating Noise Parameter – cont.
Sometimes the noise parameter must be estimated
directly from a given noisy image or set of images. In such
cases we select part of the image that is as featureless as
possible to emphasize the primary noise as much as
possible.
To select region of interest (ROI) in MATLAB, we can use
roipoly function, which generates a polygonal ROI:
B = roipoly(f, c, r)
Where f is the image of interest, and c and r are vectors of
corresponding column and row coordinate of the vertices
of the polygon.
B is a binary image the same size as f with 0’s outside the
region of interest and 1’s inside. It is used as a mask to
limit operations to within the region of interest.
10
Estimating Noise Parameter – cont.
We can also set the ROI interactively:
B = roipoly(f)
Which displays the image f on the screen and allows the
user specify the polygon using the mouse.
Please see the help on this function to learn about other
ways we can run it.
11
Example: Original Image
12
[B, c, r] = roipoly(f)
13
Histogram of the ROI
X = imnoise2(‘gaussian’, npix, 1, 147, 20)
So the noise seem to look like a Gaussian. So the best estimate for this noise is Gaussian.
Histogram of the image
14
Periodic Noise Reduction by Frequency Domain Filtering
The periodic noise manifests itself as impulse-like bursts
that are often visible in the Fourier spectrum. The principal
approach for removing these components is via notch
filtering. The transfer function of a Butterworth notch filter
of order n is given by:
Where: D1(u,v) = [(u - M/2 – u0)2 + (v - N/2 – v0)2]1/2
And D2(u,v) = [(u - M/2 + u0)2 + (v - N/2 + v0)2]1/2
Where (u0, v0) and by symmetry (-u0, -v0) are locations of the
notches and D0 is the measure of their radius. Note: filter is
specified with respect to the center of the frequency
rectangle.
n
vuDvuD
D
vuH








),(),(
1
1
),(
21
2
0
15
Direct Inverse Filtering
The simplest form to restore a degraded image is to find an
estimate as:
and then find an estimate of the image by taking the
inverse Fourier transform. This is called inverse filtering.
),(
),(
),(
vuH
vuG
vuF 

),(
),(
),(),(
vuH
vuN
vuFvuF 

What are the problems you will run into here?
Typical approach is to form the ratio shown at the top and then limit the frequencies
“near” the origin when you compute the inverse.
Why frequencies “near” the origin?
16
Wiener Filtering
Wiener filtering is one of the best image restoration
approach. This approach seeks an estimate of f that
minimizes the statistical error function:
Where E is the expected value operator and f is the
undegraded image. The solution to this expression in
frequency domain is:
})ˆ{( 22
ffEe 
imageundegradedtheofspectrumpowerthe|),(|),(
noisetheofspectrumpowerthe|),(|),(
),(ofconjugatecomplexthe),(
),(),(|),(|
functionndegradatiothe),(
),(
),(/),(|),(|
|),(|
),(
1
),(ˆ
2
2
*
*2
2
2















vuFvuS
vuNvuS
vuHvuH
vuHvuHvuH
vuH
where
vuG
vuSvuSvuH
vuH
vuH
vuF
f
f


),(/),( vuSvuS f
Is called noise-to-signal ratio
17
),(/),( vuSvuS f
Wiener Filtering
The noise-to-signal ratio becomes zero when the noise
power spectrum becomes zero. See this:
Two other quantities can play a role in this model. One is
the average noise power:
And the average image power:
Where M and N denote the vertical and horizontal sizes of
the image and noise arrays, respectively. We can define a
ratio R as: that we will use in place of noise-to-
signal ratio on previous page.

u v
A vuS
MN
),(
1


u v
fA vuS
MN
f ),(
1
A
A
f
R


18
),(
/|),(|
|),(|
),(
1
),(ˆ
2
2
vuG
fvuH
vuH
vuH
vuF
AA









Wiener Filtering
We get a new model:
Which is called parametric Wiener filter.
This filter is implemented in MATLAB as:
fr = deconvwnr(g, PSF)
This assumes that the noise-to-signal ratio is zero. This one:
fr = deconvwnr(g, PSF, NSPR)
Assumes that the noise-to-signal power ratio is known, either as a constant or as an array. The
parametric version:
fr = deconvwnr(g, PSF, NACORR, FACORR)
Assumes the autocorrelation functions, NACORR and FACORR of the noise and undegrated
image are known.
19
Wiener Filtering Example
Previously we obtained this image using:
g = g + noise;
20
Wiener Filtering Example – cont.
Weiner filtering of degraded image g,
fr1 = deconvwnr(g, PSF);
This assumed
noise-to-signal
ratio was 0.
21
Sn = abs(fft2(noise)).^2; % noise power spectrum
nA = sum(Sn(:) )/prod(size(noise)); % noise average power
Sf = abs(fft2(f)).^2; % image power spectrum
fA = sum(Sf(:))/prod(size(f)); % image average power
R = nA/fA; /% ratio
To restore the image we use R for noise-to-signal ratio in
the Wiener filtering:
fr2 = deconvwnr(g, PSF, R);
This produces the image on the next page.
),(
/|),(|
|),(|
),(
1
),(ˆ
2
2
vuG
fvuH
vuH
vuH
vuF
AA









Compute:
Wiener Filtering Example
22
Wiener Filtering Example
Compare this image and the first one we obtained on Page 78.
23
Now we will use autocorrelation functions in the restoration.
NCORR = fftshift(real(ifft2(Sn)));
ICORR = fftshift(real(ifft2(Sf)));
fr3 = deconvwnr(g, PSF, NCORR, ICORR);
The result is very close to the
original image, but some
noise is still evident.
Note, here we knew the
noise function and we were
able to estimate correct
parameters.
24
Constrained Least Squares (Regularized) Filtering
The definition of 2-D discrete convolution is:
The degradation model in matrix form is:
We want to find the minimum of a criterion function:
The frequency domain solution
to this problem is given as:
Where is a parameter that must be adjusted so that the constraint is satisfied and P(u,v)
is the Fourier transform of the function:






1
0
1
0
),(),(
1
),(),(
M
m
N
n
nymxhnmf
MN
yxfyxh
),(
|),(||),(|
),(
),(ˆ
22
*
vuG
vuPvuH
vuH
vuF 



















010
141
010
),( yxP
Hfg 






1
0
1
0
22
constraintthesubject to)],([
M
x
N
y
yxfC
22
||η||||fHg||  ˆ

This method is based on the
Laplacian Transform
25
Constrained Least Squares (Regularized) Filtering
In MATLAB, the Constrained least squares filtering is done by function deconvreg as:
fr = deconvreg(g, PSF, NOISEPOWER, RANGE)
Where g is the corrupted image, fr is the restored image, NOISEPOWER is proportional to
, and RANGE is the range values where the algorithm is limited to look for a solution for .
The default range is [10-9 , 109]. A good starting estimate for NOISEPOWER is ,
where M and N are dimensions of the image and the parameters inside the brackets are
the noise variance and noise squared mean.
2
||||

][ 22
 mMN 
26
Example
Previously we obtained this image using:
g = g + noise;
27
fr = deconvreg(g, PSF, 4);
The initial estimate of NOISEPOWER is (64)2[0.001 – 0] ~ 4.
28
fr = deconvreg(g, PSF, 0.4, [1e-7 1e7]);
The result is not as good as that we
obtained with the Wiener’s method. It is
obvious why. When we used that
method we knew the noise and image
spectra.
29
Iterative Nonlinear Restoration Using the Lucy-
Richardson Algorithm
The previous three methods are all linear. They also are
“direct” in the sense that once the restoration filter is
specified, the solution is obtained via one application of
the filter.
The non-linear iterative techniques have been gaining
acceptance. They usually yield better result than the linear
methods. Perhaps the only drawback to using this
methods is that their behavior is not always predictable
and that they require significant computational resources.
One of the non-linear techniques discussed in the text is
Lucy-Richardson (L-R) algorithm.
30
The L-R Algorithm
This algorithm is based on a maximum-likelihood
formulation in which the image is modeled with Poisson
statistics. Maximizing the likelihood function of the model
yields an equation that is satisfied when the following
iteration converges.
As before “*” denotes convolution, is the undegraded
image, g is the degraded image, and h is the spatial
representation of the degraded function. Note that the
subscript refers to the iteration number.
As in any iterative approach, the question is when to stop
the iteration. We usually stop the iteration when the
result is somewhat acceptable.










),(ˆ),(
),(
),(),(ˆ),(ˆ
1
yxfyxh
yxg
yxhyxfyxf
k
kk
fˆ
31
The L-R Algorithm
In MATLAB the L-R algorithm is implemented by function
deconvlucy:
fr = deconvlucy(g, PSF, NUMIT, DAMPAR, WEIGHT)
Where fr is the restored image, g is the degraded image,
PSF is the point spread function, NUMIT is the number of
iterations (default is 10). DAMPAR denotes the threshold
deviation of the resulting image from image g and
WEIGHT is an array of same size as g that assigns weight to
each pixel to reflect its quality.
fˆ
32
L-R Example
Original image: f = checkerboard(8)
33
Create a 7x7 PSF with standard deviation of 10
PSF = fspecial(‘guassian’, 7, 10);
Then blur the image using PDF and add to it Gaussian noise of zero mean and standard
deviation of 0.01: SD = 0.01;
g = imnoise(imfilter(f, PSF), ‘gaussian’, 0, SD^2);
34
DAMPAR = 10*SD;
LIM = ceil(size(PSF, 1)/2);
WEIGHT = zeros(size(g));
WEIGHT(LIM + 1:end – LIM, LIM + 1:end – LIM) = 1;
WEIGHT is a 64x64 array with a border of 0’s 4 pixels
wide and the rest all 1’s.
NUMIT = 5; % Number of iterations
fr = deconvlucy(g, PSF, NUMIT, DAMPAR, WEIGHT);
35
NUMIT = 10; % Number of iterations
fr = deconvlucy(g, PSF, NUMIT, DAMPAR, WEIGHT);
10 iterations 20 iterations
36
With 100 iterations we didn’t get much better results. It
however costs much more computing time.
The thin black border is the result of 0’s in array
WEIGHT.

Más contenido relacionado

La actualidad más candente

Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)Kalyan Acharjya
 
Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Kalyan Acharjya
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesCristina Pérez Benito
 
Homomorphic filtering
Homomorphic filteringHomomorphic filtering
Homomorphic filteringGautam Saxena
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processingAhmed Daoud
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processingasodariyabhavesh
 
Image enhancement sharpening
Image enhancement  sharpeningImage enhancement  sharpening
Image enhancement sharpeningarulraj121
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainA B Shinde
 
Image compression standards
Image compression standardsImage compression standards
Image compression standardskirupasuchi1996
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency DomainAmnaakhaan
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 

La actualidad más candente (20)

Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)
 
Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color Images
 
Homomorphic filtering
Homomorphic filteringHomomorphic filtering
Homomorphic filtering
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Chap6 image restoration
Chap6 image restorationChap6 image restoration
Chap6 image restoration
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processing
 
Image enhancement sharpening
Image enhancement  sharpeningImage enhancement  sharpening
Image enhancement sharpening
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Segmentation
SegmentationSegmentation
Segmentation
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image compression standards
Image compression standardsImage compression standards
Image compression standards
 
Unit3 dip
Unit3 dipUnit3 dip
Unit3 dip
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 

Similar a ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)

Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Shajun Nisha
 
Image restoration1
Image restoration1Image restoration1
Image restoration1moorthim7
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods thanhhoang2012
 
Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Varun Ojha
 
Robust Super-Resolution by minimizing a Gaussian-weighted L2 error norm
Robust Super-Resolution by minimizing a Gaussian-weighted L2 error normRobust Super-Resolution by minimizing a Gaussian-weighted L2 error norm
Robust Super-Resolution by minimizing a Gaussian-weighted L2 error normTuan Q. Pham
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
Digital Image Processing - Image Restoration
Digital Image Processing - Image RestorationDigital Image Processing - Image Restoration
Digital Image Processing - Image RestorationMathankumar S
 
13 fourierfiltrationen
13 fourierfiltrationen13 fourierfiltrationen
13 fourierfiltrationenhoailinhtinh
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfnagwaAboElenein
 
Denoising of image using wavelet
Denoising of image using waveletDenoising of image using wavelet
Denoising of image using waveletAsim Qureshi
 
Image Denoising Using Wavelet
Image Denoising Using WaveletImage Denoising Using Wavelet
Image Denoising Using WaveletAsim Qureshi
 
Iisrt zzz bhavyasri vanteddu
Iisrt zzz bhavyasri vantedduIisrt zzz bhavyasri vanteddu
Iisrt zzz bhavyasri vantedduIISRT
 
conference_poster_4
conference_poster_4conference_poster_4
conference_poster_4Jiayi Jiang
 

Similar a ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing) (20)

Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
 
Image restoration1
Image restoration1Image restoration1
Image restoration1
 
Frequency domain methods
Frequency domain methods Frequency domain methods
Frequency domain methods
 
Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)
 
Image restoration and reconstruction
Image restoration and reconstructionImage restoration and reconstruction
Image restoration and reconstruction
 
Robust Super-Resolution by minimizing a Gaussian-weighted L2 error norm
Robust Super-Resolution by minimizing a Gaussian-weighted L2 error normRobust Super-Resolution by minimizing a Gaussian-weighted L2 error norm
Robust Super-Resolution by minimizing a Gaussian-weighted L2 error norm
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Image processing 2
Image processing 2Image processing 2
Image processing 2
 
Digital Image Processing - Image Restoration
Digital Image Processing - Image RestorationDigital Image Processing - Image Restoration
Digital Image Processing - Image Restoration
 
13 fourierfiltrationen
13 fourierfiltrationen13 fourierfiltrationen
13 fourierfiltrationen
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
Denoising of image using wavelet
Denoising of image using waveletDenoising of image using wavelet
Denoising of image using wavelet
 
Image Denoising Using Wavelet
Image Denoising Using WaveletImage Denoising Using Wavelet
Image Denoising Using Wavelet
 
Iisrt zzz bhavyasri vanteddu
Iisrt zzz bhavyasri vantedduIisrt zzz bhavyasri vanteddu
Iisrt zzz bhavyasri vanteddu
 
PID3474431
PID3474431PID3474431
PID3474431
 
Image Processing With Sampling and Noise Filtration in Image Reconigation Pr...
Image Processing With Sampling and Noise Filtration in Image  Reconigation Pr...Image Processing With Sampling and Noise Filtration in Image  Reconigation Pr...
Image Processing With Sampling and Noise Filtration in Image Reconigation Pr...
 
image restoration.ppt
image restoration.pptimage restoration.ppt
image restoration.ppt
 
conference_poster_4
conference_poster_4conference_poster_4
conference_poster_4
 

Más de Shajun Nisha

Google meet and its extensions sac
Google meet and its extensions sacGoogle meet and its extensions sac
Google meet and its extensions sacShajun Nisha
 
Dip fundamentals 2
Dip fundamentals 2Dip fundamentals 2
Dip fundamentals 2Shajun Nisha
 
Dip digital image 3
Dip digital image 3Dip digital image 3
Dip digital image 3Shajun Nisha
 
25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rights25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rightsShajun Nisha
 
Linear regression in machine learning
Linear regression in machine learningLinear regression in machine learning
Linear regression in machine learningShajun Nisha
 
Basics of research in research methodology
Basics of research in research methodologyBasics of research in research methodology
Basics of research in research methodologyShajun Nisha
 
Auto encoders in Deep Learning
Auto encoders in Deep LearningAuto encoders in Deep Learning
Auto encoders in Deep LearningShajun Nisha
 
Teaching Aptitude in Research Methodology
Teaching Aptitude in Research MethodologyTeaching Aptitude in Research Methodology
Teaching Aptitude in Research MethodologyShajun Nisha
 
Perceptron and Sigmoid Neurons
Perceptron and Sigmoid NeuronsPerceptron and Sigmoid Neurons
Perceptron and Sigmoid NeuronsShajun Nisha
 
Mc Culloch Pitts Neuron
Mc Culloch Pitts NeuronMc Culloch Pitts Neuron
Mc Culloch Pitts NeuronShajun Nisha
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringShajun Nisha
 
Image processing lab work
Image processing lab workImage processing lab work
Image processing lab workShajun Nisha
 
introduction to cloud computing
 introduction to cloud computing introduction to cloud computing
introduction to cloud computingShajun Nisha
 
online learning NPTEL
online learning NPTELonline learning NPTEL
online learning NPTELShajun Nisha
 

Más de Shajun Nisha (17)

Google meet and its extensions sac
Google meet and its extensions sacGoogle meet and its extensions sac
Google meet and its extensions sac
 
Dip syntax 4
Dip syntax 4Dip syntax 4
Dip syntax 4
 
Dip fundamentals 2
Dip fundamentals 2Dip fundamentals 2
Dip fundamentals 2
 
Dip application 1
Dip application 1Dip application 1
Dip application 1
 
Dip digital image 3
Dip digital image 3Dip digital image 3
Dip digital image 3
 
ICT tools
ICT  toolsICT  tools
ICT tools
 
25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rights25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rights
 
Linear regression in machine learning
Linear regression in machine learningLinear regression in machine learning
Linear regression in machine learning
 
Basics of research in research methodology
Basics of research in research methodologyBasics of research in research methodology
Basics of research in research methodology
 
Auto encoders in Deep Learning
Auto encoders in Deep LearningAuto encoders in Deep Learning
Auto encoders in Deep Learning
 
Teaching Aptitude in Research Methodology
Teaching Aptitude in Research MethodologyTeaching Aptitude in Research Methodology
Teaching Aptitude in Research Methodology
 
Perceptron and Sigmoid Neurons
Perceptron and Sigmoid NeuronsPerceptron and Sigmoid Neurons
Perceptron and Sigmoid Neurons
 
Mc Culloch Pitts Neuron
Mc Culloch Pitts NeuronMc Culloch Pitts Neuron
Mc Culloch Pitts Neuron
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
 
Image processing lab work
Image processing lab workImage processing lab work
Image processing lab work
 
introduction to cloud computing
 introduction to cloud computing introduction to cloud computing
introduction to cloud computing
 
online learning NPTEL
online learning NPTELonline learning NPTEL
online learning NPTEL
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 

Último (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)

  • 1. ESTIMATING NOISE PARAMETER & FILTERING Dr.S.SHAJUN NISHA, MCA.,M.Phil.,M.Tech.,MBA.,Ph.D Assistant Professor &Head PG & Research Dept. of Computer Science Sadakathullah Appa College Shajunnisha_s@yahoo.com +91 99420 96220
  • 2. 2 Estimating Noise Parameter The parameters of periodic noise typically are estimated by analyzing the Fourier spectrum of the image. Periodic noise tends to produce frequency spikes that often can be detected even by visual inspection. In the case of noise in the spatial domain, the parameters of the PDF may be known partially from sensor specifications. However, it is often necessary to estimate them from sample images. 
  • 3. Estimating Noise Parameter Cont… In general, the relationships between the mean, m, and variance, , of the noise, and the parameters a and b required to completely specify the noise PDFs of interest (see Table 5.1). Problem: Estimating mean and variance from the sample image(s) and then using them to solve for a and b.
  • 4. 4 Estimating Noise Parameter – cont... Let zi be a discrete random variable that denotes intensity levels in an image. Note that a random number generator usually produces numbers in the range [0 1]. You need to multiply that with the Max intensity value to get the intensity. Assume p(zi), I = 0, 1, 2, …, L-1, be the corresponding normalized histogram, where L is the number of possible intensity values.
  • 5. The central moments (moments around the mean) is defined as: Where n is the moment order, and m is the mean: Note that histogram is normalized, so sum of all p’s is 1. From the first equation on the previous page, we can determine that = 1, and = 0. and:     1 0 )( L i ii zpzm     1 0 2 2 )()( L i ii zpmz
  • 6. 6 Estimating Noise Parameter – cont… Is the variance. We only go this far up (second component). Function statmoments computes the mean and central moments up to order n, and returns them in row vector v. statmoments ignores these two moments and instead lets v(1) = m and v(k) = for k = 2,3, …, n. 0 1
  • 7. 7 Example: Consider this 4x4 image and computed the first three central moments. m = 9 p0 = 2/16 , p4 = 4/16 , p8 = 1/16, p10 = 6/16, p20 = 3/16             4102010 8440 1010410 2010020     1 0 )()( L i i n in zpmz 10  01  2
  • 8. 8 Estimating Noise Parameter – cont. In MATLAB: [u , unv] = statmoments(p, n) Where p is the histogram vector and n is the number of moments to compute. p must be 2q for unitq images. Output vector u contains the normalized moments based on values of the random variable that have been scaled to the range [0, 1]. All the moments are also in the same range. Vector unv contains the same moments as v, but computed with the data in its original range of values. Example: If length(p) = 256 and v(1) = 0.5, then unv(1) would have the value 127.5, which is half of the range [0 255].
  • 9. 9 Estimating Noise Parameter – cont. Sometimes the noise parameter must be estimated directly from a given noisy image or set of images. In such cases we select part of the image that is as featureless as possible to emphasize the primary noise as much as possible. To select region of interest (ROI) in MATLAB, we can use roipoly function, which generates a polygonal ROI: B = roipoly(f, c, r) Where f is the image of interest, and c and r are vectors of corresponding column and row coordinate of the vertices of the polygon. B is a binary image the same size as f with 0’s outside the region of interest and 1’s inside. It is used as a mask to limit operations to within the region of interest.
  • 10. 10 Estimating Noise Parameter – cont. We can also set the ROI interactively: B = roipoly(f) Which displays the image f on the screen and allows the user specify the polygon using the mouse. Please see the help on this function to learn about other ways we can run it.
  • 12. 12 [B, c, r] = roipoly(f)
  • 13. 13 Histogram of the ROI X = imnoise2(‘gaussian’, npix, 1, 147, 20) So the noise seem to look like a Gaussian. So the best estimate for this noise is Gaussian. Histogram of the image
  • 14. 14 Periodic Noise Reduction by Frequency Domain Filtering The periodic noise manifests itself as impulse-like bursts that are often visible in the Fourier spectrum. The principal approach for removing these components is via notch filtering. The transfer function of a Butterworth notch filter of order n is given by: Where: D1(u,v) = [(u - M/2 – u0)2 + (v - N/2 – v0)2]1/2 And D2(u,v) = [(u - M/2 + u0)2 + (v - N/2 + v0)2]1/2 Where (u0, v0) and by symmetry (-u0, -v0) are locations of the notches and D0 is the measure of their radius. Note: filter is specified with respect to the center of the frequency rectangle. n vuDvuD D vuH         ),(),( 1 1 ),( 21 2 0
  • 15. 15 Direct Inverse Filtering The simplest form to restore a degraded image is to find an estimate as: and then find an estimate of the image by taking the inverse Fourier transform. This is called inverse filtering. ),( ),( ),( vuH vuG vuF   ),( ),( ),(),( vuH vuN vuFvuF   What are the problems you will run into here? Typical approach is to form the ratio shown at the top and then limit the frequencies “near” the origin when you compute the inverse. Why frequencies “near” the origin?
  • 16. 16 Wiener Filtering Wiener filtering is one of the best image restoration approach. This approach seeks an estimate of f that minimizes the statistical error function: Where E is the expected value operator and f is the undegraded image. The solution to this expression in frequency domain is: })ˆ{( 22 ffEe  imageundegradedtheofspectrumpowerthe|),(|),( noisetheofspectrumpowerthe|),(|),( ),(ofconjugatecomplexthe),( ),(),(|),(| functionndegradatiothe),( ),( ),(/),(|),(| |),(| ),( 1 ),(ˆ 2 2 * *2 2 2                vuFvuS vuNvuS vuHvuH vuHvuHvuH vuH where vuG vuSvuSvuH vuH vuH vuF f f   ),(/),( vuSvuS f Is called noise-to-signal ratio
  • 17. 17 ),(/),( vuSvuS f Wiener Filtering The noise-to-signal ratio becomes zero when the noise power spectrum becomes zero. See this: Two other quantities can play a role in this model. One is the average noise power: And the average image power: Where M and N denote the vertical and horizontal sizes of the image and noise arrays, respectively. We can define a ratio R as: that we will use in place of noise-to- signal ratio on previous page.  u v A vuS MN ),( 1   u v fA vuS MN f ),( 1 A A f R  
  • 18. 18 ),( /|),(| |),(| ),( 1 ),(ˆ 2 2 vuG fvuH vuH vuH vuF AA          Wiener Filtering We get a new model: Which is called parametric Wiener filter. This filter is implemented in MATLAB as: fr = deconvwnr(g, PSF) This assumes that the noise-to-signal ratio is zero. This one: fr = deconvwnr(g, PSF, NSPR) Assumes that the noise-to-signal power ratio is known, either as a constant or as an array. The parametric version: fr = deconvwnr(g, PSF, NACORR, FACORR) Assumes the autocorrelation functions, NACORR and FACORR of the noise and undegrated image are known.
  • 19. 19 Wiener Filtering Example Previously we obtained this image using: g = g + noise;
  • 20. 20 Wiener Filtering Example – cont. Weiner filtering of degraded image g, fr1 = deconvwnr(g, PSF); This assumed noise-to-signal ratio was 0.
  • 21. 21 Sn = abs(fft2(noise)).^2; % noise power spectrum nA = sum(Sn(:) )/prod(size(noise)); % noise average power Sf = abs(fft2(f)).^2; % image power spectrum fA = sum(Sf(:))/prod(size(f)); % image average power R = nA/fA; /% ratio To restore the image we use R for noise-to-signal ratio in the Wiener filtering: fr2 = deconvwnr(g, PSF, R); This produces the image on the next page. ),( /|),(| |),(| ),( 1 ),(ˆ 2 2 vuG fvuH vuH vuH vuF AA          Compute: Wiener Filtering Example
  • 22. 22 Wiener Filtering Example Compare this image and the first one we obtained on Page 78.
  • 23. 23 Now we will use autocorrelation functions in the restoration. NCORR = fftshift(real(ifft2(Sn))); ICORR = fftshift(real(ifft2(Sf))); fr3 = deconvwnr(g, PSF, NCORR, ICORR); The result is very close to the original image, but some noise is still evident. Note, here we knew the noise function and we were able to estimate correct parameters.
  • 24. 24 Constrained Least Squares (Regularized) Filtering The definition of 2-D discrete convolution is: The degradation model in matrix form is: We want to find the minimum of a criterion function: The frequency domain solution to this problem is given as: Where is a parameter that must be adjusted so that the constraint is satisfied and P(u,v) is the Fourier transform of the function:       1 0 1 0 ),(),( 1 ),(),( M m N n nymxhnmf MN yxfyxh ),( |),(||),(| ),( ),(ˆ 22 * vuG vuPvuH vuH vuF                     010 141 010 ),( yxP Hfg        1 0 1 0 22 constraintthesubject to)],([ M x N y yxfC 22 ||η||||fHg||  ˆ  This method is based on the Laplacian Transform
  • 25. 25 Constrained Least Squares (Regularized) Filtering In MATLAB, the Constrained least squares filtering is done by function deconvreg as: fr = deconvreg(g, PSF, NOISEPOWER, RANGE) Where g is the corrupted image, fr is the restored image, NOISEPOWER is proportional to , and RANGE is the range values where the algorithm is limited to look for a solution for . The default range is [10-9 , 109]. A good starting estimate for NOISEPOWER is , where M and N are dimensions of the image and the parameters inside the brackets are the noise variance and noise squared mean. 2 ||||  ][ 22  mMN 
  • 26. 26 Example Previously we obtained this image using: g = g + noise;
  • 27. 27 fr = deconvreg(g, PSF, 4); The initial estimate of NOISEPOWER is (64)2[0.001 – 0] ~ 4.
  • 28. 28 fr = deconvreg(g, PSF, 0.4, [1e-7 1e7]); The result is not as good as that we obtained with the Wiener’s method. It is obvious why. When we used that method we knew the noise and image spectra.
  • 29. 29 Iterative Nonlinear Restoration Using the Lucy- Richardson Algorithm The previous three methods are all linear. They also are “direct” in the sense that once the restoration filter is specified, the solution is obtained via one application of the filter. The non-linear iterative techniques have been gaining acceptance. They usually yield better result than the linear methods. Perhaps the only drawback to using this methods is that their behavior is not always predictable and that they require significant computational resources. One of the non-linear techniques discussed in the text is Lucy-Richardson (L-R) algorithm.
  • 30. 30 The L-R Algorithm This algorithm is based on a maximum-likelihood formulation in which the image is modeled with Poisson statistics. Maximizing the likelihood function of the model yields an equation that is satisfied when the following iteration converges. As before “*” denotes convolution, is the undegraded image, g is the degraded image, and h is the spatial representation of the degraded function. Note that the subscript refers to the iteration number. As in any iterative approach, the question is when to stop the iteration. We usually stop the iteration when the result is somewhat acceptable.           ),(ˆ),( ),( ),(),(ˆ),(ˆ 1 yxfyxh yxg yxhyxfyxf k kk fˆ
  • 31. 31 The L-R Algorithm In MATLAB the L-R algorithm is implemented by function deconvlucy: fr = deconvlucy(g, PSF, NUMIT, DAMPAR, WEIGHT) Where fr is the restored image, g is the degraded image, PSF is the point spread function, NUMIT is the number of iterations (default is 10). DAMPAR denotes the threshold deviation of the resulting image from image g and WEIGHT is an array of same size as g that assigns weight to each pixel to reflect its quality. fˆ
  • 32. 32 L-R Example Original image: f = checkerboard(8)
  • 33. 33 Create a 7x7 PSF with standard deviation of 10 PSF = fspecial(‘guassian’, 7, 10); Then blur the image using PDF and add to it Gaussian noise of zero mean and standard deviation of 0.01: SD = 0.01; g = imnoise(imfilter(f, PSF), ‘gaussian’, 0, SD^2);
  • 34. 34 DAMPAR = 10*SD; LIM = ceil(size(PSF, 1)/2); WEIGHT = zeros(size(g)); WEIGHT(LIM + 1:end – LIM, LIM + 1:end – LIM) = 1; WEIGHT is a 64x64 array with a border of 0’s 4 pixels wide and the rest all 1’s. NUMIT = 5; % Number of iterations fr = deconvlucy(g, PSF, NUMIT, DAMPAR, WEIGHT);
  • 35. 35 NUMIT = 10; % Number of iterations fr = deconvlucy(g, PSF, NUMIT, DAMPAR, WEIGHT); 10 iterations 20 iterations
  • 36. 36 With 100 iterations we didn’t get much better results. It however costs much more computing time. The thin black border is the result of 0’s in array WEIGHT.