Spatial Filters (Digital Image Processing)

Kalyan Acharjya
Kalyan AcharjyaJaipur National University, Jaipur
Unit 3-Image Enhancement
Spatial Filters
Lecture By
Kalyan Acharjya
kalyan5.blogspot.in
Lecture No 14
1
Disclaimer
 This PPT contents are copied from various
publicly available sources and all images are
copyright of the respective original owner.
 This is used for academic purpose only.
2
Spatial Filtering Methods
(or Mask Processing Methods)
output image
3
Spatial Filtering (cont’d)
 Filters are classified as:
 Low-pass (i.e., preserve low frequencies)
 High-pass (i.e., preserve high frequencies)
 Band-pass (i.e., preserve frequencies within a band)
 Band-reject (i.e., reject frequencies within a band)
4
Spatial Filtering (cont’d)
 Need to define:
 A neighborhood (or mask)
 An Mask Operation
•Typically, the neighborhood
is rectangular and its size is
much smaller than that of
f(x,y) - e.g., 3x3 or 5x5
5
Operation:
Filtered
Image
w(i,j)
f(i,j)
g(i,j)
A filtered image is generated as the center of the mask moves to
every pixel in the input image.
6
Spatial filtering - Operation
output image
Example: weighted sum of input pixels.
mask
weights:
7
Handling Pixels Close to Boundaries
Pad With Zeroes
or
0 0 0 ……………………….0
000……………………….0
8
Linear vs Non-Linear
Spatial Filtering Methods
 A filtering method is linear when the output is a weighted sum
of the input pixels.
 Methods that do not satisfy the above property are called
non-linear.
 e.g.,
9
Spatial Filters
 We will mainly focus on two types of filters:
 Smoothing (low-pass)
 Sharpening (high-pass)
10
Smoothing Filters (low-pass)
 Useful for reducing noise and eliminating
small details.
 The elements of the mask must be positive.
 Sum of mask elements is 1 (after normalization).
Gaussian
11
Smoothing filters – Example
Smoothed ImageInput Image
12
Sharpening Filters (high-pass)
 Useful for highlighting fine details.
 The elements of the mask contain both positive
and negative weights.
 Sum of mask elements is 0.
1st derivative
of Gaussian
2nd derivative
of Gaussian
13
Sharpening Filters - Example
 Warning: the results of sharpening might contain negative
values (i.e., re-map them to [0, 255])
Sharpened ImageInput Image
(for better visualization, the original
image is added to the sharpened image)
14
Common Smoothing Filters
 Averaging
 Gaussian
 Median filtering (non-linear)
15
Smoothing Filters: Averaging
Un-weighted
16
3 3 0 1 1
4 5 4 0 2
2
3 4 0 1
1
5 6 7 1
1 0 2 3 5
4 5 6 7 0
1 1 1
1 1 1
1 1 1Input Image
Mask
Smoothing Filters: Averaging
(cont’d)
 Mask size determines the degree of smoothing (loss of detail).
3x3 5x5 7x7
15x15 25x25
original
17
Image Smoothing
18
Smoothing filters: Gaussian
 The weights are samples of a 2D Gaussian
function:
mask size is
a function of σ:
σ = 1.4
19
Smoothing filters: Gaussian
(cont’d)
• σ controls the amount of smoothing
• As σ increases, more samples must be obtained to represent the Gaussian
function accurately.
σ = 3
20
Smoothing filters: Gaussian
(cont’d)
21
Averaging vs. Gaussian Smoothing
Averaging
Gaussian
22
Smoothing Filters: Median Filtering (cont’d)
 Replace each pixel by the median in a
neighborhood around the pixel.
 The size of the neighborhood controls the
amount of smoothing.
23
Smoothing Filters: Median Filtering
(non-linear)
 Very effective for removing “salt and pepper” noise (i.e., random
occurrences of black and white pixels).
Averaging
Median
Filtering
24
Original Image Image with Noise
Common Sharpening Filters
 Unsharp masking
 High Boost filter
 Gradient (1st derivative)
 Laplacian (2nd derivative)
25
Sharpening Filters: Un sharp Masking
 Obtain a sharp image by subtracting a low
