SlideShare a Scribd company logo
T.Deepika Msc(IT)
Department of CS and IT
Nadar saraswathi college of arts and science Theni
Spatial Filtering (cont’d)
 The word “filtering” comes from the frequency
domain where “filters” are classified as:
 Low-pass (i.e., preserve low frequencies)
 High-pass (i.e., preserve high frequencies)
 Band-pass (i.e., preserve frequencies within a band)
 Band-reject (i.e., reject frequencies within a band)
Spatial Filtering (cont’d)
 Need to define:
(1) a neighborhood (or mask)
(2) an operation
output image
Spatial Filtering – Neighborhood (or
Mask)
• Typically, the neighborhood is rectangular and its size
is much smaller than that of f(x,y)
- e.g., 3x3 or 5x5
Filter Categories
 We will focus on two types of filters:
 Smoothing (low-pass) filters
 Sharpening (high-pass) filters
Smoothing Filters (low-pass)
 Useful for reducing noise and eliminating small
details.
 The elements of the mask must be positive.
 Mask elements sum to 1 (assuming normalization).
Smoothing filters – Example
smoothed imageinput image
Sharpening Filters (high-pass)
 Useful for highlighting fine details.
 The elements of the mask contain both positive and
negative weights.
 Mask elements sum to 0.
Sharpening Filters - Example
 Useful for highlighting fine details.
 e.g., emphasize edges
Sharpening Filters - Example
sharpened imageinput image
(for better visualization, the original
image has been added to the sharpened image)
Common Smoothing Filters
 Averaging
 Gaussian
 Median filtering (non-linear)
Smoothing Filters: Averaging
Smoothing Filters: Averaging
(cont’d)
 Mask size determines degree of smoothing (i.e., loss of
detail).
3x3 5x5 7x7
15x15 25x25
original
Smoothing Filters: Averaging
(cont’d)
15 x 15 averaging image thresholding
Example: extract largest, brightest objects
Smoothing filters: Gaussian
 The weights are samples of a 2D Gaussian function:
Smoothing filters: Gaussian
(cont’d)
 Mask size depends on σ
Smoothing filters: Gaussian
(cont’d)
• σ controls the amount of smoothing
σ = 3
σ = 1.4
Smoothing filters: Gaussian
(cont’d)
Averaging vs Gaussian Smoothing
Averaging
Gaussian
Smoothing Filters: Median Filtering
(non-linear)
 Very effective for removing “salt and pepper” noise (i.e.,
random occurrences of black and white pixels).
averaging
median
filtering
Smoothing Filters: Median Filtering (cont’d)
 Replace each pixel by the median in a
neighborhood around the pixel.
 The size of the neighborhood controls the amount
of smoothing.
Common Sharpening Filters
 Unsharp masking
 High Boost filter
 Gradient (1st derivative)
 Laplacian (2nd derivative)
Sharpening Filters: Unsharp
Masking
 Obtain a sharp image by subtracting a lowpass
filtered (i.e., smoothed) image from the original
image:
- =
(with contrast
enhancement)
Sharpening Filters: High Boost
 Image sharpening emphasizes edges but details are
lost.
 Idea: amplify input image, then subtract a lowpass
image.
(A-1) + =
Sharpening Filters: High Boost (cont’d)
 If A=1, the result is unsharp masking.
 If A>1, part of the original image is added back to
the high pass filtered image.
One way to
implement high boost
filtering is using the
masks below
High boost
Sharpening Filters: High Boost (cont’d)
A=1.4 A=1.9
Sharpening Filters: Derivatives
 The derivative of an image results in a sharpened
image.
 Image derivatives can be computed using the gradient:
Gradient
 The gradient is a vector which has magnitude and
direction:
| | | |
f f
x y
 

 
or
(approximation)
Gradient (cont’d)
 Gradient magnitude: provides information about
edge strength.
 Gradient direction: perpendicular to the direction of
the edge.
Gradient Computation
 Approximate partial derivatives using finite
differences:
Δx
Gradient Computation (cont’d)
sensitive to vertical edges
sensitive to horizontal edges
f(x3,y3)-f(x3,y2)
y3-y2
y2=y3+Dy, y3=y, x3=x, Dy=1
Example: visualize partial
derivatives
f
x


f
y


Implement Gradient Using Masks
 We can implement and using masks:
(x+1/2,y)
(x,y+1/2)
*
*
good approximation
at (x+1/2,y)
good approximation
at (x,y+1/2)
Implement Gradient Using Masks (cont’d)
 A different approximation of the gradient:
• We can implement and using the following masks:
*
(x+1/2,y+1/2)
good approximation
Implement Gradient Using Masks (cont’d)
• Other approximations
Sobel
Prewitt
Example: Gradient Magnitude
Image
f
y


f
x


Gradient Magnitude
(isotropic)
Laplacian
The Laplacian (2nd derivative) is defined as:
(dot product)
Approximate
2nd derivatives:
Laplacian (cont’d)
Laplacian Mask
Edges can
be found
by detecting
the zero-
crossings
input image output image
5
5
5
5 5
-5 -5-10
-10
-1010
Example: Laplacian vs Gradient
Laplacian Sobel
• Laplacian localizes edges better (zero-crossings).
• Higher order derivatives more sensitive to noise.
• Laplacian is less computational expensive.
• Laplacian can provide edge magnitude information
but no information about edge direction.
Thankyou

