SlideShare a Scribd company logo
1 of 28
Amity School of Engineering & Technology 
1 
Amity School of Engineering & Technology 
Digital Image Processing 
Credit Units: 4 
Mukesh Bhardwaj
Amity School of Engineering & Technology 
Image Enhancement 
(Spatial Filtering ) 
2
Amity School of Engineering & Technology 
Contents 
•In this lecture we will look at spatial filtering 
techniques: 
– Neighbourhood operations 
– What is spatial filtering? 
– Smoothing operations 
– What happens at the edges? 
– Correlation and convolution
Amity School of Engineering & Technology 
Neighbourhood Operations 
•Neighbourhood operations simply operate 
on a larger neighbourhood of pixels than 
point operations 
•Neighbourhoods are 
mostly a rectangle 
around a central pixel 
•Any size rectangle 
and any shape filter 
are possible 
Origin x 
(x, y) 
Neighbourhood 
y Image f (x, y)
Amity School of Engineering & Technology 
Simple Neighbourhood Operations 
•Some simple neighbourhood operations 
include: 
– Min: Set the pixel value to the minimum in the 
neighbourhood 
– Max: Set the pixel value to the maximum in 
the neighbourhood 
– Median: The median value of a set of 
numbers is the midpoint value in that set (e.g. 
from the set [1, 7, 15, 18, 24] 15 is the 
median). Sometimes the median works better 
than the average
Amity School of Engineering & Technology 
Simple Neighbourhood Operations 
Example 
Original Image x 
123 127 128 119 115 130 
140 145 148 153 167 172 
133 154 183 192 194 191 
194 199 207 210 198 195 
164 170 175 162 173 151 
y 
Enhanced Image x 
y
Amity School of Engineering & Technology 
The Spatial Filtering Process 
r s t 
u v w 
x y z 
Origin x 
y Image f (x, y) 
eprocessed = v*e + 
Filter 
r*a + s*b + t*c + 
u*d + w*f + 
x*g + y*h + z*i 
Simple 3*3 
Neighbourhood 
e 3*3 Filter 
a b c 
d e f 
g h i 
Original 
Image Pixels 
* 
The above is repeated for every pixel in the 
original image to generate the filtered image
Amity School of Engineering & Technology 
Spatial Filtering: Equation Form 
a 
  
  
g(x, y)  w(s, t) f (x  s, y  
t) 
s a 
b 
t b 
Filtering can be 
given in equation 
form as shown 
above 
Notations are based 
on the image 
shown to the left
Amity School of Engineering & Technology 
Smoothing Spatial Filters 
•One of the simplest spatial filtering 
operations we can perform is a smoothing 
operation 
– Simply average all of the pixels in a 
neighbourhood around a central value 
– Especially useful 
1/1/1/9 
9 
9 
in removing noise 
from images 
1/1/1/9 
9 
9 
– Also useful for 
highlighting gross 
1/1/1/9 
9 
9 
detail 
Simple 
averaging 
filter
Amity School of Engineering & Technology 
Smoothing Spatial Filtering 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
Origin x 
y Image f (x, y) 
e = 1/9*106 + 
Filter 
1/9*104 + 1/9*100 + 1/9*108 + 
1/9*99 + 1/9*98 + 
1/9*95 + 1/9*90 + 1/9*85 
= 98.3333 
Simple 3*3 
Neighbourhood 
106 
104 
99 
95 
100 108 
98 
90 85 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
3*3 Smoothing 
Filter 
104 100 108 
99 106 98 
95 90 85 
Original 
Image Pixels 
* 
The above is repeated for every pixel in the original 
image to generate the smoothed image
Amity School of Engineering & Technology 
Image Smoothing Example 
•The image at the top left 
is an original image of 
size 500*500 pixels 
•The subsequent images 
show the image after 
filtering with an averaging 
filter of increasing sizes 
– 3, 5, 9, 15 and 35 
•Notice how detail begins 
to disappear 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Smoothing Spatial Filtering 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
Origin x 
y Image f (x, y) 
e = 1/9*106 + 
Filter 
1/9*104 + 1/9*100 + 1/9*108 + 
1/9*99 + 1/9*98 + 
1/9*95 + 1/9*90 + 1/9*85 
= 98.3333 
Simple 3*3 
Neighbourhood 
106 
104 
99 
95 
100 108 
98 
90 85 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
1/9 
3*3 Smoothing 
Filter 
104 100 108 
99 106 98 
95 90 85 
Original 
Image Pixels 
* 
The above is repeated for every pixel in the original 
image to generate the smoothed image
Amity School of Engineering & Technology 
Image Smoothing Example 
•The image at the top left 
is an original image of 
size 500*500 pixels 
•The subsequent images 
show the image after 
filtering with an averaging 
filter of increasing sizes 
– 3, 5, 9, 15 and 35 
•Notice how detail begins 
to disappear 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Image Smoothing Example 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Image Smoothing Example 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Image Smoothing Example 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Image Smoothing Example 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Image Smoothing Example 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Image Smoothing Example 
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Amity School of Engineering & Technology 
Weighted Smoothing Filters 
•More effective smoothing filters can be 
generated by allowing different pixels in the 
neighbourhood different weights in the 
averaging function 
– Pixels closer to the 
central pixel are more 
important 
– Often referred to as a 
weighted averaging 
1/16 
2/16 
1/16 
2/16 
4/16 
2/16 
1/16 
2/16 
1/16 
Weighted 
averaging filter
Amity School of Engineering & Technology 
Another Smoothing Example 
•By smoothing the original image we get rid of lots 
of the finer detail which leaves only the gross 
features for thresholding 
Original Image Smoothed Image Thresholded Image
Amity School of Engineering & Technology 
Averaging Filter Vs. Median Filter Example 
Original Image 
With Noise 
Image After 
Averaging Filter 
Image After 
Median Filter 
•Filtering is often used to remove noise from 
images 
•Sometimes a median filter works better 
than an averaging filter
Amity School of Engineering & Technology 
Averaging Filter Vs. Median Filter Example
Amity School of Engineering & Technology 
Averaging Filter Vs. Median Filter Example
Amity School of Engineering & Technology 
Averaging Filter Vs. Median Filter Example
Amity School of Engineering & Technology 
Simple Neighbourhood Operations Example 
123 127 128 119 115 130 
140 145 148 153 167 172 
133 154 183 192 194 191 
194 199 207 210 198 195 
164 170 175 162 173 151 
x 
y
Amity School of Engineering & Technology 
Strange Things Happen At The Edges! 
At the edges of an image we are missing 
pixels to form a neighbourhood 
Origin x 
e 
e 
e 
e e 
e 
e 
y Image f (x, y)
Amity School of Engineering & Technology 
Strange Things Happen At The Edges! (cont…) 
•There are a few approaches to dealing with missing edge 
pixels: 
– Omit missing pixels 
• Only works with some filters 
• Can add extra code and slow down processing 
– Pad the image 
• Typically with either all white or all black pixels 
– Replicate border pixels 
– Truncate the image 
– Allow pixels wrap around the image 
• Can cause some strange image artefacts