pass filtered (i.e., smoothed) image from the
original image:
- =
(after contrast
enhancement)
26
Sharpening Filters: High Boost
 Image sharpening emphasizes edges but
details are lost.
 High boost filter: Amplify input image, then
subtract a Low pass image.
(A-1) + =
27
Sharpening Filters: High Boost (cont’d)
 If A=1, we get unsharp masking.
 If A>1, part of the original image is added
back to the high pass filtered image.
One way to implement
high boost filtering is using
the masks below
High boost
28
Sharpening Filters: High Boost (cont’d)
A=1.4 A=1.9
29
Sharpening Filters: Derivatives
 Taking the derivative of an image results in
sharpening the image.
 The derivative of an image (i.e., 2D function)
can be computed using the gradient.
30
How do we choose the mask weights?
 Typically, by sampling certain functions:
Gaussian
1st derivative
of Gaussian
2nd derivative
of Gaussian
31
First and Second Derivative
32
Gradient (cont’d)
 Gradient magnitude: provides information
about edge strength.
 Gradient direction: perpendicular to the
direction of the edge.
33
Derivative Results and Laplacian:
34
Reminder: Assignment
Online Submission Due Date 10 Oct 2018
1. Comments on Role of Digital Image Processing in
Modern Imaging Based Medical Treatments.
2. Explain your view on Importance of Image
Understanding in Recent Computer Vision Applications
Assignment Submission link is available at kalyan5.blogspot.in
OR
You can directly visit at http://bit.do/dipr_jnu
35
Any Questions?
Thank You
36
1 de 36

Recomendados

Image Processing: Spatial filters por
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filtersA B Shinde
7.8K visualizações36 slides
Image Enhancement using Frequency Domain Filters por
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
13.9K visualizações34 slides
Unit3 dip por
Unit3 dipUnit3 dip
Unit3 dipImran Khan
13.4K visualizações41 slides
Image processing second unit Notes por
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
3.9K visualizações18 slides
Image Enhancement in Spatial Domain por
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainA B Shinde
5.1K visualizações80 slides
Color image processing Presentation por
Color image processing PresentationColor image processing Presentation
Color image processing PresentationRevanth Chimmani
17.9K visualizações71 slides

Mais conteúdo relacionado

Mais procurados

Image Enhancement in Spatial Domain por
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
50.3K visualizações24 slides
Image Restoration por
Image RestorationImage Restoration
Image RestorationPoonam Seth
7.7K visualizações47 slides
Image Filtering in the Frequency Domain por
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency DomainAmnaakhaan
9.2K visualizações58 slides
Smoothing Filters in Spatial Domain por
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
28.7K visualizações26 slides
Image Smoothing using Frequency Domain Filters por
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersSuhaila Afzana
20.9K visualizações25 slides
5. gray level transformation por
5. gray level transformation5. gray level transformation
5. gray level transformationMdFazleRabbi18
2.8K visualizações13 slides

Mais procurados(20)

Image Enhancement in Spatial Domain por DEEPASHRI HK
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
DEEPASHRI HK50.3K visualizações
Image Restoration por Poonam Seth
Image RestorationImage Restoration
Image Restoration
Poonam Seth7.7K visualizações
Image Filtering in the Frequency Domain por Amnaakhaan
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
Amnaakhaan9.2K visualizações
Smoothing Filters in Spatial Domain por Madhu Bala
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
Madhu Bala28.7K visualizações
Image Smoothing using Frequency Domain Filters por Suhaila Afzana
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain Filters
Suhaila Afzana20.9K visualizações
5. gray level transformation por MdFazleRabbi18
5. gray level transformation5. gray level transformation
5. gray level transformation
MdFazleRabbi182.8K visualizações
Enhancement in spatial domain por Ashish Kumar
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domain
Ashish Kumar34.6K visualizações
Noise Models por Sardar Alam
Noise ModelsNoise Models
Noise Models
Sardar Alam60.8K visualizações
Image enhancement por Ayaelshiwi
Image enhancementImage enhancement
Image enhancement
Ayaelshiwi39.5K visualizações
Digital Image restoration por Md Shabir Alam
Digital Image restorationDigital Image restoration
Digital Image restoration
Md Shabir Alam774 visualizações
06 spatial filtering DIP por babak danyal
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
babak danyal12.2K visualizações
Interpixel redundancy por Naveen Kumar
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
Naveen Kumar20.1K visualizações
Chapter 9 morphological image processing por Ahmed Daoud
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
Ahmed Daoud32.2K visualizações
Spatial domain and filtering por University of Potsdam
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
University of Potsdam7.7K visualizações
Edge Detection and Segmentation por A B Shinde
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
A B Shinde12.2K visualizações
08 frequency domain filtering DIP por babak danyal
08 frequency domain filtering DIP08 frequency domain filtering DIP
08 frequency domain filtering DIP
babak danyal11.2K visualizações
Image degradation and noise by Md.Naseem Ashraf por MD Naseem Ashraf
Image degradation and noise by Md.Naseem AshrafImage degradation and noise by Md.Naseem Ashraf
Image degradation and noise by Md.Naseem Ashraf
MD Naseem Ashraf24.1K visualizações
Digital image processing por ABIRAMI M
Digital image processingDigital image processing
Digital image processing
ABIRAMI M4.7K visualizações

