SlideShare a Scribd company logo
• Role of Artificial Intelligence and Image
Processing in Computer Vision
• Industrial Machine Vision Applications
• System Architecture
• State of Art
CHAPTER 1
2
Introduction
• What is computer vision?
The analysis of digital images by a computer
3
The Three Stages of Computer Vision
7
Low-Level
blurring
sharpening
8
Low-Level
Canny
ORT
Mid-Level
original image edge image
edge image circular arcs and line segments
data
structure
9
Mid-level
K-means
clustering
original color image regions of homogeneous color
(followed by
connected
component
analysis)
data
structure
10
edge image
consistent
line clusters
low-level
mid-level
high-level
Low- to High-Level
Building Recognition
System Architecture
Typical Computer Vision System. The figure shows the basic components of a
computer vision system. The left most component is the scene or object of study. The
next required component shown in the figure is the sensing device used to collect
data from the scene. The third component is the computation device. The device
computes information such as visual cues and reasons on this information to generate
interpretations of the scene such as objects present or actions being performed.
System Architecture
Typical computer vision system involves three
components,
1. Scene under study
2. Sensing device that can be used to analyze
the scene (used to collect data from the
scene)
System Architecture
3. Computational device that can perform the analysis of the scene
based on the data from the sensor. The computation devices
generates two possible forms of data, information such as visual
cues, and interpretations of information such as actions being
performed or the presence of objects. The two forms of data can
each be used to refine the other until the output of the vision
system is computed with a predefined amount of certainty. The
result can be the 3D location for every pixel within and image or the
certainty that a person is performing jumping jacks. With proper
selection of the information and the interpretation algorithm,
computer vision systems can be applied in a large number of
applications.
14
Digital Image Terminology:
0 0 0 0 1 0 0
0 0 1 1 1 0 0
0 1 95 96 94 93 92
0 0 92 93 93 92 92
0 0 93 93 94 92 93
0 1 92 93 93 93 93
0 0 94 95 95 96 95
pixel (with value 94)
its 3x3 neighborhood
• binary image
• gray-scale (or gray-tone) image
• color image
• multi-spectral image
• range image
• labeled image
region of medium
intensity
resolution (7x7)
Spatial Filtering
Image filtering
Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htm
Slides from Steve Seitz and Rick Szeliski
Image filtering
Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htm
What is an image?
Images as functions
•We can think of an image as a function, f, from R2
to R:
– f( x, y ) gives the intensity at position ( x, y )
– Realistically, we expect the image only to be defined
over a rectangle, with a finite range:
• f: [a,b]x[c,d]  [0,1]
A color image is just three functions pasted together. We
can write this as a “vector-valued” function:
( , )
( , ) ( , )
( , )
r x y
f x y g x y
b x y
 
 
 
  
Images as functions
What is a digital image?
•We usually work with digital (discrete) images:
– Sample the 2D space on a regular grid
– Quantize each sample (round to nearest integer)
•If our samples are D apart, we can write this as:
f[i ,j] = Quantize{ f(i D, j D) }
Spatial Filtering (cont’d)
• The word “filtering” has been borrowed from
the frequency domain.
• 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 – 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
Filtering noise
•How can we “smooth” away noise in an
image?
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 100 130 110 120 110 0 0
0 0 0 110 90 100 90 100 0 0
0 0 0 130 100 90 130 110 0 0
0 0 0 120 100 130 110 120 0 0
0 0 0 90 110 80 120 100 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Mean filtering
Mean filtering
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 0 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 0 0 0 0 0 0 0
0 0 90 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 10 20 30 30 30 20 10
0 20 40 60 60 60 40 20
0 30 60 90 90 90 60 30
0 30 50 80 80 90 60 30
0 30 50 80 80 90 60 30
0 20 30 50 50 60 40 20
10 20 30 30 30 30 20 10
10 10 10 0 0 0 0 0
Cross-correlation filtering
•Let’s write this down as an equation. Assume
the averaging window is (2k+1)x(2k+1):
We can generalize this idea by allowing different weights for
different neighboring pixels:
This is called a cross-correlation operation and
written:
H is called the “filter,” “kernel,” or “mask.”
The above allows negative filter indices. When you implement
need to use: H[u+k,v+k] instead of H[u,v]
Mean kernel
•What’s the kernel for a 3x3 mean filter?
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 0 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 0 0 0 0 0 0 0
0 0 90 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Mean of neighborhood
Effect of filter size
Mean vs. Gaussian filtering
Gaussian filtering
• A Gaussian kernel gives less weight to pixels
further from the center of the window
Linear vs Non-Linear
Spatial Filtering Methods
• A filtering method is linear when the output is a weighted sum of
the input pixels.
• Methods that do not satisfy the above property are called non-
linear.
– e.g.,
Linear Spatial Filtering Methods
• Main linear spatial filtering methods:
– Correlation
– Convolution
Correlation (cont’d)
Often used in applications where
we need to measure the similarity
between images or parts of images
(e.g., template matching).
Convolution
• Similar to correlation except that the mask is
first flipped both horizontally and vertically.
Note: if w(i, j) is symmetric, that is w(i, j)=w(-i,-j),
then convolution is equivalent to correlation!
/2 /2
/2 /2
( , ) ( , ) ( , ) ( , ) ( , )
K K
s K t K
g i j w i j f i j w s t f i s j t
 
     
Image gradient
•How can we differentiate a digital image F[x,y]?
– Option 1: reconstruct a continuous image, f, then
take gradient
– Option 2: take discrete derivative (finite
difference)
Image gradient
It points in the direction of most rapid change in intensity
It points in the direction of most rapid change in intensity
smoothed – original
(scaled by 4, offset +128)
original smoothed (5x5 Gaussian)
Why does
this work?
Laplacian of Gaussian
(2nd derivative operator)
Gaussian delta function
More on filters…
•Cross-correlation/convolution is useful for, e.g.,
– Blurring
– Sharpening
– Edge Detection
– Interpolation
•Convolution has a number of nice properties
– Commutative, associative
– Convolution corresponds to product in the Fourier domain
•More sophisticated filtering techniques can often yield superior results for
these and other tasks:
– Polynomial (e.g., bicubic) filters
– Steerable filters
– Median filters
– Bilateral Filters
Filters
• We will mainly focus on two types of filters:
– Smoothing (low-pass)
– Sharpening (high-pass)
Smoothing Filters (low-pass)
• Useful for reducing noise and eliminating small details.
• The elements of the mask must be positive.
• Sum of mask elements is 1 (after normalization).
Gaussian
Smoothing filters – Example
smoothed imageinput image
• Useful for reducing noise and eliminating
small details.
Sharpening Filters (high-pass)
• Useful for highlighting fine details.
• The elements of the mask contain both
positive and negative weights.
• Sum of mask elements is 0.
1st derivative
of Gaussian
2nd derivative
of Gaussian
Sharpening Filters (cont’d)
• Useful for highlighting fine details.
– e.g., emphasize edges
Sharpening Filters - Example
• Note that the response of sharpening might be negative.
• Values must be re-mapped to [0, 255]
sharpened imageinput image
Smoothing Filters
• Averaging
• Gaussian
• Median filtering (non-linear)
Smoothing Filters: Averaging
Smoothing Filters: Averaging (cont’d)
• Mask size determines the degree of smoothing (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 Gaussian samples:
mask size is
a function of σ:
σ = 1.4
Smoothing filters: Gaussian (cont’d)
• σ controls the amount of smoothing
• As σ increases, more samples must be obtained to represent
the Gaussian function accurately.
σ = 3
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.
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:
- =
(after contrast
enhancement)
Sharpening Filters: High Boost
• Image sharpening emphasizes edges but low frequency
components are lost.
• High boost filter: amplify input image, then subtract a
lowpass image.
(A-1) + =
Sharpening Filters: High Boost (cont’d)
• If A=1, we get 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:
Sharpening Filters: High Boost (cont’d)
A=1.4 A=1.9
Sharpening Filters: Derivatives
• Taking the derivative of an image results in
sharpening the image.
• The derivative of an image (i.e., 2D signal) can
be computed using the gradient.
Laplacian
The Laplacian (2nd derivative) is defined as:
(dot product)
Approximate
2nd derivatives:
Laplacian (cont’d)
Laplacian Mask
Edges can be found
by detect the zero-crossings
Example: Laplacian vs Gradient
Laplacian Sobel
FOV (Field of View)
FOV (Field of View)
FOV (Field of View)

More Related Content

What's hot

Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
Amnaakhaan
 
Computer vision lane line detection
Computer vision lane line detectionComputer vision lane line detection
Computer vision lane line detection
Jonathan Mitchell
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
shabanam tamboli
 
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
Abhishek Mukherjee
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
Anuj Arora
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
Amnaakhaan
 
image-deblurring
image-deblurringimage-deblurring
image-deblurringErik Mayer
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
Marwa Al-Rikaby
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2Gichelle Amon
 
WaterFlowUDK
WaterFlowUDKWaterFlowUDK
WaterFlowUDKmin9202
 
5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1Gichelle Amon
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processing
VARUN KUMAR
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
Charles Deledalle
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
Prof. Dr. Subhasis Bose
 
Unit 3
Unit 3Unit 3
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptorszukun
 
Noise filtering
Noise filteringNoise filtering
Noise filteringAlaa Ahmed
 

What's hot (20)

Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
 
Computer vision lane line detection
Computer vision lane line detectionComputer vision lane line detection
Computer vision lane line detection
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
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
 
Spatial filtering using image processing
Spatial filtering using image processingSpatial filtering using image processing
Spatial filtering using image processing
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
 
Deblurring3
Deblurring3Deblurring3
Deblurring3
 
image-deblurring
image-deblurringimage-deblurring
image-deblurring
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
 
6 spatial filtering p2
6 spatial filtering p26 spatial filtering p2
6 spatial filtering p2
 
WaterFlowUDK
WaterFlowUDKWaterFlowUDK
WaterFlowUDK
 
5 spatial filtering p1
5 spatial filtering p15 spatial filtering p1
5 spatial filtering p1
 
Edge linking in image processing
Edge linking in image processingEdge linking in image processing
Edge linking in image processing
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
Unit 3
Unit 3Unit 3
Unit 3
 
Modern features-part-2-descriptors
Modern features-part-2-descriptorsModern features-part-2-descriptors
Modern features-part-2-descriptors
 
Noise filtering
Noise filteringNoise filtering
Noise filtering
 

Similar to 2. filtering basics

Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
kumarankit06875
 
Linear Image Processing
Linear Image Processing Linear Image Processing
Linear Image Processing
Avinash Rohra
 
Image enhancement
Image enhancementImage enhancement
Image enhancementAyaelshiwi
 
Mk slides.ppt
Mk slides.pptMk slides.ppt
Mk slides.ppt
Tabassum Saher
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
asodariyabhavesh
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
Hemantha Kulathilake
 
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehrDIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
studyd133
 
Adaptive unsharp masking
Adaptive unsharp maskingAdaptive unsharp masking
Adaptive unsharp masking
Ravi Teja
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
nagwaAboElenein
 
Lecture 5-2023.pdf
Lecture 5-2023.pdfLecture 5-2023.pdf
Lecture 5-2023.pdf
ssuserff72e4
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
ssuserc755f1
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
ssuserc755f1
 
Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)
Varun Ojha
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
Wael Sharba
 
Lecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_taskLecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_task
cairo university
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
DeepikaT13
 
03 image transformations_i
03 image transformations_i03 image transformations_i
03 image transformations_i
ankit_ppt
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
Surabhi Ks
 

Similar to 2. filtering basics (20)

Spatial Filtering in intro image processingr
Spatial Filtering in intro image processingrSpatial Filtering in intro image processingr
Spatial Filtering in intro image processingr
 
Linear Image Processing
Linear Image Processing Linear Image Processing
Linear Image Processing
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Mk slides.ppt
Mk slides.pptMk slides.ppt
Mk slides.ppt
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Digital Image Fundamentals - II
Digital Image Fundamentals - IIDigital Image Fundamentals - II
Digital Image Fundamentals - II
 
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehrDIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
DIP_Lecture6.pdf. jdowjwdieehekehdjejrejwhehr
 
Adaptive unsharp masking
Adaptive unsharp maskingAdaptive unsharp masking
Adaptive unsharp masking
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
Lecture 5-2023.pdf
Lecture 5-2023.pdfLecture 5-2023.pdf
Lecture 5-2023.pdf
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
 
CNN_AH.pptx
CNN_AH.pptxCNN_AH.pptx
CNN_AH.pptx
 
Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Lecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_taskLecture 9&10 computer vision segmentation-no_task
Lecture 9&10 computer vision segmentation-no_task
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
03 image transformations_i
03 image transformations_i03 image transformations_i
03 image transformations_i
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
3rd Seminar
3rd Seminar3rd Seminar
3rd Seminar
 