More Related Content

What's hot

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
 
Filtering an image is to apply a convolution
Filtering an image is to apply a convolutionFiltering an image is to apply a convolution
Filtering an image is to apply a convolutionAbhishek Mukherjee
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothningVinay Gupta
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: Spatial filtersA B Shinde
 
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
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2Gichelle Amon
 
New approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmNew approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmeSAT Publishing House
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainMadhu Bala
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processingAbinaya B
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIPbabak danyal
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatialElsayed Hemayed
 
Image Enhancement
Image Enhancement Image Enhancement
Image Enhancement Deven Sahu
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filterarulraj121
 

What's hot (20)

SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 
Filtering an image is to apply a convolution
Filtering an image is to apply a convolutionFiltering an image is to apply a convolution
Filtering an image is to apply a convolution
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothning
 
Image Processing: Spatial filters
Image Processing: Spatial filtersImage Processing: Spatial filters
Image Processing: 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...
COM2304: Intensity Transformation and Spatial Filtering – III Spatial Filters...
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2
 
New approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithmNew approach for generalised unsharp masking alogorithm
New approach for generalised unsharp masking alogorithm
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial
 
Image Enhancement
Image Enhancement Image Enhancement
Image Enhancement
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Unit3 dip
Unit3 dipUnit3 dip
Unit3 dip
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 

Similar to 2.spatial filtering

Digital Image processing
Digital Image processingDigital Image processing
Digital Image processingAmir Hossain
 