Similar a Spatial Filters (Digital Image Processing)

Spatial filtering por
Spatial filteringSpatial filtering
Spatial filteringSanyam Agarwal
44.9K visualizações47 slides
Spatial filtering por
Spatial filteringSpatial filtering
Spatial filteringDeepikaT13
340 visualizações40 slides
2. filtering basics por
2. filtering basics2. filtering basics
2. filtering basicsAtul Kumar Jha
298 visualizações83 slides
Digital image processing - Image Enhancement (MATERIAL) por
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)Mathankumar S
1.5K visualizações42 slides
Digital Image Processing - Image Enhancement por
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image EnhancementMathankumar S
23.2K visualizações42 slides
Adaptive unsharp masking por
Adaptive unsharp maskingAdaptive unsharp masking
Adaptive unsharp maskingRavi Teja
5K visualizações20 slides

Similar a Spatial Filters (Digital Image Processing)(20)

Spatial filtering por Sanyam Agarwal
Spatial filteringSpatial filtering
Spatial filtering
Sanyam Agarwal44.9K visualizações
Spatial filtering por DeepikaT13
Spatial filteringSpatial filtering
Spatial filtering
DeepikaT13340 visualizações
2. filtering basics por Atul Kumar Jha
2. filtering basics2. filtering basics
2. filtering basics
Atul Kumar Jha298 visualizações
Digital image processing - Image Enhancement (MATERIAL) por Mathankumar S
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
Mathankumar S1.5K visualizações
Digital Image Processing - Image Enhancement por Mathankumar S
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
Mathankumar S23.2K visualizações
Adaptive unsharp masking por Ravi Teja
Adaptive unsharp maskingAdaptive unsharp masking
Adaptive unsharp masking
Ravi Teja5K visualizações
Visual Quality for both Images and Display of Systems by Visual Enhancement u... por IJMER
Visual Quality for both Images and Display of Systems by Visual Enhancement u...Visual Quality for both Images and Display of Systems by Visual Enhancement u...
Visual Quality for both Images and Display of Systems by Visual Enhancement u...
IJMER422 visualizações
Lecture 5-2023.pdf por ssuserff72e4
Lecture 5-2023.pdfLecture 5-2023.pdf
Lecture 5-2023.pdf
ssuserff72e43 visualizações
Spatial filtering por shabanam tamboli
Spatial filteringSpatial filtering
Spatial filtering
shabanam tamboli580 visualizações
Designed by Identity MLP por butest
Designed by Identity MLP Designed by Identity MLP
Designed by Identity MLP
butest274 visualizações
Image enhancement lecture por ISRAR HUSSAIN
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
ISRAR HUSSAIN457 visualizações
Lecture_Spatial_Filters.pptx por mahirazainab
Lecture_Spatial_Filters.pptxLecture_Spatial_Filters.pptx
Lecture_Spatial_Filters.pptx
mahirazainab6 visualizações
Project 2-Image_Processng by Anish Hemmady por anish h
Project 2-Image_Processng by Anish HemmadyProject 2-Image_Processng by Anish Hemmady
Project 2-Image_Processng by Anish Hemmady
anish h217 visualizações
Image_filtering (1).pptx por wdwd10
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptx
wdwd102 visualizações
Image enhancement ppt nal2 por Surabhi Ks
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
Surabhi Ks21.1K visualizações
4 image enhancement in spatial domain por Prof. Dr. Subhasis Bose
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
Prof. Dr. Subhasis Bose132 visualizações
CE344L-200365-Lab6.pdf por UmarMustafa13
CE344L-200365-Lab6.pdfCE344L-200365-Lab6.pdf
CE344L-200365-Lab6.pdf
UmarMustafa134 visualizações
机器学习Adaboost por Shocky1
机器学习Adaboost机器学习Adaboost
机器学习Adaboost
Shocky150 visualizações
Image enhancement techniques por Bulbul Agrawal
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
Bulbul Agrawal893 visualizações
Introduction To Advanced Image Processing por Suren Kumar
Introduction To Advanced Image ProcessingIntroduction To Advanced Image Processing
Introduction To Advanced Image Processing
Suren Kumar1.8K visualizações

