SlideShare une entreprise Scribd logo
1  sur  37
Spatial Filtering : 1
Spatial FilteringSpatial Filtering
Spatial Filtering : 2
Basics of Spatial FilteringBasics of Spatial Filtering
Image enhancement operations can also work with the values of
the image pixels in the neighborhood and the corresponding values
of a subimage that has the same dimensions as the neighborhood.
The subimage is called a filter, mask, kernel, template, or window.
The values in a filter subimage are referred to as coefficients, rather
than pixels.
The process consists simply of moving the filter mask from point to
point in an image.
For linear spatial filtering, the response is given by a sum of
products of the filter coefficients and the corresponding image
pixels in the area spanned by the filter mask
Spatial Filtering : 3
Linear Spatial FilterLinear Spatial Filter
Spatial Filtering : 4
Linear Spatial Filter (Cont.)Linear Spatial Filter (Cont.)
The result (or response), R, of linear filtering with the filter mask at
a point (x, y) in the image is:
In general, linear filtering of an image f of size M X N with a filter
mask of size m X n is given by the expression:
( 1, 1) ( 1, 1) ( 1,0) ( 1, )
(0,0) ( , ) (1,0) ( 1, ) (1,1) ( 1, 1)
R w f x y w f x y
w f x y w f x y w f x y
= − − − − + − − +
+ + + + + + +
L
L
( 1)/2 ( 1)/2
( 1)/2 ( 1)/2
( , ) ( , ) ( , )
m n
s m t n
g x y w s t f x s y t
− −
=− − =− −
= + +∑ ∑
Spatial Filtering : 5
Linear Spatial Filter (Cont.)Linear Spatial Filter (Cont.)
When interest lies on the response, R, of an m X n mask at any
point (x, y), and not on the mechanics of implementing mask
convolution
1 1 2 2
1
mn mn
mn
i i
i
R w z w z w z
w z
=
= + + +
= ∑
L
Spatial Filtering : 6
Linear Spatial Filter (Cont.)Linear Spatial Filter (Cont.)
1 1 2 2 9 9
9
1
i i
i
R w z w z w z
w z
=
= + + +
= ∑
L
Spatial Filtering : 7
Noise reduction by Spatial FilteringNoise reduction by Spatial Filtering
Image averaging takes advantage of information redundancy from
the individual images to reduce noise
Not always possible to acquire so many images!
Alternative option: Take advantage of information redundancy from
different pixels within the same image to reduce noise
Spatial Filtering : 8
Averaging FilterAveraging Filter
Instead of averaging between images, we can average neighboring pixels
9
1
1
9
i
i
R z
=
= ∑
Spatial Filtering : 9
Averaging FilterAveraging Filter
Spatial Filtering : 10
Weighted Average FilterWeighted Average Filter
Problem: Simple averaging of neighboring pixels lead to
over-smoothing
Possible solution: Instead of weighting all neighboring pixels
equally, assign higher weights to pixels that are closer to the
pixel being convolved
Spatial Filtering : 11
Weighted Average FilterWeighted Average Filter
Spatial Filtering : 12
Weighted Averaging Filter:Weighted Averaging Filter:
ExampleExample
Spatial Filtering : 13
Weighted Averaging Filter:Weighted Averaging Filter:
ExampleExample
Spatial Filtering : 14
Order-Statistic FiltersOrder-Statistic Filters
Nonlinear spatial filters
Steps
Order pixels within an area
Replace value of center pixel with value determined by ordering
Best known example: median filters
( ) ( ) ( )H af bg aH f bH g+ ≠ +
Spatial Filtering : 15
Median FilterMedian Filter
Provides good noise reduction for certain types of noise such as
impulse noise
Considerably less blurring than weighted averaging filter
Forces a pixel to be like its neighbors
Steps
Order pixels within an area
Replace value of center pixel with median value (half of all
pixels have intensities greater than or equal to the median
value)
Spatial Filtering : 16
Median Filter: ExampleMedian Filter: Example
Spatial Filtering : 17
Median Filter: ExampleMedian Filter: Example
Spatial Filtering : 18
Spatial Filtering: SharpeningSpatial Filtering: Sharpening
Goal: highlight or enhance details in images
Some applications:
Photo enhancement
Medical image visualization
Industrial defect detection
Spatial Filtering : 19
Sharpening Spatial FilteringSharpening Spatial Filtering
Goal: highlight or enhance details in images
Some applications:
Photo enhancement
Medical image visualization
Industrial defect detection
Basic principle:
Averaging (blurring) is analogous to integration
Therefore, logically, sharpening accomplished by differentiation
Spatial Filtering : 20
Derivatives of digital functionDerivatives of digital function
First-order derivative
Second-order derivative
( 1) ( )
f
f x f x
x
∂
= + −
∂
2
2
( 1) ( 1) 2 ( )
f
f x f x f x
x
∂
= + + − −
∂
Spatial Filtering : 21
Derivatives of digital functionDerivatives of digital function
First-order derivatives generally produce thicker edges
Second-order derivatives have stronger response to fine detail
(e.g., thin lines and points)
First-order derivatives have stronger response to step changes
Second-order derivatives produce double response at step
changes
Spatial Filtering : 22
Derivatives of digital function:Derivatives of digital function:
ExampleExample
Spatial Filtering : 23
Derivatives of digital function:Derivatives of digital function:
ExampleExample
Spatial Filtering : 24
Sharpening using LaplacianSharpening using Laplacian
Second-order derivatives is better suited for most applications for
sharpening
How?
By constructing a filter based on discrete formulation of second-
order derivatives
Simplest isotropic derivative operator: Laplacian
2 2
2
2 2
f f
f
x y
∂ ∂
∇ = +
∂ ∂
Spatial Filtering : 25
How to create Laplacian filterHow to create Laplacian filter
2 2
2
2 2
f f
f
x y
∂ ∂
∇ = +
∂ ∂
2
2
( 1, ) ( 1, ) 2 ( , )
f
f x y f x y f x y
x
∂
= + + − −
∂
2
2
( , 1) ( , 1) 2 ( , )
f
f x y f x y f x y
y
∂
= + + − −
∂
[ ]2
( 1, ) ( 1, ) ( , 1) ( , 1) 4 ( , )f f x y f x y f x y f x y f x y∇ = + + − + + + − −
Spatial Filtering : 26
Laplacian FilterLaplacian Filter
Spatial Filtering : 27
Sharpening using LaplacianSharpening using Laplacian
Problem: While applying Laplacian highlights fine detail, it
de-emphasizes smooth regions (e.g., background features)
Results in featureless background with grayish fine details
Solution: Add original image to recover background
features
2
2
( , ) ( , ), negative filter center
( , )
( , ) ( , ), positive filter center
f x y f x y
g x y
f x y f x y
 −∇
