SlideShare a Scribd company logo
1 of 41
Linear Filtering
• About modifying pixels based on
neighborhood. Local methods simplest.
• Linear means linear combination of
neighbors. Linear methods simplest.
• Useful to:
– Integrate information over constant regions.
– Scale.
– Detect changes.
• Fourier analysis.
• Many nice slides taken from Bill Freeman.
(Freeman)
(Freeman)
Correlation
Examples on white board – 1D
Examples -2D
For example, let’s take a vector like:
(1 2 3 2 3 2 1), and filter it with a filter like (1/3 1/3 1/3)
Ignoring the ends for the moment, we get a result like:
2 2 1/3 2 2/3 2 1/3 2. We can also graph the results
and see that the original vector is smoothed out.
Boundaries
• Zeros
• Repeat values
• Cycle
• Produce shorter result
• Examples
Correlation





N
N
i
i
x
I
i
F
x
I
F )
(
)
(
)
(

 

 




N
N
j
N
N
i
j
y
i
x
I
j
i
F
y
x
I
F )
,
(
)
,
(
)
,
(

For this notation, we index F from –N to N.
Convolution
• Like Correlation with Filter Reversed
• Associative






N
N
i
i
x
I
i
F
x
I
F )
(
)
(
)
(
 

 





N
N
j
N
N
i
j
y
i
x
I
j
i
F
y
x
I
F )
,
(
)
,
(
)
,
(
1D
2D
Some Examples
Filtering to reduce noise
• Noise is what we’re not interested in.
– We’ll discuss simple, low-level noise today:
Light fluctuations; Sensor noise;
Quantization effects; Finite precision
– Not complex: shadows; extraneous
objects.
• A pixel’s neighborhood contains
information about its intensity.
• Averaging noise reduces its effect.
Additive noise
• I = S + N. Noise doesn’t depend on
signal.
• We’ll consider:
d
distribute
y
identicall
,
for
t
independen
,
tic.
determinis
0
)
(
with
j
i
j
i
j
i
i
i
i
i
i
n
n
n
n
n
n
s
n
E
n
s
I




Average Filter
• Mask with positive
entries, that sum 1.
• Replaces each pixel
with an average of
its neighborhood.
• If all weights are
equal, it is called a
BOX filter.
1
1
1
1
1 1
1
1
1
F
1/9
(Camps)
Averaging Filter and noise
reduction
• Example: try executing:
k=1; figure(1); hist(sum((1/k)*rand(k,1000)))
for different values of k.
• The average of noise is smaller than one example.
– This is intuitive
– Can be proven in many cases (some technical conditions:
noise must be independent, many samples….)
– Actually true for many real examples: Gaussian noise,
flipping a coin many times
Filtering reduces noise if signal
stable
• Suppose I(i) = I+n(i), I(i+1) = I+n(i+1)
I(i+2) = I+n(i+2).
• Average of I(i), I(i+1), I(i+2) = I +
average of n(i), n(i+1), n(i+2).
• When there is no noise, averaging
smooths the signal.
• So in real life, averaging does both.
Example: Smoothing by
Averaging
Smoothing as Inference About
the Signal
+ =
Nearby points tell more about the
signal than distant ones.
Neighborhood for
averaging.
Gaussian Averaging
• Rotationally
symmetric.
• Weights nearby
pixels more than
distant ones.
– This makes sense
as probabalistic
inference.
• A Gaussian gives a
good model of a fuzzy
blob
An Isotropic Gaussian
• The picture shows a
smoothing kernel
proportional to
(which is a reasonable
model of a circularly
symmetric fuzzy
blob)
  




 

 2
2
2
0
2
exp
2
1
)
,
(



y
x
y
x
G
Smoothing with a Gaussian
The effects of smoothing
Each row shows smoothing
with gaussians of different
width; each column shows
different realizations of
an image of gaussian noise.
Efficient Implementation
• Both, the BOX filter and the Gaussian
filter are separable:
– First convolve each row with a 1D filter
– Then convolve each column with a 1D
filter.
Box Filter











































0
0
0
3
1
3
1
3
1
0
0
0
0
3
1
0
0
3
1
0
0
3
1
0
9
1
9
1
9
1
9
1
9
1
9
1
9
1
9
1
9
1

Gaussian Filter
    












 

 2
2
2
2
2
2
2
0
2
exp
2
exp
2
1
2
exp
2
1
)
,
(







y
x
y
x
y
x
G
Smoothing as Inference About
the Signal: Non-linear Filters.
+ =
What’s the best
neighborhood for
inference?
Filtering to reduce noise:
Lessons
• Noise reduction is probabilistic
inference.
• Depends on knowledge of signal and
noise.
• In practice, simplicity and efficiency
important.
Filtering and Signal
• Smoothing also smooths signal.
• Matlab
• Removes detail
• Matlab
• This is good and bad:
- Bad: can’t remove noise w/out blurring
shape.
- Good: captures large scale structure;
allows subsampling.
Subsampling
Matlab

More Related Content

Similar to Linear Filtering for Noise Reduction

05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.pptpawankamal3
 
Noise filtering
Noise filteringNoise filtering
Noise filteringAlaa Ahmed
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) Charles Deledalle
 