Mais de Kalyan Acharjya

Introduction to Image Compression por
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image CompressionKalyan Acharjya
9.4K visualizações39 slides
Introduction to Image Compression por
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image CompressionKalyan Acharjya
994 visualizações39 slides
Image Restoration (Frequency Domain Filters):Basics por
Image Restoration (Frequency Domain Filters):BasicsImage Restoration (Frequency Domain Filters):Basics
Image Restoration (Frequency Domain Filters):BasicsKalyan Acharjya
4.8K visualizações34 slides
Image Restoration (Order Statistics Filters) por
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)Kalyan Acharjya
7.7K visualizações24 slides
Histogram Specification or Matching Problem por
Histogram Specification or Matching ProblemHistogram Specification or Matching Problem
Histogram Specification or Matching ProblemKalyan Acharjya
6.7K visualizações6 slides
Histogram Equalization por
Histogram EqualizationHistogram Equalization
Histogram EqualizationKalyan Acharjya
10.5K visualizações15 slides

Mais de Kalyan Acharjya(20)

Introduction to Image Compression por Kalyan Acharjya
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
Kalyan Acharjya9.4K visualizações
Introduction to Image Compression por Kalyan Acharjya
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
Kalyan Acharjya994 visualizações
Image Restoration (Frequency Domain Filters):Basics por Kalyan Acharjya
Image Restoration (Frequency Domain Filters):BasicsImage Restoration (Frequency Domain Filters):Basics
Image Restoration (Frequency Domain Filters):Basics
Kalyan Acharjya4.8K visualizações
Image Restoration (Order Statistics Filters) por Kalyan Acharjya
Image Restoration (Order Statistics Filters)Image Restoration (Order Statistics Filters)
Image Restoration (Order Statistics Filters)
Kalyan Acharjya7.7K visualizações
Histogram Specification or Matching Problem por Kalyan Acharjya
Histogram Specification or Matching ProblemHistogram Specification or Matching Problem
Histogram Specification or Matching Problem
Kalyan Acharjya6.7K visualizações
Histogram Equalization por Kalyan Acharjya
Histogram EqualizationHistogram Equalization
Histogram Equalization
Kalyan Acharjya10.5K visualizações
Digital Image Fundamentals por Kalyan Acharjya
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
Kalyan Acharjya1.1K visualizações
Fundamental Steps of Digital Image Processing & Image Components por Kalyan Acharjya
Fundamental Steps of Digital Image Processing & Image ComponentsFundamental Steps of Digital Image Processing & Image Components
Fundamental Steps of Digital Image Processing & Image Components
Kalyan Acharjya9.6K visualizações
Introduction to Image Processing:Image Modalities por Kalyan Acharjya
Introduction to Image Processing:Image ModalitiesIntroduction to Image Processing:Image Modalities
Introduction to Image Processing:Image Modalities
Kalyan Acharjya768 visualizações
Electron Microscopy (SEM & TEM) por Kalyan Acharjya
Electron Microscopy (SEM & TEM)Electron Microscopy (SEM & TEM)
Electron Microscopy (SEM & TEM)
Kalyan Acharjya37.4K visualizações
Stick Diagram por Kalyan Acharjya
Stick DiagramStick Diagram
Stick Diagram
Kalyan Acharjya28.3K visualizações
Hypothesis Testing por Kalyan Acharjya
Hypothesis TestingHypothesis Testing
Hypothesis Testing
Kalyan Acharjya8.6K visualizações
Photodetector (Photodiode) por Kalyan Acharjya
Photodetector (Photodiode)Photodetector (Photodiode)
Photodetector (Photodiode)
Kalyan Acharjya16.5K visualizações
Fiber fabrication por Kalyan Acharjya
Fiber fabricationFiber fabrication
Fiber fabrication
Kalyan Acharjya4.5K visualizações
Fiber End Preparations & Splicing por Kalyan Acharjya
Fiber End Preparations & SplicingFiber End Preparations & Splicing
Fiber End Preparations & Splicing
Kalyan Acharjya2.7K visualizações
Connector losses Optical Fiber Cable por Kalyan Acharjya
Connector losses Optical Fiber CableConnector losses Optical Fiber Cable
Connector losses Optical Fiber Cable
Kalyan Acharjya10.4K visualizações
Introduction to VLSI Design por Kalyan Acharjya
Introduction to VLSI DesignIntroduction to VLSI Design
Introduction to VLSI Design
Kalyan Acharjya19.7K visualizações
Guidlines for ppt Design por Kalyan Acharjya
Guidlines for ppt DesignGuidlines for ppt Design
Guidlines for ppt Design
Kalyan Acharjya223 visualizações
B.Tech Seminar schedule dates 8 EC B2 2016 por Kalyan Acharjya
B.Tech Seminar schedule dates 8 EC B2 2016B.Tech Seminar schedule dates 8 EC B2 2016
B.Tech Seminar schedule dates 8 EC B2 2016
Kalyan Acharjya230 visualizações
Face recognition Face Identification por Kalyan Acharjya
Face recognition Face IdentificationFace recognition Face Identification
Face recognition Face Identification
Kalyan Acharjya3.3K visualizações