= 
+∇
Spatial Filtering : 28
ExampleExample
Spatial Filtering : 29
Sharpening using Unsharp MaskingSharpening using Unsharp Masking
Subtract blurred version of image from the
image itself to produce sharp image
( , ) ( , ) ( , )g x y f x y f x y= −
Spatial Filtering : 30
ExampleExample
Spatial Filtering : 31
Sharpening using High-boostSharpening using High-boost
FilteringFiltering
Generalization of unsharp masking
As A increases, contribution of sharpening decreases
( , ) ( , ) ( , )g x y Af x y f x y= −
Spatial Filtering : 32
Sharpening using High-boostSharpening using High-boost
FilteringFiltering
Spatial Filtering : 33
Example
Spatial Filtering : 34
First Derivatives for EnhancementFirst Derivatives for Enhancement
Implemented as magnitude of gradient in image processing
f
x
f
f
y
∂ 
 ∂
 ∇ =
∂ 
 ∂ 
1/222
f f
f
x y
  ∂ ∂ 
∇ = +  ÷ ÷
∂ ∂    
Spatial Filtering : 35
ImplementationImplementation
Problem: Expensive to implement directly
Solution: Approximate using absolute values
Can be implemented using two 2x2 filters
Even filters difficult to implement, so 3x3 filters are used for
approximation
9 5 8 6f z z z z∇ ≈ − + −
7 8 9 1 2 3
3 6 9 1 4 7
( 2 ) ( 2 )
( 2 ) ( 2 )
f z z z z z z
z z z z z z
∇ ≈ + + − + +
+ + + − + +
Spatial Filtering : 36
Gradient MasksGradient Masks
Spatial Filtering : 37
Example: Defect DetectionExample: Defect Detection