Digital communication
Digital communicationDigital communication
Digital communicationmeashi
 
Pseudo and Quasi Random Number Generation
Pseudo and Quasi Random Number GenerationPseudo and Quasi Random Number Generation
Pseudo and Quasi Random Number GenerationAshwin Rao
 
Digitaltechnology 090926105236-phpapp02
Digitaltechnology 090926105236-phpapp02Digitaltechnology 090926105236-phpapp02
Digitaltechnology 090926105236-phpapp02Msbiswa
 
Edge linking via Hough transform.ppt
Edge linking via Hough transform.pptEdge linking via Hough transform.ppt
Edge linking via Hough transform.pptSivaSankar306103
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...Hemantha Kulathilake
 
image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptxNaveenKumar5162
 
04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequency04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequencyElsayed Hemayed
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image FundamentalsKalyan Acharjya
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersKuppusamy P
 

Similar to Linear Filtering for Noise Reduction (20)

05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Noise filtering
Noise filteringNoise filtering
Noise filtering
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Image pipeline
Image pipelineImage pipeline
Image pipeline
 
Digital communication
Digital communicationDigital communication
Digital communication
 
Pseudo and Quasi Random Number Generation
Pseudo and Quasi Random Number GenerationPseudo and Quasi Random Number Generation
Pseudo and Quasi Random Number Generation
 
DIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.pptxDIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.pptx
 
2. filtering basics
2. filtering basics2. filtering basics
2. filtering basics
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Digitaltechnology 090926105236-phpapp02
Digitaltechnology 090926105236-phpapp02Digitaltechnology 090926105236-phpapp02
Digitaltechnology 090926105236-phpapp02
 
Lecture-11.pdf
Lecture-11.pdfLecture-11.pdf
Lecture-11.pdf
 
Edge linking via Hough transform.ppt
Edge linking via Hough transform.pptEdge linking via Hough transform.ppt
Edge linking via Hough transform.ppt
 
Teknik Simulasi
Teknik SimulasiTeknik Simulasi
Teknik Simulasi
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
 
image segmentation image segmentation.pptx
image segmentation image segmentation.pptximage segmentation image segmentation.pptx
image segmentation image segmentation.pptx
 
04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequency04 cie552 image_filtering_frequency
04 cie552 image_filtering_frequency
 
Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filters
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 

Recently uploaded (20)

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
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 