Último

PRELIMS ANSWER.pptx por
PRELIMS ANSWER.pptxPRELIMS ANSWER.pptx
PRELIMS ANSWER.pptxsouravkrpodder
50 visualizações60 slides
The Future of Micro-credentials: Is Small Really Beautiful? por
The Future of Micro-credentials:  Is Small Really Beautiful?The Future of Micro-credentials:  Is Small Really Beautiful?
The Future of Micro-credentials: Is Small Really Beautiful?Mark Brown
102 visualizações35 slides
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 por
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37MysoreMuleSoftMeetup
54 visualizações17 slides
Mineral nutrition and Fertilizer use of Cashew por
 Mineral nutrition and Fertilizer use of Cashew Mineral nutrition and Fertilizer use of Cashew
Mineral nutrition and Fertilizer use of CashewAruna Srikantha Jayawardana
58 visualizações107 slides
Thanksgiving!.pdf por
Thanksgiving!.pdfThanksgiving!.pdf
Thanksgiving!.pdfEnglishCEIPdeSigeiro
568 visualizações17 slides
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating... por
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Taste
38 visualizações34 slides

Último(20)

PRELIMS ANSWER.pptx por souravkrpodder
PRELIMS ANSWER.pptxPRELIMS ANSWER.pptx
PRELIMS ANSWER.pptx
souravkrpodder50 visualizações
The Future of Micro-credentials: Is Small Really Beautiful? por Mark Brown
The Future of Micro-credentials:  Is Small Really Beautiful?The Future of Micro-credentials:  Is Small Really Beautiful?
The Future of Micro-credentials: Is Small Really Beautiful?
Mark Brown102 visualizações
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 por MysoreMuleSoftMeetup
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
MysoreMuleSoftMeetup54 visualizações
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating... por Taste
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Taste38 visualizações
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx por Niranjan Chavan
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptxGuidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Niranjan Chavan42 visualizações
JRN 362 - Lecture Twenty-Two por Rich Hanley
JRN 362 - Lecture Twenty-TwoJRN 362 - Lecture Twenty-Two
JRN 362 - Lecture Twenty-Two
Rich Hanley39 visualizações
Education of marginalized and socially disadvantages segments.pptx por GarimaBhati5
Education of marginalized and socially disadvantages segments.pptxEducation of marginalized and socially disadvantages segments.pptx
Education of marginalized and socially disadvantages segments.pptx
GarimaBhati547 visualizações
ICS3211_lecture 09_2023.pdf por Vanessa Camilleri
ICS3211_lecture 09_2023.pdfICS3211_lecture 09_2023.pdf
ICS3211_lecture 09_2023.pdf
Vanessa Camilleri147 visualizações
What is Digital Transformation? por Mark Brown
What is Digital Transformation?What is Digital Transformation?
What is Digital Transformation?
Mark Brown41 visualizações
Volf work.pdf por MariaKenney3
Volf work.pdfVolf work.pdf
Volf work.pdf
MariaKenney390 visualizações
BUSINESS ETHICS MODULE 1 UNIT I_B.pdf por Dr Vijay Vishwakarma
BUSINESS ETHICS MODULE 1 UNIT I_B.pdfBUSINESS ETHICS MODULE 1 UNIT I_B.pdf
BUSINESS ETHICS MODULE 1 UNIT I_B.pdf
Dr Vijay Vishwakarma52 visualizações
JQUERY.pdf por ArthyR3
JQUERY.pdfJQUERY.pdf
JQUERY.pdf
ArthyR3107 visualizações
12.5.23 Poverty and Precarity.pptx por mary850239
12.5.23 Poverty and Precarity.pptx12.5.23 Poverty and Precarity.pptx
12.5.23 Poverty and Precarity.pptx
mary850239514 visualizações
Interaction of microorganisms with vascular plants.pptx por MicrobiologyMicro
Interaction of microorganisms with vascular plants.pptxInteraction of microorganisms with vascular plants.pptx
Interaction of microorganisms with vascular plants.pptx
MicrobiologyMicro58 visualizações
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption... por BC Chew
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
BC Chew38 visualizações
BUSINESS ETHICS MODULE 1 UNIT I_A.pdf por Dr Vijay Vishwakarma
BUSINESS ETHICS MODULE 1 UNIT I_A.pdfBUSINESS ETHICS MODULE 1 UNIT I_A.pdf
BUSINESS ETHICS MODULE 1 UNIT I_A.pdf
Dr Vijay Vishwakarma92 visualizações
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab... por RAHUL PAL
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...
Research Methodology (M. Pharm, IIIrd Sem.)_UNIT_IV_CPCSEA Guidelines for Lab...
RAHUL PAL43 visualizações
Meet the Bible por Steve Thomason
Meet the BibleMeet the Bible
Meet the Bible
Steve Thomason81 visualizações

