SlideShare a Scribd company logo
2
Most read
10
Most read
16
Most read
Image enhancement using
Spatial filtering
By
Md. Fazle Rabbi
16CSE057
4.2
Introduction To Filters
• Filtering is a technique used for modifying or enhancing an
image like highlight certain features or remove other
features.
• Image filtering include smoothing, sharpening, and edge
enhancement
• Term ‘convolution ‘ means applying filters to an image .
• It may be applied in either
spatial domain
frequency domain
4.3
SPATIAL DOMAIN FILTERS
4.4
SPATIAL FILTER
The spatial filter is just moving the filter mask from point to
point in an image.
The filter mask may be 3x3 mask or 5x5 mask or to be 7x7
mask.
Example
3x3 mask in a 5x5 image
4.5
MECHANISM OF SPATIAL FILTERING
Filter at each point
(x , y) are calculated
by predefined
relationship
This process shows
moving filter mask
point to point
4.6
Spatial Filtering
• Similar to neighborhood operation
• A mask or filter or template or kernel or window
defines the neighborhood
• Mask size is usually m × n
o m = 2a+1, n = 2b+1
• Output pixel value is determined from the pixels under
the mask
4.7
The Approaches of Spatial Filtering
O A neighborhood (small rectangle)
O
A predefined operation performed on
image pixels.
Spatial filter consist of two steps
Filtering creates a new pixel value replaced by old pixel value
4.8
Image Enhancement using Spatial Filtering
Mask
Image
Origin
Image f(x,y)
4.9
Image Enhancement using Spatial Filtering
Mask
Image
Origin
Image f(x,y)
w(-1,-1) w(-1,0) w(-1,1)
w(0,-1) w(0,0) w(0,1)
w(1,0) w(1,1)
Mask Coefficients
showing coordinate
arrangement
w(1,-1)
4.10
Image Enhancement using Spatial Filtering
Mask
Image
Origin
Image f(x,y)
f(x-1,y-1) f(x-1,y) f(x-1,y+1)
f(x,y-1) f(x,y) f(x,y+1)
f(x+1,y-1) f(x+1,y) f(x+1,y+1)
Pixels of image
section under
Mask
4.11
Image Enhancement using Spatial Filtering
Mask
Image
Origin
Image f(x,y)
w(-1,-1) w(-1,0) w(-1,1)
w(0,-1) w(0,0) w(0,1)
w(1,0) w(1,1)
f(x-1,y-1) f(x-1,y) f(x-1,y+1)
f(x,y) f(x,y+1)
f(x+1,y-1) f(x+1,y) f(x+1,y+1)
Mask
Coefficients
Pixels under Mask
w(1,-1)
f(x,y-1)
4.12
Types Of Spatial Filters
There are two types of filter,
1.Linear Spatial Filter
2.Non Linear Spatial Filter
 Each pixel in an image can be replaced with