Linear Filtering for Noise Reduction

  • 1. Linear Filtering • About modifying pixels based on neighborhood. Local methods simplest. • Linear means linear combination of neighbors. Linear methods simplest. • Useful to: – Integrate information over constant regions. – Scale. – Detect changes. • Fourier analysis. • Many nice slides taken from Bill Freeman.
  • 4. Correlation Examples on white board – 1D Examples -2D
  • 5. For example, let’s take a vector like: (1 2 3 2 3 2 1), and filter it with a filter like (1/3 1/3 1/3) Ignoring the ends for the moment, we get a result like: 2 2 1/3 2 2/3 2 1/3 2. We can also graph the results and see that the original vector is smoothed out.
  • 6. Boundaries • Zeros • Repeat values • Cycle • Produce shorter result • Examples
  • 7. Correlation      N N i i x I i F x I F ) ( ) ( ) (           N N j N N i j y i x I j i F y x I F ) , ( ) , ( ) , (  For this notation, we index F from –N to N.
  • 8. Convolution • Like Correlation with Filter Reversed • Associative       N N i i x I i F x I F ) ( ) ( ) (           N N j N N i j y i x I j i F y x I F ) , ( ) , ( ) , ( 1D 2D
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. Filtering to reduce noise • Noise is what we’re not interested in. – We’ll discuss simple, low-level noise today: Light fluctuations; Sensor noise; Quantization effects; Finite precision – Not complex: shadows; extraneous objects. • A pixel’s neighborhood contains information about its intensity. • Averaging noise reduces its effect.
  • 25. Additive noise • I = S + N. Noise doesn’t depend on signal. • We’ll consider: d distribute y identicall , for t independen , tic. determinis 0 ) ( with j i j i j i i i i i i n n n n n n s n E n s I    
  • 26. Average Filter • Mask with positive entries, that sum 1. • Replaces each pixel with an average of its neighborhood. • If all weights are equal, it is called a BOX filter. 1 1 1 1 1 1 1 1 1 F 1/9 (Camps)
  • 27. Averaging Filter and noise reduction • Example: try executing: k=1; figure(1); hist(sum((1/k)*rand(k,1000))) for different values of k. • The average of noise is smaller than one example. – This is intuitive – Can be proven in many cases (some technical conditions: noise must be independent, many samples….) – Actually true for many real examples: Gaussian noise, flipping a coin many times
  • 28. Filtering reduces noise if signal stable • Suppose I(i) = I+n(i), I(i+1) = I+n(i+1) I(i+2) = I+n(i+2). • Average of I(i), I(i+1), I(i+2) = I + average of n(i), n(i+1), n(i+2). • When there is no noise, averaging smooths the signal. • So in real life, averaging does both.
  • 30. Smoothing as Inference About the Signal + = Nearby points tell more about the signal than distant ones. Neighborhood for averaging.
  • 31. Gaussian Averaging • Rotationally symmetric. • Weights nearby pixels more than distant ones. – This makes sense as probabalistic inference. • A Gaussian gives a good model of a fuzzy blob
  • 32. An Isotropic Gaussian • The picture shows a smoothing kernel proportional to (which is a reasonable model of a circularly symmetric fuzzy blob)            2 2 2 0 2 exp 2 1 ) , (    y x y x G
  • 33. Smoothing with a Gaussian
  • 34. The effects of smoothing Each row shows smoothing with gaussians of different width; each column shows different realizations of an image of gaussian noise.
  • 35. Efficient Implementation • Both, the BOX filter and the Gaussian filter are separable: – First convolve each row with a 1D filter – Then convolve each column with a 1D filter.
  • 37. Gaussian Filter                      2 2 2 2 2 2 2 0 2 exp 2 exp 2 1 2 exp 2 1 ) , (        y x y x y x G
  • 38. Smoothing as Inference About the Signal: Non-linear Filters. + = What’s the best neighborhood for inference?
  • 39. Filtering to reduce noise: Lessons • Noise reduction is probabilistic inference. • Depends on knowledge of signal and noise. • In practice, simplicity and efficiency important.
  • 40. Filtering and Signal • Smoothing also smooths signal. • Matlab • Removes detail • Matlab • This is good and bad: - Bad: can’t remove noise w/out blurring shape. - Good: captures large scale structure; allows subsampling.