Spatial Filters (Digital Image Processing)

  • 1. Unit 3-Image Enhancement Spatial Filters Lecture By Kalyan Acharjya kalyan5.blogspot.in Lecture No 14 1
  • 2. Disclaimer  This PPT contents are copied from various publicly available sources and all images are copyright of the respective original owner.  This is used for academic purpose only. 2
  • 3. Spatial Filtering Methods (or Mask Processing Methods) output image 3
  • 4. Spatial Filtering (cont’d)  Filters are classified as:  Low-pass (i.e., preserve low frequencies)  High-pass (i.e., preserve high frequencies)  Band-pass (i.e., preserve frequencies within a band)  Band-reject (i.e., reject frequencies within a band) 4
  • 5. Spatial Filtering (cont’d)  Need to define:  A neighborhood (or mask)  An Mask Operation •Typically, the neighborhood is rectangular and its size is much smaller than that of f(x,y) - e.g., 3x3 or 5x5 5
  • 6. Operation: Filtered Image w(i,j) f(i,j) g(i,j) A filtered image is generated as the center of the mask moves to every pixel in the input image. 6
  • 7. Spatial filtering - Operation output image Example: weighted sum of input pixels. mask weights: 7
  • 8. Handling Pixels Close to Boundaries Pad With Zeroes or 0 0 0 ……………………….0 000……………………….0 8
  • 9. Linear vs Non-Linear Spatial Filtering Methods  A filtering method is linear when the output is a weighted sum of the input pixels.  Methods that do not satisfy the above property are called non-linear.  e.g., 9
  • 10. Spatial Filters  We will mainly focus on two types of filters:  Smoothing (low-pass)  Sharpening (high-pass) 10
  • 11. Smoothing Filters (low-pass)  Useful for reducing noise and eliminating small details.  The elements of the mask must be positive.  Sum of mask elements is 1 (after normalization). Gaussian 11
  • 12. Smoothing filters – Example Smoothed ImageInput Image 12
  • 13. Sharpening Filters (high-pass)  Useful for highlighting fine details.  The elements of the mask contain both positive and negative weights.  Sum of mask elements is 0. 1st derivative of Gaussian 2nd derivative of Gaussian 13
  • 14. Sharpening Filters - Example  Warning: the results of sharpening might contain negative values (i.e., re-map them to [0, 255]) Sharpened ImageInput Image (for better visualization, the original image is added to the sharpened image) 14
  • 15. Common Smoothing Filters  Averaging  Gaussian  Median filtering (non-linear) 15
  • 16. Smoothing Filters: Averaging Un-weighted 16 3 3 0 1 1 4 5 4 0 2 2 3 4 0 1 1 5 6 7 1 1 0 2 3 5 4 5 6 7 0 1 1 1 1 1 1 1 1 1Input Image Mask
  • 17. Smoothing Filters: Averaging (cont’d)  Mask size determines the degree of smoothing (loss of detail). 3x3 5x5 7x7 15x15 25x25 original 17
  • 19. Smoothing filters: Gaussian  The weights are samples of a 2D Gaussian function: mask size is a function of σ: σ = 1.4 19
  • 20. Smoothing filters: Gaussian (cont’d) • σ controls the amount of smoothing • As σ increases, more samples must be obtained to represent the Gaussian function accurately. σ = 3 20
  • 22. Averaging vs. Gaussian Smoothing Averaging Gaussian 22
  • 23. Smoothing Filters: Median Filtering (cont’d)  Replace each pixel by the median in a neighborhood around the pixel.  The size of the neighborhood controls the amount of smoothing. 23
  • 24. Smoothing Filters: Median Filtering (non-linear)  Very effective for removing “salt and pepper” noise (i.e., random occurrences of black and white pixels). Averaging Median Filtering 24 Original Image Image with Noise
  • 25. Common Sharpening Filters  Unsharp masking  High Boost filter  Gradient (1st derivative)  Laplacian (2nd derivative) 25
  • 26. Sharpening Filters: Un sharp Masking  Obtain a sharp image by subtracting a low pass filtered (i.e., smoothed) image from the original image: - = (after contrast enhancement) 26
  • 27. Sharpening Filters: High Boost  Image sharpening emphasizes edges but details are lost.  High boost filter: Amplify input image, then subtract a Low pass image. (A-1) + = 27
  • 28. Sharpening Filters: High Boost (cont’d)  If A=1, we get unsharp masking.  If A>1, part of the original image is added back to the high pass filtered image. One way to implement high boost filtering is using the masks below High boost 28
  • 29. Sharpening Filters: High Boost (cont’d) A=1.4 A=1.9 29
  • 30. Sharpening Filters: Derivatives  Taking the derivative of an image results in sharpening the image.  The derivative of an image (i.e., 2D function) can be computed using the gradient. 30
  • 31. How do we choose the mask weights?  Typically, by sampling certain functions: Gaussian 1st derivative of Gaussian 2nd derivative of Gaussian 31
  • 32. First and Second Derivative 32
  • 33. Gradient (cont’d)  Gradient magnitude: provides information about edge strength.  Gradient direction: perpendicular to the direction of the edge. 33
  • 34. Derivative Results and Laplacian: 34
  • 35. Reminder: Assignment Online Submission Due Date 10 Oct 2018 1. Comments on Role of Digital Image Processing in Modern Imaging Based Medical Treatments. 2. Explain your view on Importance of Image Understanding in Recent Computer Vision Applications Assignment Submission link is available at kalyan5.blogspot.in OR You can directly visit at http://bit.do/dipr_jnu 35