constant value then it is called as linear spatial
filter otherwise it is called as non-linear.
4.13
LINEAR SPATIAL FILTERING
4.14
LINEAR SPATIAL FILTERING
4.15
LINEAR SPATIAL FILTERING
4.16
CONVOLUTION
4.17
CONVOLUTION
4.18
Image Enhancement using Spatial Filtering
Mask
Image
Origin
Image f(x,y)
w(-1,-1) w(-1,0) w(-1,1)
w(0,-1) w(0,0) w(0,1)
w(1,0) w(1,1)
f(x-1,y-1) f(x-1,y) f(x-1,y+1)
f(x,y) f(x,y+1)
f(x+1,y-1) f(x+1,y) f(x+1,y+1)
Mask
Coefficients
Pixels under Mask
w(1,-1)
f(x,y-1)
4.19
Image Enhancement using Spatial Filtering
w(-1,-1) w(-1,0) w(-1,1)
w(0,-1) w(0,0) w(0,1)
w(1,0) w(1,1)
f(x-1,y-1) f(x-1,y) f(x-1,y+1)
f(x,y) f(x,y+1)
f(x+1,y-1) f(x+1,y) f(x+1,y+1)
Mask
Coefficients
Pixels under Mask
w(1,-1)
f(x,y-1)
Response of the filter
at point (x, y):
)
1
,
1
(
)
1
,
1
(
)
,
1
(
)
0
,
1
(
)
,
1
(
)
0
,
1
(
)
1
,
1
(
)
1
,
1
(














y
x
f
w
y
x
f
w
y
x
f
w
y
x
f
w
R


4.20
Image Enhancement using Spatial Filtering
w(-1,-1) w(-1,0) w(-1,1)
w(0,-1) w(0,0) w(0,1)
w(1,0) w(1,1)
f(x-1,y-1) f(x-1,y) f(x-1,y+1)
f(x,y) f(x,y+1)
f(x+1,y-1) f(x+1,y) f(x+1,y+1)
Mask
Coefficients
Pixels under Mask
w(1,-1)
f(x,y-1)
Response of the filter
at point (x, y):
)
1
,
1
(
)
1
,
1
(
)
,
1
(
)
0
,
1
(
)
,
1
(
)
0
,
1
(
)
1
,
1
(
)
1
,
1
(














y
x
f
w
y
x
f
w
y
x
f
w
y
x
f
w
R


**This type of response is called linear filtering
4.21
Image Enhancement using Spatial Filtering
A more general
equation for
response:
w(-1,-1) w(-1,0) w(-1,1)
w(0,-1) w(0,0) w(0,1)
w(1,0) w(1,1)
f(x-1,y-1) f(x-1,y) f(x-1,y+1)
f(x,y-1) f(x,y) f(x,y+1)
f(x+1,y-1) f(x+1,y) f(x+1,y+1)
Mask
Coefficients
w(1,-1)


 




a
a
s
b
b
t
t
y
s
x
f
t
s
w
y
x
g )
,
(
)
,
(
)
,
(
g(x,y)
M
N
2b+1
2a+1
4.22
Image Enhancement using Spatial Filtering



mn
i
i
i z
w
R
1
w1 w2 w3
w4 w5 w6
w8 w9
Mask
Coefficients
w7
Or, for a general case of
mask size mXn:
z1 z2 z3
z4 z5 z6
z8 z9
z7



9
1
i
i
i z
w
R
4.23
Thank You

More Related Content

What's hot (20)

PPTX
Image enhancement
Ayaelshiwi
 
PPT
Spatial filtering
shabanam tamboli
 
PPTX
Digital Image restoration
Md Shabir Alam
 
PPTX
Image compression in digital image processing
DHIVYADEVAKI
 
PPTX
Bit plane coding
priyadharshini murugan
 
PPT
unit-3.ppt
meenalshanmuganathan
 
PPTX
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
PPTX
Image Sampling and Quantization.pptx
RUBIN (A) JEBIN
 
PDF
filters for noise in image processing
Sardar Alam
 
PPTX
Chapter 3 image enhancement (spatial domain)
asodariyabhavesh
 
PPTX
Image segmentation
Gayan Sampath
 
PPTX
Linear Image Processing
Avinash Rohra
 
PPTX
Chap6 image restoration
ShardaSalunkhe1
 
PPTX
Color models
Moahmed Sweelam
 
PDF
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
SayantanMajhi2
 
PPTX
Image Restoration (Order Statistics Filters)
Kalyan Acharjya
 
PPTX
Fundamentals and image compression models
lavanya marichamy
 
PPT
Image processing spatialfiltering
John Williams
 
PDF
Image Segmentation (Digital Image Processing)
VARUN KUMAR
 
PPT
Sharpening using frequency Domain Filter
arulraj121
 
Image enhancement
Ayaelshiwi
 
Spatial filtering
shabanam tamboli
 
Digital Image restoration
Md Shabir Alam
 
Image compression in digital image processing
DHIVYADEVAKI
 
Bit plane coding
priyadharshini murugan
 
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
Image Sampling and Quantization.pptx
RUBIN (A) JEBIN
 
filters for noise in image processing
Sardar Alam
 
Chapter 3 image enhancement (spatial domain)
asodariyabhavesh
 
Image segmentation
Gayan Sampath
 
Linear Image Processing
Avinash Rohra
 
Chap6 image restoration
ShardaSalunkhe1
 
Color models
Moahmed Sweelam
 
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
SayantanMajhi2
 
Image Restoration (Order Statistics Filters)
Kalyan Acharjya
 
Fundamentals and image compression models
lavanya marichamy
 
Image processing spatialfiltering
John Williams
 
Image Segmentation (Digital Image Processing)
VARUN KUMAR
 
Sharpening using frequency Domain Filter
arulraj121
 

Similar to 7. image enhancement using spatial filtering (20)

PPT
06 spatial filtering DIP
babak danyal
 
PPTX
imge enhncement sptil filtering55555.pptx
projectsall
 
PDF
Spatial Domain Filtering.pdf
swagatkarve
 
PPTX
SPATIAL FILTERING IN IMAGE PROCESSING
muthu181188
 
PPTX
Presentation
Vikash Kumar Das
 
PPTX
SPATIAL FILTERING. FOR UNDERGRADUATE .pptx
satushisammur
 
PPT
Spatial filtering
Sanyam Agarwal
 
PDF
CSE367 Lecture- image sinal processing lecture
FatmaNewagy1
 
PDF
Lecture 4
Wael Sharba
 
PPT
Digital Image Processing UNIT-2.ppt
durgakru
 
PPT
Image Processing Definition Digital Image
AhmedRAZA493682
 
PPTX
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
Hemantha Kulathilake
 
PPTX
Spatial operation.ppt
Bhanubhakta Poudel
 
PDF
PPT s04-machine vision-s2
Binus Online Learning
 
PPTX
Image filtering in Digital image processing
Abinaya B
 
PPTX
Image enhancement techniques - Digital Image Processing
BharaniDharan195623
 
PPT
05_Spatial_Filtering.ppt
pawankamal3
 
PPT
Spatial domain filtering.ppt
ssuser4bbfb1
 
PDF
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
Charles Deledalle
 
PPTX
Spatial enhancement techniques
AakanchaAnand
 
06 spatial filtering DIP
babak danyal
 
imge enhncement sptil filtering55555.pptx
projectsall
 
Spatial Domain Filtering.pdf
swagatkarve
 
SPATIAL FILTERING IN IMAGE PROCESSING
muthu181188
 
Presentation
Vikash Kumar Das
 
SPATIAL FILTERING. FOR UNDERGRADUATE .pptx
satushisammur
 
Spatial filtering
Sanyam Agarwal
 
CSE367 Lecture- image sinal processing lecture
FatmaNewagy1
 
Lecture 4
Wael Sharba
 
Digital Image Processing UNIT-2.ppt
durgakru
 
Image Processing Definition Digital Image
AhmedRAZA493682
 
COM2304: Intensity Transformation and Spatial Filtering – II Spatial Filterin...
Hemantha Kulathilake
 
Spatial operation.ppt
Bhanubhakta Poudel
 
PPT s04-machine vision-s2
Binus Online Learning
 
Image filtering in Digital image processing
Abinaya B
 
Image enhancement techniques - Digital Image Processing
BharaniDharan195623
 
05_Spatial_Filtering.ppt
pawankamal3
 
Spatial domain filtering.ppt
ssuser4bbfb1
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
Charles Deledalle
 
Spatial enhancement techniques
AakanchaAnand
 
Ad

More from MdFazleRabbi18 (20)

PPTX
5.programmable interval timer 8253
MdFazleRabbi18
 
PPTX
4.programmable dma controller 8257
MdFazleRabbi18
 
PPTX
3.programmable interrupt controller 8259
MdFazleRabbi18
 
PPTX
1.ppi 8255
MdFazleRabbi18
 
PPTX
Topic4 data encryption standard(des)
MdFazleRabbi18
 
PPTX
Topic3 playfain
MdFazleRabbi18
 
PPTX
Topic2 caser hill_cripto
MdFazleRabbi18
 
PPTX
Topic5 advanced encryption standard (aes)
MdFazleRabbi18
 
PPTX
Topic1 substitution transposition-techniques
MdFazleRabbi18
 
PPTX
11. lzw coding
MdFazleRabbi18
 
PPTX
9. hofman coding in DIP
MdFazleRabbi18
 
PPTX
5. gray level transformation
MdFazleRabbi18
 
PPTX
1. steps in image processing
MdFazleRabbi18
 
PPTX
5. convolution and correlation of discrete time signals
MdFazleRabbi18
 
PPTX
4. operations of signals
MdFazleRabbi18
 
PPTX
3. systems
MdFazleRabbi18
 
PPTX
2. classification of signals
MdFazleRabbi18
 
PPTX
1. elementary signals
MdFazleRabbi18
 
PPTX
4. random number and it's generating techniques
MdFazleRabbi18
 
PPTX
3. different types of simulations for appropriate systems
MdFazleRabbi18
 
5.programmable interval timer 8253
MdFazleRabbi18
 
4.programmable dma controller 8257
MdFazleRabbi18
 
3.programmable interrupt controller 8259
MdFazleRabbi18
 
1.ppi 8255
MdFazleRabbi18
 
Topic4 data encryption standard(des)
MdFazleRabbi18
 
Topic3 playfain
MdFazleRabbi18
 
Topic2 caser hill_cripto
MdFazleRabbi18
 
Topic5 advanced encryption standard (aes)
MdFazleRabbi18
 
Topic1 substitution transposition-techniques
MdFazleRabbi18
 
11. lzw coding
MdFazleRabbi18
 
9. hofman coding in DIP
MdFazleRabbi18
 
5. gray level transformation
MdFazleRabbi18
 
1. steps in image processing
MdFazleRabbi18
 
5. convolution and correlation of discrete time signals
MdFazleRabbi18
 
4. operations of signals
MdFazleRabbi18
 
3. systems
MdFazleRabbi18
 
2. classification of signals
MdFazleRabbi18
 
1. elementary signals
MdFazleRabbi18
 
4. random number and it's generating techniques
MdFazleRabbi18
 
3. different types of simulations for appropriate systems
MdFazleRabbi18
 
Ad

Recently uploaded (20)

PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPT
digestive system for Pharm d I year HAP
rekhapositivity
 
PPTX
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
PPTX
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
PPTX
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
Latest Features in Odoo 18 - Odoo slides
Celine George
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPTX
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
digestive system for Pharm d I year HAP
rekhapositivity
 
HEAD INJURY IN CHILDREN: NURSING MANAGEMENGT.pptx
PRADEEP ABOTHU
 
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
Latest Features in Odoo 18 - Odoo slides
Celine George
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
CONVULSIVE DISORDERS: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 

7. image enhancement using spatial filtering

  • 1. Image enhancement using Spatial filtering By Md. Fazle Rabbi 16CSE057
  • 2. 4.2 Introduction To Filters • Filtering is a technique used for modifying or enhancing an image like highlight certain features or remove other features. • Image filtering include smoothing, sharpening, and edge enhancement • Term ‘convolution ‘ means applying filters to an image . • It may be applied in either spatial domain frequency domain
  • 4. 4.4 SPATIAL FILTER The spatial filter is just moving the filter mask from point to point in an image. The filter mask may be 3x3 mask or 5x5 mask or to be 7x7 mask. Example 3x3 mask in a 5x5 image
  • 5. 4.5 MECHANISM OF SPATIAL FILTERING Filter at each point (x , y) are calculated by predefined relationship This process shows moving filter mask point to point
  • 6. 4.6 Spatial Filtering • Similar to neighborhood operation • A mask or filter or template or kernel or window defines the neighborhood • Mask size is usually m × n o m = 2a+1, n = 2b+1 • Output pixel value is determined from the pixels under the mask
  • 7. 4.7 The Approaches of Spatial Filtering O A neighborhood (small rectangle) O A predefined operation performed on image pixels. Spatial filter consist of two steps Filtering creates a new pixel value replaced by old pixel value
  • 8. 4.8 Image Enhancement using Spatial Filtering Mask Image Origin Image f(x,y)
  • 9. 4.9 Image Enhancement using Spatial Filtering Mask Image Origin Image f(x,y) w(-1,-1) w(-1,0) w(-1,1) w(0,-1) w(0,0) w(0,1) w(1,0) w(1,1) Mask Coefficients showing coordinate arrangement w(1,-1)
  • 10. 4.10 Image Enhancement using Spatial Filtering Mask Image Origin Image f(x,y) f(x-1,y-1) f(x-1,y) f(x-1,y+1) f(x,y-1) f(x,y) f(x,y+1) f(x+1,y-1) f(x+1,y) f(x+1,y+1) Pixels of image section under Mask
  • 11. 4.11 Image Enhancement using Spatial Filtering Mask Image Origin Image f(x,y) w(-1,-1) w(-1,0) w(-1,1) w(0,-1) w(0,0) w(0,1) w(1,0) w(1,1) f(x-1,y-1) f(x-1,y) f(x-1,y+1) f(x,y) f(x,y+1) f(x+1,y-1) f(x+1,y) f(x+1,y+1) Mask Coefficients Pixels under Mask w(1,-1) f(x,y-1)
  • 12. 4.12 Types Of Spatial Filters There are two types of filter, 1.Linear Spatial Filter 2.Non Linear Spatial Filter  Each pixel in an image can be replaced with constant value then it is called as linear spatial filter otherwise it is called as non-linear.
  • 18. 4.18 Image Enhancement using Spatial Filtering Mask Image Origin Image f(x,y) w(-1,-1) w(-1,0) w(-1,1) w(0,-1) w(0,0) w(0,1) w(1,0) w(1,1) f(x-1,y-1) f(x-1,y) f(x-1,y+1) f(x,y) f(x,y+1) f(x+1,y-1) f(x+1,y) f(x+1,y+1) Mask Coefficients Pixels under Mask w(1,-1) f(x,y-1)
  • 19. 4.19 Image Enhancement using Spatial Filtering w(-1,-1) w(-1,0) w(-1,1) w(0,-1) w(0,0) w(0,1) w(1,0) w(1,1) f(x-1,y-1) f(x-1,y) f(x-1,y+1) f(x,y) f(x,y+1) f(x+1,y-1) f(x+1,y) f(x+1,y+1) Mask Coefficients Pixels under Mask w(1,-1) f(x,y-1) Response of the filter at point (x, y): ) 1 , 1 ( ) 1 , 1 ( ) , 1 ( ) 0 , 1 ( ) , 1 ( ) 0 , 1 ( ) 1 , 1 ( ) 1 , 1 (               y x f w y x f w y x f w y x f w R  
  • 20. 4.20 Image Enhancement using Spatial Filtering w(-1,-1) w(-1,0) w(-1,1) w(0,-1) w(0,0) w(0,1) w(1,0) w(1,1) f(x-1,y-1) f(x-1,y) f(x-1,y+1) f(x,y) f(x,y+1) f(x+1,y-1) f(x+1,y) f(x+1,y+1) Mask Coefficients Pixels under Mask w(1,-1) f(x,y-1) Response of the filter at point (x, y): ) 1 , 1 ( ) 1 , 1 ( ) , 1 ( ) 0 , 1 ( ) , 1 ( ) 0 , 1 ( ) 1 , 1 ( ) 1 , 1 (               y x f w y x f w y x f w y x f w R   **This type of response is called linear filtering
  • 21. 4.21 Image Enhancement using Spatial Filtering A more general equation for response: w(-1,-1) w(-1,0) w(-1,1) w(0,-1) w(0,0) w(0,1) w(1,0) w(1,1) f(x-1,y-1) f(x-1,y) f(x-1,y+1) f(x,y-1) f(x,y) f(x,y+1) f(x+1,y-1) f(x+1,y) f(x+1,y+1) Mask Coefficients w(1,-1)         a a s b b t t y s x f t s w y x g ) , ( ) , ( ) , ( g(x,y) M N 2b+1 2a+1
  • 22. 4.22 Image Enhancement using Spatial Filtering    mn i i i z w R 1 w1 w2 w3 w4 w5 w6 w8 w9 Mask Coefficients w7 Or, for a general case of mask size mXn: z1 z2 z3 z4 z5 z6 z8 z9 z7    9 1 i i i z w R