Contenu connexe

Tendances

Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainMalik obeisat
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainA B Shinde
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2Gichelle Amon
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersSuhaila Afzana
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
 
08 frequency domain filtering DIP
08 frequency domain filtering DIP08 frequency domain filtering DIP
08 frequency domain filtering DIPbabak danyal
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothningVinay Gupta
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGmuthu181188
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processingAnuj Arora
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersKuppusamy P
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image EnhancementMathankumar S
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processingAbinaya B
 
Image enhancement
Image enhancementImage enhancement
Image enhancementAyaelshiwi
 
Advance image processing
Advance image processingAdvance image processing
Advance image processingAAKANKSHA JAIN
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filterarulraj121
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restorationMd Shabir Alam
 

Tendances (20)

Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domain
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2
 
Image Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain FiltersImage Smoothing using Frequency Domain Filters
Image Smoothing using Frequency Domain Filters
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
08 frequency domain filtering DIP
08 frequency domain filtering DIP08 frequency domain filtering DIP
08 frequency domain filtering DIP
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothning
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 
Image processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filtersImage processing, Noise, Noise Removal filters
Image processing, Noise, Noise Removal filters
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Advance image processing
Advance image processingAdvance image processing
Advance image processing
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 

En vedette

Pertemuan 3 - Digital Image Processing - Spatial Filtering - Citra Digital
Pertemuan 3 - Digital Image Processing - Spatial Filtering - Citra DigitalPertemuan 3 - Digital Image Processing - Spatial Filtering - Citra Digital
Pertemuan 3 - Digital Image Processing - Spatial Filtering - Citra Digitalahmad haidaroh
 
Pertemuan 1 - Introduction - Citra Digital
Pertemuan 1 - Introduction - Citra DigitalPertemuan 1 - Introduction - Citra Digital
Pertemuan 1 - Introduction - Citra Digitalahmad haidaroh
 
5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1Gichelle Amon
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniquessakshij91
 
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...Hemantha Kulathilake
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniquesSaideep
 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domainAshish Kumar
 

En vedette (10)

Pertemuan 3 - Digital Image Processing - Spatial Filtering - Citra Digital
Pertemuan 3 - Digital Image Processing - Spatial Filtering - Citra DigitalPertemuan 3 - Digital Image Processing - Spatial Filtering - Citra Digital
Pertemuan 3 - Digital Image Processing - Spatial Filtering - Citra Digital
 
Pertemuan 1 - Introduction - Citra Digital
Pertemuan 1 - Introduction - Citra DigitalPertemuan 1 - Introduction - Citra Digital
Pertemuan 1 - Introduction - Citra Digital
 
5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1
 
Unit3 dip
Unit3 dipUnit3 dip
Unit3 dip
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
Enhancement in spatial domain
Enhancement in spatial domainEnhancement in spatial domain
Enhancement in spatial domain
 

Similaire à 06 spatial filtering DIP

CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureFatmaNewagy1
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)Mathankumar S
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptxwdwd10
 
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
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfilteringJohn Williams
 
Spatial Domain Filtering.pdf
Spatial Domain Filtering.pdfSpatial Domain Filtering.pdf
Spatial Domain Filtering.pdfswagatkarve
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfnagwaAboElenein
 
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehrDIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehrstudyd133
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filteringDeepikaT13
 