3rd Seminar
3rd Seminar3rd Seminar
3rd Seminar
 

Recently uploaded

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 

Recently uploaded (20)

Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 

2. filtering basics

  • 1. • Role of Artificial Intelligence and Image Processing in Computer Vision • Industrial Machine Vision Applications • System Architecture • State of Art CHAPTER 1
  • 2. 2 Introduction • What is computer vision? The analysis of digital images by a computer
  • 3. 3 The Three Stages of Computer Vision
  • 4.
  • 5.
  • 6.
  • 8. 8 Low-Level Canny ORT Mid-Level original image edge image edge image circular arcs and line segments data structure
  • 9. 9 Mid-level K-means clustering original color image regions of homogeneous color (followed by connected component analysis) data structure
  • 11. System Architecture Typical Computer Vision System. The figure shows the basic components of a computer vision system. The left most component is the scene or object of study. The next required component shown in the figure is the sensing device used to collect data from the scene. The third component is the computation device. The device computes information such as visual cues and reasons on this information to generate interpretations of the scene such as objects present or actions being performed.
  • 12. System Architecture Typical computer vision system involves three components, 1. Scene under study 2. Sensing device that can be used to analyze the scene (used to collect data from the scene)
  • 13. System Architecture 3. Computational device that can perform the analysis of the scene based on the data from the sensor. The computation devices generates two possible forms of data, information such as visual cues, and interpretations of information such as actions being performed or the presence of objects. The two forms of data can each be used to refine the other until the output of the vision system is computed with a predefined amount of certainty. The result can be the 3D location for every pixel within and image or the certainty that a person is performing jumping jacks. With proper selection of the information and the interpretation algorithm, computer vision systems can be applied in a large number of applications.
  • 14. 14 Digital Image Terminology: 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 1 95 96 94 93 92 0 0 92 93 93 92 92 0 0 93 93 94 92 93 0 1 92 93 93 93 93 0 0 94 95 95 96 95 pixel (with value 94) its 3x3 neighborhood • binary image • gray-scale (or gray-tone) image • color image • multi-spectral image • range image • labeled image region of medium intensity resolution (7x7)
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Image filtering Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htm Slides from Steve Seitz and Rick Szeliski
  • 21. Image filtering Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htm
  • 22. What is an image?
  • 23. Images as functions •We can think of an image as a function, f, from R2 to R: – f( x, y ) gives the intensity at position ( x, y ) – Realistically, we expect the image only to be defined over a rectangle, with a finite range: • f: [a,b]x[c,d]  [0,1]
  • 24. A color image is just three functions pasted together. We can write this as a “vector-valued” function: ( , ) ( , ) ( , ) ( , ) r x y f x y g x y b x y         
  • 26. What is a digital image? •We usually work with digital (discrete) images: – Sample the 2D space on a regular grid – Quantize each sample (round to nearest integer) •If our samples are D apart, we can write this as: f[i ,j] = Quantize{ f(i D, j D) }
  • 27.
  • 28.
  • 29. Spatial Filtering (cont’d) • The word “filtering” has been borrowed from the frequency domain. • 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)
  • 30. 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
  • 31. Filtering noise •How can we “smooth” away noise in an image? 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 130 110 120 110 0 0 0 0 0 110 90 100 90 100 0 0 0 0 0 130 100 90 130 110 0 0 0 0 0 120 100 130 110 120 0 0 0 0 0 90 110 80 120 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  • 33. Mean filtering 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 30 20 10 0 20 40 60 60 60 40 20 0 30 60 90 90 90 60 30 0 30 50 80 80 90 60 30 0 30 50 80 80 90 60 30 0 20 30 50 50 60 40 20 10 20 30 30 30 30 20 10 10 10 10 0 0 0 0 0
  • 34. Cross-correlation filtering •Let’s write this down as an equation. Assume the averaging window is (2k+1)x(2k+1): We can generalize this idea by allowing different weights for different neighboring pixels:
  • 35. This is called a cross-correlation operation and written: H is called the “filter,” “kernel,” or “mask.” The above allows negative filter indices. When you implement need to use: H[u+k,v+k] instead of H[u,v]
  • 36. Mean kernel •What’s the kernel for a 3x3 mean filter? 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 90 0 90 90 90 0 0 0 0 0 90 90 90 90 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  • 39. Mean vs. Gaussian filtering
  • 40. Gaussian filtering • A Gaussian kernel gives less weight to pixels further from the center of the window
  • 41.
  • 42. Linear vs Non-Linear Spatial Filtering Methods • A filtering method is linear when the output is a weighted sum of the input pixels. • Methods that do not satisfy the above property are called non- linear. – e.g.,
  • 43. Linear Spatial Filtering Methods • Main linear spatial filtering methods: – Correlation – Convolution
  • 44.
  • 45. Correlation (cont’d) Often used in applications where we need to measure the similarity between images or parts of images (e.g., template matching).
  • 46. Convolution • Similar to correlation except that the mask is first flipped both horizontally and vertically. Note: if w(i, j) is symmetric, that is w(i, j)=w(-i,-j), then convolution is equivalent to correlation! /2 /2 /2 /2 ( , ) ( , ) ( , ) ( , ) ( , ) K K s K t K g i j w i j f i j w s t f i s j t        
  • 47. Image gradient •How can we differentiate a digital image F[x,y]? – Option 1: reconstruct a continuous image, f, then take gradient – Option 2: take discrete derivative (finite difference)
  • 48. Image gradient It points in the direction of most rapid change in intensity
  • 49. It points in the direction of most rapid change in intensity
  • 50.
  • 51.
  • 52. smoothed – original (scaled by 4, offset +128) original smoothed (5x5 Gaussian) Why does this work?
  • 53. Laplacian of Gaussian (2nd derivative operator) Gaussian delta function
  • 54. More on filters… •Cross-correlation/convolution is useful for, e.g., – Blurring – Sharpening – Edge Detection – Interpolation •Convolution has a number of nice properties – Commutative, associative – Convolution corresponds to product in the Fourier domain •More sophisticated filtering techniques can often yield superior results for these and other tasks: – Polynomial (e.g., bicubic) filters – Steerable filters – Median filters – Bilateral Filters
  • 55. Filters • We will mainly focus on two types of filters: – Smoothing (low-pass) – Sharpening (high-pass)
  • 56. Smoothing Filters (low-pass) • Useful for reducing noise and eliminating small details. • The elements of the mask must be positive. • Sum of mask elements is 1 (after normalization). Gaussian
  • 57. Smoothing filters – Example smoothed imageinput image • Useful for reducing noise and eliminating small details.
  • 58. Sharpening Filters (high-pass) • Useful for highlighting fine details. • The elements of the mask contain both positive and negative weights. • Sum of mask elements is 0. 1st derivative of Gaussian 2nd derivative of Gaussian
  • 59. Sharpening Filters (cont’d) • Useful for highlighting fine details. – e.g., emphasize edges
  • 60. Sharpening Filters - Example • Note that the response of sharpening might be negative. • Values must be re-mapped to [0, 255] sharpened imageinput image
  • 61. Smoothing Filters • Averaging • Gaussian • Median filtering (non-linear)
  • 63. Smoothing Filters: Averaging (cont’d) • Mask size determines the degree of smoothing (loss of detail). 3x3 5x5 7x7 15x15 25x25 original
  • 64. Smoothing Filters: Averaging (cont’d) 15 x 15 averaging image thresholding Example: extract largest, brightest objects
  • 65. Smoothing filters: Gaussian • The weights are Gaussian samples: mask size is a function of σ: σ = 1.4
  • 66. Smoothing filters: Gaussian (cont’d) • σ controls the amount of smoothing • As σ increases, more samples must be obtained to represent the Gaussian function accurately. σ = 3
  • 68. Averaging vs Gaussian Smoothing Averaging Gaussian
  • 69. 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
  • 70. Smoothing Filters: Median Filtering (cont’d) • Replace each pixel by the median in a neighborhood around the pixel.
  • 71. Sharpening Filters • Unsharp masking • High Boost filter • Gradient (1st derivative) • Laplacian (2nd derivative)
  • 72. Sharpening Filters: Unsharp Masking • Obtain a sharp image by subtracting a lowpass filtered (i.e., smoothed) image from the original image: - = (after contrast enhancement)
  • 73. Sharpening Filters: High Boost • Image sharpening emphasizes edges but low frequency components are lost. • High boost filter: amplify input image, then subtract a lowpass image. (A-1) + =
  • 74. Sharpening Filters: High Boost (cont’d) • If A=1, we get 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:
  • 75. Sharpening Filters: High Boost (cont’d) A=1.4 A=1.9
  • 76. Sharpening Filters: Derivatives • Taking the derivative of an image results in sharpening the image. • The derivative of an image (i.e., 2D signal) can be computed using the gradient.
  • 77. Laplacian The Laplacian (2nd derivative) is defined as: (dot product) Approximate 2nd derivatives:
  • 78. Laplacian (cont’d) Laplacian Mask Edges can be found by detect the zero-crossings
  • 79. Example: Laplacian vs Gradient Laplacian Sobel
  • 80.
  • 81. FOV (Field of View)
  • 82. FOV (Field of View)
  • 83. FOV (Field of View)