SlideShare une entreprise Scribd logo
1  sur  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.

Contenu connexe

Tendances

Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancyNaveen Kumar
 
Erosion and dilation
Erosion and dilationErosion and dilation
Erosion and dilationAkhil .B
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram ProcessingAmnaakhaan
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processingAbinaya B
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filterarulraj121
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Image Restoration
Image RestorationImage Restoration
Image RestorationPoonam Seth
 
Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformationsJohn Williams
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersSuhaila Afzana
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & momentsrajisri2
 
Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression techniquePriyanka Pachori
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processingkiruthiammu
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restorationMd Shabir Alam
 
Noise filtering
Noise filteringNoise filtering
Noise filteringAlaa Ahmed
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization11mr11mahesh
 

Tendances (20)

Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
Erosion and dilation
Erosion and dilationErosion and dilation
Erosion and dilation
 
Digital image processing
Digital image processing  Digital image processing
Digital image processing
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram Processing
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Image denoising
Image denoisingImage denoising
Image denoising
 
Image Restoration
Image RestorationImage Restoration
Image Restoration
 
Image trnsformations
Image trnsformationsImage trnsformations
Image trnsformations
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain Filters
 
Fourier descriptors & moments
Fourier descriptors & momentsFourier descriptors & moments
Fourier descriptors & moments
 
Wavelet based image compression technique
Wavelet based image compression techniqueWavelet based image compression technique
Wavelet based image compression technique
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 
Noise filtering
Noise filteringNoise filtering
Noise filtering
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization
 

Similaire à 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
 

Similaire à 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)
 
Unit3 dip
Unit3 dipUnit3 dip
Unit3 dip
 
Chap6 image restoration
Chap6 image restorationChap6 image restoration
Chap6 image restoration
 
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...
 

Plus 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
 

Plus 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
 

Dernier

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 

Dernier (20)

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 

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.