13 fourierfiltrationen
13 fourierfiltrationen13 fourierfiltrationen
13 fourierfiltrationenhoailinhtinh
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portionMoe Moe Myint
 
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...Norishige Fukushima
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionIOSR Journals
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionIOSR Journals
 

Similaire à 06 spatial filtering DIP (20)

CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lecture
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptx
 
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
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfiltering
 
Spatial Domain Filtering.pdf
Spatial Domain Filtering.pdfSpatial Domain Filtering.pdf
Spatial Domain Filtering.pdf
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdf
 
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehrDIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
13 fourierfiltrationen
13 fourierfiltrationen13 fourierfiltrationen
13 fourierfiltrationen
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
 
M.sc. m hassan
M.sc. m hassanM.sc. m hassan
M.sc. m hassan
 
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
Non-essentiality of Correlation between Image and Depth Map in Free Viewpoin...
 
Ppt ---image processing
Ppt ---image processingPpt ---image processing
Ppt ---image processing
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window Function
 
Design Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window FunctionDesign Technique of Bandpass FIR filter using Various Window Function
Design Technique of Bandpass FIR filter using Various Window Function
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 

Plus de babak danyal

Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Socketsbabak danyal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streamsbabak danyal
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the desbabak danyal
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network securitybabak danyal
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systemsbabak danyal
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systemsbabak danyal
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systemsbabak danyal
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systemsbabak danyal
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systemsbabak danyal
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systemsbabak danyal
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systemsbabak danyal
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systemsbabak danyal
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signababak danyal
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systemsbabak danyal
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 

Plus de babak danyal (20)

applist
applistapplist
applist
 
Easy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client SocketsEasy Steps to implement UDP Server and Client Sockets
Easy Steps to implement UDP Server and Client Sockets
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Tcp sockets
Tcp socketsTcp sockets
Tcp sockets
 
block ciphers and the des
block ciphers and the desblock ciphers and the des
block ciphers and the des
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Lecture10 Signal and Systems
Lecture10 Signal and SystemsLecture10 Signal and Systems
Lecture10 Signal and Systems
 
Lecture8 Signal and Systems
Lecture8 Signal and SystemsLecture8 Signal and Systems
Lecture8 Signal and Systems
 
Lecture7 Signal and Systems
Lecture7 Signal and SystemsLecture7 Signal and Systems
Lecture7 Signal and Systems
 
Lecture6 Signal and Systems
Lecture6 Signal and SystemsLecture6 Signal and Systems
Lecture6 Signal and Systems
 
Lecture5 Signal and Systems
Lecture5 Signal and SystemsLecture5 Signal and Systems
Lecture5 Signal and Systems
 
Lecture4 Signal and Systems
Lecture4  Signal and SystemsLecture4  Signal and Systems
Lecture4 Signal and Systems
 
Lecture3 Signal and Systems
Lecture3 Signal and SystemsLecture3 Signal and Systems
Lecture3 Signal and Systems
 
Lecture2 Signal and Systems
Lecture2 Signal and SystemsLecture2 Signal and Systems
Lecture2 Signal and Systems
 
Lecture1 Intro To Signa
Lecture1 Intro To SignaLecture1 Intro To Signa
Lecture1 Intro To Signa
 
Lecture9 Signal and Systems
Lecture9 Signal and SystemsLecture9 Signal and Systems
Lecture9 Signal and Systems
 
Lecture9
Lecture9Lecture9
Lecture9
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 

Dernier

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 

