SlideShare a Scribd company logo
1 of 33
Course: Machine Vision
Image Filtering (1)
Session 04
D5627 – I Gede Putra Kusuma Negara, B.Eng., PhD
Outline
• Filtering in Spatial Domain
• First derivative filters
• Second derivative filters
Filtering in Spatial Domain
Image Processing
in Spatial Domain
• Image processing approaches fall into two broad categories:
1. Spatial domain methods
2. Frequency domain methods
• Spatial domain refers to the image itself, approaches in this category
are based on direct manipulation of the pixels in an image
• Frequency domain methods are based on modifying the Fourier
transform of an image
• Filtering is one of many image processing techniques that can be
used for image enhancement or feature extraction such as edge,
line, etc.
Image Filtering
Image filtering: compute function of local neighborhood at each position
Examples:
• Smoothing by averaging
form the average of pixels in a neighborhood
• Smoothing with a Gaussian
form a weighted average of pixels in a neighborhood
• Finding a derivative
form a weighted average of pixels in a neighborhood
Linear Filters
• General process:
Form new image whose pixels are a weighted sum of original pixel values
(neighborhood), using the same set of weights at each point.
h(k,l) called the weight kernel or filter coefficients. The above correlation operator
can be notated as
• Properties:
1. Output is a linear function of the input
2. Output is a shift-invariant function of the input (i.e. shift the input image two
pixels to the left, the output is shifted two pixels to the left)
g(i, j) = f (i+k, j +l)h(k,l)
k,l
å
g = f Ä h
Spatial Filtering Process
r s t
u v w
x y z
Origin x
y Image f (x, y)
eprocessed = v*e +
r*a + s*b + t*c +
u*d + w*f +
x*g + y*h + z*i
Filter
Simple 3*3
Neighbourhood
e 3*3 Filter
a b c
d e f
g h i
Original
Image Pixels
*
The above step is repeated for every pixel in the original image to
generate the filtered image
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 neighborhood
around a central value
• Especially useful
in removing noise
from images or highlighting
gross detail
1/9
1/9
1/9
1/9
1/9
1/9
1/9
1/9
1/9
3x3 filter
Input image After 11x11 averaging
filter applied
Weighted Smoothing Filters
• More effective smoothing
filters can be generated by
allowing different pixels in
the neighborhood different
weights (example: Gaussian)
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
3x3 filter
Input image After 11x11 Gaussian
filter applied
Dealing with Edge Pixels
• At the edges of an image we
are missing pixels to form a
neighborhood
Origin x
y Image f (x, y)
e
e
e
e
e e
e
Dealing with Edge Pixels
• 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
Original
Image
Filtered Image:
Zero Padding
Filtered Image:
Wrap Around
Edge Pixels
Filtered Image:
Replicate Edge
Pixels
First Derivative Filters
Spatial Differentiation
• Differentiation measures the rate of change of a function
• Consider a simple 1 dimensional example
First Derivative
• The formula for the 1st derivative of a function is as follows:
• It’s just the difference between subsequent values and measures the
rate of change of the function
)
(
)
1
( x
f
x
f
x
f





First Derivative
Second Derivative Filters
Second Derivative
• The formula for the 2nd derivative of a function is as follows:
• Simply takes into account the values both before and after the current
value
)
(
2
)
1
(
)
1
(
2
2
x
f
x
f
x
f
x
f







Second Derivative
Second Derivatives
For Image Enhancement
• The 2nd derivative is more useful for image enhancement
than the 1st derivative
– Stronger response to fine detail
– Simpler implementation
• The first sharpening filter we will look at is the Laplacian
– Isotropic
– One of the simplest sharpening filters
The Laplacian
• The Laplacian is defined as follows:
• where the partial 2st order derivative in the x direction is defined as
follows:
• and in the y direction as follows:
y
f
x
f
f 2
2
2
2
2







)
,
(
2
)
,
1
(
)
,
1
(
2
2
y
x
f
y
x
f
y
x
f
x
f







)
,
(
2
)
1
,
(
)
1
,
(
2
2
y
x
f
y
x
f
y
x
f
y
f







The Laplacian
• So, the Laplacian can be given as follows:
• We can easily build a filter based on this
2
f =[ f (x+1,y)+ f (x-1,y)+ f (x,y+1)+ f (x,y-1)]-4 f (x,y)
0 1 0
1 -4 1
0 1 0
The Laplacian (example)
• Applying the Laplacian to an image we get a new image that highlights
edges and other discontinuities
Original Image Laplacian filtered Image
Laplacian Filter
for Image Sharpening
• The result of a Laplacian filtering is not an enhanced image
• We have to do more work in order to get our final image
• Subtract the Laplacian result from the original image to generate our
final sharpened enhanced image f
y
x
f
y
x
g 2
)
,
(
)
,
( 


- =
Simplification of
Sharpening Steps
• The entire enhancement can be combined into a single filtering
operation
)
,
1
(
)
,
1
(
[
)
,
( y
x
f
y
x
f
y
x
f 




)
1
,
(
)
1
,
( 


 y
x
f
y
x
f
)]
,
(
4 y
x
f

f
y
x
f
y
x
g 2
)
,
(
)
,
( 


)
,
1
(
)
,
1
(
)
,
(
5 y
x
f
y
x
f
y
x
f 




)
1
,
(
)
1
,
( 


 y
x
f
y
x
f
Simplification of
Sharpening Steps (example)
0 -1 0
-1 5 -1
0 -1 0
=
Variation of Laplacian Filter
-1 -1 1
-1 9 -1
-1 -1 -1
=
1 1 1
1 -8 1
1 1 1
Variant of
Laplacian
First Derivative Filtering
• Implementing 1st derivative filters is difficult in practice
• For a function f(x, y) the gradient of f at coordinates (x, y) is given as
the column vector:

























y
f
x
f
G
G
y
x
f
First Derivative Filtering
• The magnitude of this vector is given by:
• For practical reasons this can be simplified as:
)
f
(

 mag
f
  2
1
2
2
y
x G
G 

2
1
2
2




























y
f
x
f
y
x G
G
f 


First Derivative Filtering
• There is some debate as to how best to calculate these gradients but
we will use:
• which is based on these coordinates
   
3
2
1
9
8
7 2
2 z
z
z
z
z
z
f 






   
7
4
1
9
6
3 2
2 z
z
z
z
z
z 





z1 z2 z3
z4 z5 z6
z7 z8 z9
Sobel Operators
• Based on the previous equations we can derive the Sobel Operators
• To filter an image it is filtered using both operators the results of
which are added together
-1 -2 -1
0 0 0
1 2 1
-1 0 1
-2 0 2
-1 0 1
Sobel (example)
-1 -2 -1
0 0 0
1 2 1
-1 0 1
-2 0 2
-1 0 1
+
=
=
=
Acknowledgment
Some of slides in this PowerPoint presentation are adaptation from
various slides, many thanks to:
1. Dr. Brian Mac Namee, School of Computing at the Dublin Institute
of Technology (http://www.comp.dit.ie/bmacnamee/gaip.htm)
Thank You

More Related Content

What's hot (20)

Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Im seg04
Im seg04Im seg04
Im seg04
 
PPT s03-machine vision-s2
PPT s03-machine vision-s2PPT s03-machine vision-s2
PPT s03-machine vision-s2
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
PPT s02-machine vision-s2
PPT s02-machine vision-s2PPT s02-machine vision-s2
PPT s02-machine vision-s2
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processing
 
Basics of edge detection and forier transform
Basics of edge detection and forier transformBasics of edge detection and forier transform
Basics of edge detection and forier transform
 
Edge Detection algorithm and code
Edge Detection algorithm and codeEdge Detection algorithm and code
Edge Detection algorithm and code
 
Image Segmentation
 Image Segmentation Image Segmentation
Image Segmentation
 
Exploring Methods to Improve Edge Detection with Canny Algorithm
Exploring Methods to Improve Edge Detection with Canny AlgorithmExploring Methods to Improve Edge Detection with Canny Algorithm
Exploring Methods to Improve Edge Detection with Canny Algorithm
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Graph Image Segmentation
Graph Image SegmentationGraph Image Segmentation
Graph Image Segmentation
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Segmentation Techniques -I
Segmentation Techniques -ISegmentation Techniques -I
Segmentation Techniques -I
 
Feature detection and matching
Feature detection and matchingFeature detection and matching
Feature detection and matching
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 

Similar to PPT s04-machine vision-s2

Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.pptssuser4bbfb1
 
A Presentation on various techniques used in Image Filtering
A Presentation on various techniques used in Image FilteringA Presentation on various techniques used in Image Filtering
A Presentation on various techniques used in Image FilteringPaperkutsBooks
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatialElsayed Hemayed
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingrkumarankit06875
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image ProcessingPallavi Agarwal
 
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
 
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSINGLAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSINGPriyanka Rathore
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureFatmaNewagy1
 
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
 
Spatial enhancement
Spatial enhancement Spatial enhancement
Spatial enhancement abinarkt
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptxwdwd10
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfilteringJohn Williams
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIPbabak danyal
 

Similar to PPT s04-machine vision-s2 (20)

Spatial domain filtering.ppt
Spatial domain filtering.pptSpatial domain filtering.ppt
Spatial domain filtering.ppt
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
A Presentation on various techniques used in Image Filtering
A Presentation on various techniques used in Image FilteringA Presentation on various techniques used in Image Filtering
A Presentation on various techniques used in Image Filtering
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial
 
Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
 
Module 31
Module 31Module 31
Module 31
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
DIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.pptxDIP -Unit 3 ppt.pptx
DIP -Unit 3 ppt.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
 
Digital image processing
Digital image processing  Digital image processing
Digital image processing
 
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSINGLAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lecture
 
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
 
Review (1)
Review (1)Review (1)
Review (1)
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
Spatial enhancement
Spatial enhancement Spatial enhancement
Spatial enhancement
 
Image_filtering (1).pptx
Image_filtering (1).pptxImage_filtering (1).pptx
Image_filtering (1).pptx
 
Image processing spatialfiltering
Image processing spatialfilteringImage processing spatialfiltering
Image processing spatialfiltering
 
06 spatial filtering DIP
06 spatial filtering DIP06 spatial filtering DIP
06 spatial filtering DIP
 

More from Binus Online Learning

PPT Sesi 2 FO the guest delivering quality-1
PPT Sesi 2 FO the guest delivering quality-1PPT Sesi 2 FO the guest delivering quality-1
PPT Sesi 2 FO the guest delivering quality-1Binus Online Learning
 
PPT Sesi 3 FO the guest - delivering quality 2
PPT Sesi 3 FO the guest - delivering quality 2 PPT Sesi 3 FO the guest - delivering quality 2
PPT Sesi 3 FO the guest - delivering quality 2 Binus Online Learning
 
LN sesi 4 managing guest reservation-1
LN sesi 4 managing guest reservation-1LN sesi 4 managing guest reservation-1
LN sesi 4 managing guest reservation-1Binus Online Learning
 

More from Binus Online Learning (20)

LN s12-machine vision-s2
LN s12-machine vision-s2LN s12-machine vision-s2
LN s12-machine vision-s2
 
LN s11-machine vision-s2
LN s11-machine vision-s2LN s11-machine vision-s2
LN s11-machine vision-s2
 
LN s10-machine vision-s2
LN s10-machine vision-s2LN s10-machine vision-s2
LN s10-machine vision-s2
 
LN s09-machine vision-s2
LN s09-machine vision-s2LN s09-machine vision-s2
LN s09-machine vision-s2
 
LN s08-machine vision-s2
LN s08-machine vision-s2LN s08-machine vision-s2
LN s08-machine vision-s2
 
LN s07-machine vision-s2
LN s07-machine vision-s2LN s07-machine vision-s2
LN s07-machine vision-s2
 
LN s06-machine vision-s2
LN s06-machine vision-s2LN s06-machine vision-s2
LN s06-machine vision-s2
 
LN s04-machine vision-s2
LN s04-machine vision-s2LN s04-machine vision-s2
LN s04-machine vision-s2
 
LN s03-machine vision-s2
LN s03-machine vision-s2LN s03-machine vision-s2
LN s03-machine vision-s2
 
LN s02-machine vision-s2
LN s02-machine vision-s2LN s02-machine vision-s2
LN s02-machine vision-s2
 
LN s01-machine vision-s2
LN s01-machine vision-s2LN s01-machine vision-s2
LN s01-machine vision-s2
 
PPT s09-machine vision-s2
PPT s09-machine vision-s2PPT s09-machine vision-s2
PPT s09-machine vision-s2
 
PPT s06-machine vision-s2
PPT s06-machine vision-s2PPT s06-machine vision-s2
PPT s06-machine vision-s2
 
PPT s05-machine vision-s2
PPT s05-machine vision-s2PPT s05-machine vision-s2
PPT s05-machine vision-s2
 
PPT s01-machine vision-s2
PPT s01-machine vision-s2PPT s01-machine vision-s2
PPT s01-machine vision-s2
 
LN sesi 2 delivering quality-1
LN sesi 2 delivering quality-1LN sesi 2 delivering quality-1
LN sesi 2 delivering quality-1
 
PPT Sesi 2 FO the guest delivering quality-1
PPT Sesi 2 FO the guest delivering quality-1PPT Sesi 2 FO the guest delivering quality-1
PPT Sesi 2 FO the guest delivering quality-1
 
PPT Sesi 3 FO the guest - delivering quality 2
PPT Sesi 3 FO the guest - delivering quality 2 PPT Sesi 3 FO the guest - delivering quality 2
PPT Sesi 3 FO the guest - delivering quality 2
 
LN sesi 3 delivering quality-2
LN sesi 3 delivering quality-2LN sesi 3 delivering quality-2
LN sesi 3 delivering quality-2
 
LN sesi 4 managing guest reservation-1
LN sesi 4 managing guest reservation-1LN sesi 4 managing guest reservation-1
LN sesi 4 managing guest reservation-1
 

Recently uploaded

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
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
 
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
 
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
 
(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
 
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
 
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
 
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
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
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
 
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...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
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
 
(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 ] ...
 
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
 
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
 
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 ...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha 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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 

PPT s04-machine vision-s2

  • 1. Course: Machine Vision Image Filtering (1) Session 04 D5627 – I Gede Putra Kusuma Negara, B.Eng., PhD
  • 2. Outline • Filtering in Spatial Domain • First derivative filters • Second derivative filters
  • 4. Image Processing in Spatial Domain • Image processing approaches fall into two broad categories: 1. Spatial domain methods 2. Frequency domain methods • Spatial domain refers to the image itself, approaches in this category are based on direct manipulation of the pixels in an image • Frequency domain methods are based on modifying the Fourier transform of an image • Filtering is one of many image processing techniques that can be used for image enhancement or feature extraction such as edge, line, etc.
  • 5. Image Filtering Image filtering: compute function of local neighborhood at each position Examples: • Smoothing by averaging form the average of pixels in a neighborhood • Smoothing with a Gaussian form a weighted average of pixels in a neighborhood • Finding a derivative form a weighted average of pixels in a neighborhood
  • 6. Linear Filters • General process: Form new image whose pixels are a weighted sum of original pixel values (neighborhood), using the same set of weights at each point. h(k,l) called the weight kernel or filter coefficients. The above correlation operator can be notated as • Properties: 1. Output is a linear function of the input 2. Output is a shift-invariant function of the input (i.e. shift the input image two pixels to the left, the output is shifted two pixels to the left) g(i, j) = f (i+k, j +l)h(k,l) k,l å g = f Ä h
  • 7. Spatial Filtering Process r s t u v w x y z Origin x y Image f (x, y) eprocessed = v*e + r*a + s*b + t*c + u*d + w*f + x*g + y*h + z*i Filter Simple 3*3 Neighbourhood e 3*3 Filter a b c d e f g h i Original Image Pixels * The above step is repeated for every pixel in the original image to generate the filtered image
  • 8. 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 neighborhood around a central value • Especially useful in removing noise from images or highlighting gross detail 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 3x3 filter Input image After 11x11 averaging filter applied
  • 9. Weighted Smoothing Filters • More effective smoothing filters can be generated by allowing different pixels in the neighborhood different weights (example: Gaussian) 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 3x3 filter Input image After 11x11 Gaussian filter applied
  • 10. Dealing with Edge Pixels • At the edges of an image we are missing pixels to form a neighborhood Origin x y Image f (x, y) e e e e e e e
  • 11. Dealing with Edge Pixels • 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 Original Image Filtered Image: Zero Padding Filtered Image: Wrap Around Edge Pixels Filtered Image: Replicate Edge Pixels
  • 13. Spatial Differentiation • Differentiation measures the rate of change of a function • Consider a simple 1 dimensional example
  • 14. First Derivative • The formula for the 1st derivative of a function is as follows: • It’s just the difference between subsequent values and measures the rate of change of the function ) ( ) 1 ( x f x f x f     
  • 17. Second Derivative • The formula for the 2nd derivative of a function is as follows: • Simply takes into account the values both before and after the current value ) ( 2 ) 1 ( ) 1 ( 2 2 x f x f x f x f       
  • 19. Second Derivatives For Image Enhancement • The 2nd derivative is more useful for image enhancement than the 1st derivative – Stronger response to fine detail – Simpler implementation • The first sharpening filter we will look at is the Laplacian – Isotropic – One of the simplest sharpening filters
  • 20. The Laplacian • The Laplacian is defined as follows: • where the partial 2st order derivative in the x direction is defined as follows: • and in the y direction as follows: y f x f f 2 2 2 2 2        ) , ( 2 ) , 1 ( ) , 1 ( 2 2 y x f y x f y x f x f        ) , ( 2 ) 1 , ( ) 1 , ( 2 2 y x f y x f y x f y f       
  • 21. The Laplacian • So, the Laplacian can be given as follows: • We can easily build a filter based on this 2 f =[ f (x+1,y)+ f (x-1,y)+ f (x,y+1)+ f (x,y-1)]-4 f (x,y) 0 1 0 1 -4 1 0 1 0
  • 22. The Laplacian (example) • Applying the Laplacian to an image we get a new image that highlights edges and other discontinuities Original Image Laplacian filtered Image
  • 23. Laplacian Filter for Image Sharpening • The result of a Laplacian filtering is not an enhanced image • We have to do more work in order to get our final image • Subtract the Laplacian result from the original image to generate our final sharpened enhanced image f y x f y x g 2 ) , ( ) , (    - =
  • 24. Simplification of Sharpening Steps • The entire enhancement can be combined into a single filtering operation ) , 1 ( ) , 1 ( [ ) , ( y x f y x f y x f      ) 1 , ( ) 1 , (     y x f y x f )] , ( 4 y x f  f y x f y x g 2 ) , ( ) , (    ) , 1 ( ) , 1 ( ) , ( 5 y x f y x f y x f      ) 1 , ( ) 1 , (     y x f y x f
  • 25. Simplification of Sharpening Steps (example) 0 -1 0 -1 5 -1 0 -1 0 =
  • 26. Variation of Laplacian Filter -1 -1 1 -1 9 -1 -1 -1 -1 = 1 1 1 1 -8 1 1 1 1 Variant of Laplacian
  • 27. First Derivative Filtering • Implementing 1st derivative filters is difficult in practice • For a function f(x, y) the gradient of f at coordinates (x, y) is given as the column vector:                          y f x f G G y x f
  • 28. First Derivative Filtering • The magnitude of this vector is given by: • For practical reasons this can be simplified as: ) f (   mag f   2 1 2 2 y x G G   2 1 2 2                             y f x f y x G G f   
  • 29. First Derivative Filtering • There is some debate as to how best to calculate these gradients but we will use: • which is based on these coordinates     3 2 1 9 8 7 2 2 z z z z z z f            7 4 1 9 6 3 2 2 z z z z z z       z1 z2 z3 z4 z5 z6 z7 z8 z9
  • 30. Sobel Operators • Based on the previous equations we can derive the Sobel Operators • To filter an image it is filtered using both operators the results of which are added together -1 -2 -1 0 0 0 1 2 1 -1 0 1 -2 0 2 -1 0 1
  • 31. Sobel (example) -1 -2 -1 0 0 0 1 2 1 -1 0 1 -2 0 2 -1 0 1 + = = =
  • 32. Acknowledgment Some of slides in this PowerPoint presentation are adaptation from various slides, many thanks to: 1. Dr. Brian Mac Namee, School of Computing at the Dublin Institute of Technology (http://www.comp.dit.ie/bmacnamee/gaip.htm)