More Related Content

PPTX
PPTX
Image Restoration (Frequency Domain Filters):Basics
PPTX
Module 31
PPT
Spatial filtering
PPTX
digital image processing
PPTX
Chapter 3 image enhancement (spatial domain)
PDF
Wiener Filter
PPT
Spatial domain and filtering
Image Restoration (Frequency Domain Filters):Basics
Module 31
Spatial filtering
digital image processing
Chapter 3 image enhancement (spatial domain)
Wiener Filter
Spatial domain and filtering

What's hot (20)

PPTX
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
PPTX
Image transforms
PPTX
Image processing second unit Notes
PPTX
Digital Image Processing
PPTX
Image Filtering in the Frequency Domain
PPTX
Image Smoothing using Frequency Domain Filters
PPT
Chapter 5
PPT
Frequency Domain Filtering 1.ppt
PPTX
Psuedo color
PPT
Image processing7 frequencyfiltering
PPTX
Digital image processing
PPTX
Walsh transform
PPTX
Unit3 dip
PPTX
Spatial Filters (Digital Image Processing)
PPT
Spatial filtering using image processing
PPT
Spatial filtering
PPTX
Convolution&Correlation
PPT
communication system ch1
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
Image transforms
Image processing second unit Notes
Digital Image Processing
Image Filtering in the Frequency Domain
Image Smoothing using Frequency Domain Filters
Chapter 5
Frequency Domain Filtering 1.ppt
Psuedo color
Image processing7 frequencyfiltering
Digital image processing
Walsh transform
Unit3 dip
Spatial Filters (Digital Image Processing)
Spatial filtering using image processing
Spatial filtering
Convolution&Correlation
communication system ch1
Ad

Similar to Spatial filtering (20)

PPT
Spatial Filtering in intro image processingr
PDF
CSE367 Lecture- image sinal processing lecture
PDF
Lecture 6
PPTX
Image_filtering (1).pptx
PPTX
Lecture 06 - image processingcourse1.pptx
PPT
smoothing filters gaussion and median filters comparing.ppt
PPTX
2. filtering basics
PDF
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
PPTX
Notes on image processing
PPTX
Image filtering in Digital image processing
PPT
06 spatial filtering DIP
PDF
Lecture 4
PPTX
imge enhncement sptil filtering55555.pptx
PPT
Digital Image Processing UNIT-2.ppt
PPT
3 intensity transformations and spatial filtering slides
PPSX
Image Processing: Spatial filters
PPTX
Smoothing in Digital Image Processing
PPTX
Image Enhancement using Frequency Domain Filters
PPTX
Image Restoration (Order Statistics Filters)
PDF
Spatial Domain Filtering.pdf
Spatial Filtering in intro image processingr
CSE367 Lecture- image sinal processing lecture
Lecture 6
Image_filtering (1).pptx
Lecture 06 - image processingcourse1.pptx
smoothing filters gaussion and median filters comparing.ppt
2. filtering basics
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
Notes on image processing
Image filtering in Digital image processing
06 spatial filtering DIP
Lecture 4
imge enhncement sptil filtering55555.pptx
Digital Image Processing UNIT-2.ppt
3 intensity transformations and spatial filtering slides
Image Processing: Spatial filters
Smoothing in Digital Image Processing
Image Enhancement using Frequency Domain Filters
Image Restoration (Order Statistics Filters)
Spatial Domain Filtering.pdf
Ad

More from DeepikaT13 (20)

PPTX
Mobile computing
PPTX
Image processing
PPT
aloha
PPT
Exceptions
PPTX
Hive architecture
PPTX
Rdbms
PPTX
Sotware engineering
PPTX
Data mining
PPT
Computer network
PPTX
Storage management in operating system
PPTX
PPTX
Data mining
PPTX
Neural network
PPTX
memory reference instruction
PPTX
breadth first search
PPTX
constructors
PPTX
Disjoint set
PPTX
Destructors
PPTX
Crisp set
PPTX
Computer registers
Mobile computing
Image processing
aloha
Exceptions
Hive architecture
Rdbms
Sotware engineering
Data mining
Computer network
Storage management in operating system
Data mining
Neural network
memory reference instruction
breadth first search
constructors
Disjoint set
Destructors
Crisp set
Computer registers

Recently uploaded (20)

PPTX
Cell Structure & Organelles in detailed.
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
master seminar digital applications in india
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Sports Quiz easy sports quiz sports quiz
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
VCE English Exam - Section C Student Revision Booklet
Cell Structure & Organelles in detailed.
GDM (1) (1).pptx small presentation for students
master seminar digital applications in india
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
human mycosis Human fungal infections are called human mycosis..pptx
01-Introduction-to-Information-Management.pdf
PPH.pptx obstetrics and gynecology in nursing
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Computing-Curriculum for Schools in Ghana
Sports Quiz easy sports quiz sports quiz
2.FourierTransform-ShortQuestionswithAnswers.pdf
RMMM.pdf make it easy to upload and study
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Renaissance Architecture: A Journey from Faith to Humanism
Abdominal Access Techniques with Prof. Dr. R K Mishra
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
O5-L3 Freight Transport Ops (International) V1.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
VCE English Exam - Section C Student Revision Booklet

Spatial filtering