Dernier (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

06 spatial filtering DIP

  • 1. Spatial Filtering : 1 Spatial FilteringSpatial Filtering
  • 2. Spatial Filtering : 2 Basics of Spatial FilteringBasics of Spatial Filtering Image enhancement operations can also work with the values of the image pixels in the neighborhood and the corresponding values of a subimage that has the same dimensions as the neighborhood. The subimage is called a filter, mask, kernel, template, or window. The values in a filter subimage are referred to as coefficients, rather than pixels. The process consists simply of moving the filter mask from point to point in an image. For linear spatial filtering, the response is given by a sum of products of the filter coefficients and the corresponding image pixels in the area spanned by the filter mask
  • 3. Spatial Filtering : 3 Linear Spatial FilterLinear Spatial Filter
  • 4. Spatial Filtering : 4 Linear Spatial Filter (Cont.)Linear Spatial Filter (Cont.) The result (or response), R, of linear filtering with the filter mask at a point (x, y) in the image is: In general, linear filtering of an image f of size M X N with a filter mask of size m X n is given by the expression: ( 1, 1) ( 1, 1) ( 1,0) ( 1, ) (0,0) ( , ) (1,0) ( 1, ) (1,1) ( 1, 1) R w f x y w f x y w f x y w f x y w f x y = − − − − + − − + + + + + + + + L L ( 1)/2 ( 1)/2 ( 1)/2 ( 1)/2 ( , ) ( , ) ( , ) m n s m t n g x y w s t f x s y t − − =− − =− − = + +∑ ∑
  • 5. Spatial Filtering : 5 Linear Spatial Filter (Cont.)Linear Spatial Filter (Cont.) When interest lies on the response, R, of an m X n mask at any point (x, y), and not on the mechanics of implementing mask convolution 1 1 2 2 1 mn mn mn i i i R w z w z w z w z = = + + + = ∑ L
  • 6. Spatial Filtering : 6 Linear Spatial Filter (Cont.)Linear Spatial Filter (Cont.) 1 1 2 2 9 9 9 1 i i i R w z w z w z w z = = + + + = ∑ L
  • 7. Spatial Filtering : 7 Noise reduction by Spatial FilteringNoise reduction by Spatial Filtering Image averaging takes advantage of information redundancy from the individual images to reduce noise Not always possible to acquire so many images! Alternative option: Take advantage of information redundancy from different pixels within the same image to reduce noise
  • 8. Spatial Filtering : 8 Averaging FilterAveraging Filter Instead of averaging between images, we can average neighboring pixels 9 1 1 9 i i R z = = ∑
  • 9. Spatial Filtering : 9 Averaging FilterAveraging Filter
  • 10. Spatial Filtering : 10 Weighted Average FilterWeighted Average Filter Problem: Simple averaging of neighboring pixels lead to over-smoothing Possible solution: Instead of weighting all neighboring pixels equally, assign higher weights to pixels that are closer to the pixel being convolved
  • 11. Spatial Filtering : 11 Weighted Average FilterWeighted Average Filter
  • 12. Spatial Filtering : 12 Weighted Averaging Filter:Weighted Averaging Filter: ExampleExample
  • 13. Spatial Filtering : 13 Weighted Averaging Filter:Weighted Averaging Filter: ExampleExample
  • 14. Spatial Filtering : 14 Order-Statistic FiltersOrder-Statistic Filters Nonlinear spatial filters Steps Order pixels within an area Replace value of center pixel with value determined by ordering Best known example: median filters ( ) ( ) ( )H af bg aH f bH g+ ≠ +
  • 15. Spatial Filtering : 15 Median FilterMedian Filter Provides good noise reduction for certain types of noise such as impulse noise Considerably less blurring than weighted averaging filter Forces a pixel to be like its neighbors Steps Order pixels within an area Replace value of center pixel with median value (half of all pixels have intensities greater than or equal to the median value)
  • 16. Spatial Filtering : 16 Median Filter: ExampleMedian Filter: Example
  • 17. Spatial Filtering : 17 Median Filter: ExampleMedian Filter: Example
  • 18. Spatial Filtering : 18 Spatial Filtering: SharpeningSpatial Filtering: Sharpening Goal: highlight or enhance details in images Some applications: Photo enhancement Medical image visualization Industrial defect detection
  • 19. Spatial Filtering : 19 Sharpening Spatial FilteringSharpening Spatial Filtering Goal: highlight or enhance details in images Some applications: Photo enhancement Medical image visualization Industrial defect detection Basic principle: Averaging (blurring) is analogous to integration Therefore, logically, sharpening accomplished by differentiation
  • 20. Spatial Filtering : 20 Derivatives of digital functionDerivatives of digital function First-order derivative Second-order derivative ( 1) ( ) f f x f x x ∂ = + − ∂ 2 2 ( 1) ( 1) 2 ( ) f f x f x f x x ∂ = + + − − ∂
  • 21. Spatial Filtering : 21 Derivatives of digital functionDerivatives of digital function First-order derivatives generally produce thicker edges Second-order derivatives have stronger response to fine detail (e.g., thin lines and points) First-order derivatives have stronger response to step changes Second-order derivatives produce double response at step changes
  • 22. Spatial Filtering : 22 Derivatives of digital function:Derivatives of digital function: ExampleExample
  • 23. Spatial Filtering : 23 Derivatives of digital function:Derivatives of digital function: ExampleExample
  • 24. Spatial Filtering : 24 Sharpening using LaplacianSharpening using Laplacian Second-order derivatives is better suited for most applications for sharpening How? By constructing a filter based on discrete formulation of second- order derivatives Simplest isotropic derivative operator: Laplacian 2 2 2 2 2 f f f x y ∂ ∂ ∇ = + ∂ ∂
  • 25. Spatial Filtering : 25 How to create Laplacian filterHow to create Laplacian filter 2 2 2 2 2 f f f x y ∂ ∂ ∇ = + ∂ ∂ 2 2 ( 1, ) ( 1, ) 2 ( , ) f f x y f x y f x y x ∂ = + + − − ∂ 2 2 ( , 1) ( , 1) 2 ( , ) f f x y f x y f x y y ∂ = + + − − ∂ [ ]2 ( 1, ) ( 1, ) ( , 1) ( , 1) 4 ( , )f f x y f x y f x y f x y f x y∇ = + + − + + + − −
  • 26. Spatial Filtering : 26 Laplacian FilterLaplacian Filter
  • 27. Spatial Filtering : 27 Sharpening using LaplacianSharpening using Laplacian Problem: While applying Laplacian highlights fine detail, it de-emphasizes smooth regions (e.g., background features) Results in featureless background with grayish fine details Solution: Add original image to recover background features 2 2 ( , ) ( , ), negative filter center ( , ) ( , ) ( , ), positive filter center f x y f x y g x y f x y f x y  −∇ =  +∇
  • 28. Spatial Filtering : 28 ExampleExample
  • 29. Spatial Filtering : 29 Sharpening using Unsharp MaskingSharpening using Unsharp Masking Subtract blurred version of image from the image itself to produce sharp image ( , ) ( , ) ( , )g x y f x y f x y= −
  • 30. Spatial Filtering : 30 ExampleExample
  • 31. Spatial Filtering : 31 Sharpening using High-boostSharpening using High-boost FilteringFiltering Generalization of unsharp masking As A increases, contribution of sharpening decreases ( , ) ( , ) ( , )g x y Af x y f x y= −
  • 32. Spatial Filtering : 32 Sharpening using High-boostSharpening using High-boost FilteringFiltering
  • 33. Spatial Filtering : 33 Example
  • 34. Spatial Filtering : 34 First Derivatives for EnhancementFirst Derivatives for Enhancement Implemented as magnitude of gradient in image processing f x f f y ∂   ∂  ∇ = ∂   ∂  1/222 f f f x y   ∂ ∂  ∇ = +  ÷ ÷ ∂ ∂    
  • 35. Spatial Filtering : 35 ImplementationImplementation Problem: Expensive to implement directly Solution: Approximate using absolute values Can be implemented using two 2x2 filters Even filters difficult to implement, so 3x3 filters are used for approximation 9 5 8 6f z z z z∇ ≈ − + − 7 8 9 1 2 3 3 6 9 1 4 7 ( 2 ) ( 2 ) ( 2 ) ( 2 ) f z z z z z z z z z z z z ∇ ≈ + + − + + + + + − + +
  • 36. Spatial Filtering : 36 Gradient MasksGradient Masks
  • 37. Spatial Filtering : 37 Example: Defect DetectionExample: Defect Detection