A (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJA (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJPaul Mignone, Ph.D
 
05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.pptpawankamal3
 
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...Hemantha Kulathilake
 
Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.pptssuser4bbfb1
 
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...IRJET Journal
 
3.point operation and histogram based image enhancement
3.point operation and histogram based image enhancement3.point operation and histogram based image enhancement
3.point operation and histogram based image enhancementmukesh bhardwaj
 
Fundamentals of Image processing.ppt
Fundamentals of Image processing.pptFundamentals of Image processing.ppt
Fundamentals of Image processing.pptssuser9a00df
 
AN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSING
AN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSINGAN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSING
AN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSINGcscpconf
 
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...IRJET Journal
 
Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...
Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...
Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...IJERA Editor
 
SpatialEnhancement of course CE7491 of NTU
SpatialEnhancement of course CE7491 of NTUSpatialEnhancement of course CE7491 of NTU
SpatialEnhancement of course CE7491 of NTUlyumingzhi
 
IRJET - Change Detection in Satellite Images using Convolutional Neural N...
IRJET -  	  Change Detection in Satellite Images using Convolutional Neural N...IRJET -  	  Change Detection in Satellite Images using Convolutional Neural N...
IRJET - Change Detection in Satellite Images using Convolutional Neural N...IRJET Journal
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image ProcessingReshma KC
 

Similar to 2.spatial filtering (20)

Digital Image processing
Digital Image processingDigital Image processing
Digital Image processing
 
A (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJA (very brief) Introduction to Image Processing and 3D Printing with ImageJ
A (very brief) Introduction to Image Processing and 3D Printing with ImageJ
 
05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt05_Spatial_Filtering.ppt
05_Spatial_Filtering.ppt
 
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
 
Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.ppt
 
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
Translation Invariance (TI) based Novel Approach for better De-noising of Dig...
 
IMAGE SEGMENTATION.
IMAGE SEGMENTATION.IMAGE SEGMENTATION.
IMAGE SEGMENTATION.
 
3.point operation and histogram based image enhancement
3.point operation and histogram based image enhancement3.point operation and histogram based image enhancement
3.point operation and histogram based image enhancement
 
Fundamentals of Image processing.ppt
Fundamentals of Image processing.pptFundamentals of Image processing.ppt
Fundamentals of Image processing.ppt
 
rmsip98.ppt
rmsip98.pptrmsip98.ppt
rmsip98.ppt
 
ACMP340.pptx
ACMP340.pptxACMP340.pptx
ACMP340.pptx
 
AN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSING
AN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSINGAN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSING
AN EMERGING TREND OF FEATURE EXTRACTION METHOD IN VIDEO PROCESSING
 
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
Deblurring Image and Removing Noise from Medical Images for Cancerous Disease...
 
Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...
Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...
Analysis of Non Linear Filters with Various Density of Impulse Noise for Diff...
 
PPT s04-machine vision-s2
PPT s04-machine vision-s2PPT s04-machine vision-s2
PPT s04-machine vision-s2
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
 
DIP - Image Restoration
DIP - Image RestorationDIP - Image Restoration
DIP - Image Restoration
 
SpatialEnhancement of course CE7491 of NTU
SpatialEnhancement of course CE7491 of NTUSpatialEnhancement of course CE7491 of NTU
SpatialEnhancement of course CE7491 of NTU
 
IRJET - Change Detection in Satellite Images using Convolutional Neural N...
IRJET -  	  Change Detection in Satellite Images using Convolutional Neural N...IRJET -  	  Change Detection in Satellite Images using Convolutional Neural N...
IRJET - Change Detection in Satellite Images using Convolutional Neural N...
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 

Recently uploaded

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 

2.spatial filtering

  • 1. Amity School of Engineering & Technology 1 Amity School of Engineering & Technology Digital Image Processing Credit Units: 4 Mukesh Bhardwaj
  • 2. Amity School of Engineering & Technology Image Enhancement (Spatial Filtering ) 2
  • 3. Amity School of Engineering & Technology Contents •In this lecture we will look at spatial filtering techniques: – Neighbourhood operations – What is spatial filtering? – Smoothing operations – What happens at the edges? – Correlation and convolution
  • 4. Amity School of Engineering & Technology Neighbourhood Operations •Neighbourhood operations simply operate on a larger neighbourhood of pixels than point operations •Neighbourhoods are mostly a rectangle around a central pixel •Any size rectangle and any shape filter are possible Origin x (x, y) Neighbourhood y Image f (x, y)
  • 5. Amity School of Engineering & Technology Simple Neighbourhood Operations •Some simple neighbourhood operations include: – Min: Set the pixel value to the minimum in the neighbourhood – Max: Set the pixel value to the maximum in the neighbourhood – Median: The median value of a set of numbers is the midpoint value in that set (e.g. from the set [1, 7, 15, 18, 24] 15 is the median). Sometimes the median works better than the average
  • 6. Amity School of Engineering & Technology Simple Neighbourhood Operations Example Original Image x 123 127 128 119 115 130 140 145 148 153 167 172 133 154 183 192 194 191 194 199 207 210 198 195 164 170 175 162 173 151 y Enhanced Image x y
  • 7. Amity School of Engineering & Technology The Spatial Filtering Process r s t u v w x y z Origin x y Image f (x, y) eprocessed = v*e + Filter r*a + s*b + t*c + u*d + w*f + x*g + y*h + z*i Simple 3*3 Neighbourhood e 3*3 Filter a b c d e f g h i Original Image Pixels * The above is repeated for every pixel in the original image to generate the filtered image
  • 8. Amity School of Engineering & Technology Spatial Filtering: Equation Form a     g(x, y)  w(s, t) f (x  s, y  t) s a b t b Filtering can be given in equation form as shown above Notations are based on the image shown to the left
  • 9. Amity School of Engineering & Technology Smoothing Spatial Filters •One of the simplest spatial filtering operations we can perform is a smoothing operation – Simply average all of the pixels in a neighbourhood around a central value – Especially useful 1/1/1/9 9 9 in removing noise from images 1/1/1/9 9 9 – Also useful for highlighting gross 1/1/1/9 9 9 detail Simple averaging filter
  • 10. Amity School of Engineering & Technology Smoothing Spatial Filtering 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 Origin x y Image f (x, y) e = 1/9*106 + Filter 1/9*104 + 1/9*100 + 1/9*108 + 1/9*99 + 1/9*98 + 1/9*95 + 1/9*90 + 1/9*85 = 98.3333 Simple 3*3 Neighbourhood 106 104 99 95 100 108 98 90 85 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 3*3 Smoothing Filter 104 100 108 99 106 98 95 90 85 Original Image Pixels * The above is repeated for every pixel in the original image to generate the smoothed image
  • 11. Amity School of Engineering & Technology Image Smoothing Example •The image at the top left is an original image of size 500*500 pixels •The subsequent images show the image after filtering with an averaging filter of increasing sizes – 3, 5, 9, 15 and 35 •Notice how detail begins to disappear Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 12. Amity School of Engineering & Technology Smoothing Spatial Filtering 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 Origin x y Image f (x, y) e = 1/9*106 + Filter 1/9*104 + 1/9*100 + 1/9*108 + 1/9*99 + 1/9*98 + 1/9*95 + 1/9*90 + 1/9*85 = 98.3333 Simple 3*3 Neighbourhood 106 104 99 95 100 108 98 90 85 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 3*3 Smoothing Filter 104 100 108 99 106 98 95 90 85 Original Image Pixels * The above is repeated for every pixel in the original image to generate the smoothed image
  • 13. Amity School of Engineering & Technology Image Smoothing Example •The image at the top left is an original image of size 500*500 pixels •The subsequent images show the image after filtering with an averaging filter of increasing sizes – 3, 5, 9, 15 and 35 •Notice how detail begins to disappear Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 14. Amity School of Engineering & Technology Image Smoothing Example Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 15. Amity School of Engineering & Technology Image Smoothing Example Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 16. Amity School of Engineering & Technology Image Smoothing Example Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 17. Amity School of Engineering & Technology Image Smoothing Example Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 18. Amity School of Engineering & Technology Image Smoothing Example Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 19. Amity School of Engineering & Technology Image Smoothing Example Images taken from Gonzalez & Woods, Digital Image Processing (2002)
  • 20. Amity School of Engineering & Technology Weighted Smoothing Filters •More effective smoothing filters can be generated by allowing different pixels in the neighbourhood different weights in the averaging function – Pixels closer to the central pixel are more important – Often referred to as a weighted averaging 1/16 2/16 1/16 2/16 4/16 2/16 1/16 2/16 1/16 Weighted averaging filter
  • 21. Amity School of Engineering & Technology Another Smoothing Example •By smoothing the original image we get rid of lots of the finer detail which leaves only the gross features for thresholding Original Image Smoothed Image Thresholded Image
  • 22. Amity School of Engineering & Technology Averaging Filter Vs. Median Filter Example Original Image With Noise Image After Averaging Filter Image After Median Filter •Filtering is often used to remove noise from images •Sometimes a median filter works better than an averaging filter
  • 23. Amity School of Engineering & Technology Averaging Filter Vs. Median Filter Example
  • 24. Amity School of Engineering & Technology Averaging Filter Vs. Median Filter Example
  • 25. Amity School of Engineering & Technology Averaging Filter Vs. Median Filter Example
  • 26. Amity School of Engineering & Technology Simple Neighbourhood Operations Example 123 127 128 119 115 130 140 145 148 153 167 172 133 154 183 192 194 191 194 199 207 210 198 195 164 170 175 162 173 151 x y
  • 27. Amity School of Engineering & Technology Strange Things Happen At The Edges! At the edges of an image we are missing pixels to form a neighbourhood Origin x e e e e e e e y Image f (x, y)
  • 28. Amity School of Engineering & Technology Strange Things Happen At The Edges! (cont…) •There are a few approaches to dealing with missing edge pixels: – Omit missing pixels • Only works with some filters • Can add extra code and slow down processing – Pad the image • Typically with either all white or all black pixels – Replicate border pixels – Truncate the image – Allow pixels wrap around the image • Can cause some strange image artefacts