SlideShare a Scribd company logo
Edge detection
• Goal: Identify sudden
changes (discontinuities) in
an image
• Intuitively, most semantic and shape
information from the image can be
encoded in the edges
• More compact than pixels
• Ideal: artist’s line drawing
(but artist is also using
object-level knowledge)
Source: D. Lowe
Origin of Edges
Edges are caused by a variety of factors
depth discontinuity
surface color discontinuity
illumination discontinuity
surface normal discontinuity
Source: Steve Seitz
Characterizing edges
• An edge is a place of rapid change in the
image intensity function
image
intensity function
(along horizontal scanline) first derivative
edges correspond to
extrema of derivative
The gradient points in the direction of most rapid increase
in intensity
Image gradient
The gradient of an image:
The gradient direction is given by
• how does this relate to the direction of the edge?
The edge strength is given by the gradient magnitude
Source: Steve Seitz
Differentiation and convolution
Recall, for 2D function,
f(x,y):
This is linear and shift
invariant, so must be
the result of a
convolution.
We could approximate
this as
(which is obviously a
convolution)
-1 1
Source: D. Forsyth, D. Lowe
Finite difference filters
Other approximations of derivative filters exist:
Source: K. Grauman
Finite differences: example
Which one is the gradient in the x-direction (resp. y-direction)?
Effects of noise
Consider a single row or column of the image
• Plotting intensity as a function of position gives a signal
Where is the edge?
Source: S. Seitz
Effects of noise
• Finite difference filters respond strongly to
noise
• Image noise results in pixels that look very different from
their neighbors
• Generally, the larger the noise the stronger the response
• What is to be done?
Source: D. Forsyth
Effects of noise
• Finite difference filters respond strongly to
noise
• Image noise results in pixels that look very different from
their neighbors
• Generally, the larger the noise the stronger the response
• What is to be done?
• Smoothing the image should help, by forcing pixels different
to their neighbors (=noise pixels?) to look more like
neighbors
Source: D. Forsyth
Solution: smooth first
• To find edges, look for peaks in )
( g
f
dx
d
∗
f
g
f * g
)
( g
f
dx
d
∗
Source: S. Seitz
• Differentiation is convolution, and convolution
is associative:
• This saves us one operation:
g
dx
d
f
g
f
dx
d
∗
=
∗ )
(
Derivative theorem of convolution
g
dx
d
f ∗
f
g
dx
d
Source: S. Seitz
Derivative of Gaussian filter
Is this filter separable?
* [1 -1] =
Derivative of Gaussian filter
Which one finds horizontal/vertical edges?
x-direction y-direction
Smoothed derivative removes noise, but blurs
edge. Also finds edges at different “scales”.
1 pixel 3 pixels 7 pixels
Tradeoff between smoothing and localization
Source: D. Forsyth
• The gradient magnitude is large along a thick
“trail” or “ridge,” so how do we identify the actual
edge points?
• How do we link the edge points to form curves?
Implementation issues
Source: D. Forsyth
Designing an edge detector
• Criteria for an “optimal” edge detector:
• Good detection: the optimal detector must minimize the
probability of false positives (detecting spurious edges caused by
noise), as well as that of false negatives (missing real edges)
• Good localization: the edges detected must be as close as
possible to the true edges
• Single response: the detector must return one point only for each
true edge point; that is, minimize the number of local maxima
around the true edge
Source: L. Fei-Fei
Canny edge detector
• This is probably the most widely used edge
detector in computer vision
• Theoretical model: step-edges corrupted by
additive Gaussian noise
• Canny has shown that the first derivative of
the Gaussian closely approximates the
operator that optimizes the product of signal-
to-noise ratio and localization
J. Canny, A Computational Approach To Edge Detection, IEEE
Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.
Source: L. Fei-Fei
Canny edge detector
1. Filter image with derivative of Gaussian
2. Find magnitude and orientation of gradient
3. Non-maximum suppression:
• Thin multi-pixel wide “ridges” down to single pixel width
4. Linking and thresholding (hysteresis):
• Define two thresholds: low and high
• Use the high threshold to start edge curves and the low
threshold to continue them
MATLAB: edge(image, ‘canny’)
Source: D. Lowe, L. Fei-Fei
Example
original image (Lena)
Example
norm of the gradient
Example
thresholding
Example
thinning
(non-maximum suppression)
Non-maximum suppression
At q, we have a
maximum if the
value is larger
than those at
both p and at r.
Interpolate to
get these
values.
Source: D. Forsyth
Assume the marked
point is an edge point.
Then we construct the
tangent to the edge
curve (which is normal
to the gradient at that
point) and use this to
predict the next points
(here either r or s).
Edge linking
Source: D. Forsyth
Hysteresis thresholding
Check that maximum value of gradient value is
sufficiently large
• drop-outs? use hysteresis
– use a high threshold to start edge curves and a low threshold to
continue them.
Source: S. Seitz
Hysteresis thresholding
original image
high threshold
(strong edges)
low threshold
(weak edges)
hysteresis threshold
Source: L. Fei-Fei
Effect of σ (Gaussian kernel spread/size)
Canny with Canny with
original
The choice of σ depends on desired behavior
• large σ detects large scale edges
• small σ detects fine features
Source: S. Seitz
Edge detection is just the beginning…
Berkeley segmentation database:
http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/
image human segmentation gradient magnitude
Next: Corner and blob detection

More Related Content

PDF
Lec07 corner blob
PDF
Lec05 filter
PPTX
Lec13 stereo converted
PDF
Lec09 hough
PDF
Lec10 alignment
PDF
Lec03 light
PDF
Lec04 color
PDF
Lec14 multiview stereo
Lec07 corner blob
Lec05 filter
Lec13 stereo converted
Lec09 hough
Lec10 alignment
Lec03 light
Lec04 color
Lec14 multiview stereo

What's hot (17)

PDF
Lec02 camera
PDF
Lec08 fitting
PPTX
Lec11 single view-converted
PDF
Lec15 sfm
PPT
Multi-Image Matching
PPT
Lighting and shading
PDF
Lec12 epipolar
PPT
Edges and lines
PPT
Lighting and shading
PDF
Modern features-part-2-descriptors
PPTX
Illumination Model
PPT
GRPHICS06 - Shading
PDF
SURF - Speeded Up Robust Features
PDF
Phong Shading over any Polygonal Surface
PPT
Michal Erel's SIFT presentation
PDF
Edge detection
PPTX
Canny Edge Detection
Lec02 camera
Lec08 fitting
Lec11 single view-converted
Lec15 sfm
Multi-Image Matching
Lighting and shading
Lec12 epipolar
Edges and lines
Lighting and shading
Modern features-part-2-descriptors
Illumination Model
GRPHICS06 - Shading
SURF - Speeded Up Robust Features
Phong Shading over any Polygonal Surface
Michal Erel's SIFT presentation
Edge detection
Canny Edge Detection
Ad

Similar to Lec06 edge (20)

PPT
Feature Detection and Matching
PPTX
Computer vision - edge detection
PPTX
Introduction to Edges Detection Techniques
PPTX
Lecture 06 - image processingcourse1.pptx
PPTX
Lecture_07_InterestPoints_computer_vision.pptx
PDF
Corners, Blobs and Descriptors in Computer Vision
PPT
IVP_segmentation ppt for image segmentation used in computer graphics
PPSX
Edge Detection and Segmentation
PPT
Canny Edge Detection in image processing
DOC
Seminar report on edge detection of video using matlab code
PPT
EDGEDETECTION algorithm and theory for image processing
PPTX
Fuzzy Logic Based Edge Detection
PDF
Lecture 6-computer vision features descriptors matching
PDF
Diffraction
PPTX
study Diffusion Curves: A Vector Representation for Smooth-Shaded Images
PPT
Chapter10 image segmentation
PPTX
Defocus magnification
PPT
Filtering.ppt
PPTX
lec04_harris_for_web computer vision and
PPTX
Edge Detection
Feature Detection and Matching
Computer vision - edge detection
Introduction to Edges Detection Techniques
Lecture 06 - image processingcourse1.pptx
Lecture_07_InterestPoints_computer_vision.pptx
Corners, Blobs and Descriptors in Computer Vision
IVP_segmentation ppt for image segmentation used in computer graphics
Edge Detection and Segmentation
Canny Edge Detection in image processing
Seminar report on edge detection of video using matlab code
EDGEDETECTION algorithm and theory for image processing
Fuzzy Logic Based Edge Detection
Lecture 6-computer vision features descriptors matching
Diffraction
study Diffusion Curves: A Vector Representation for Smooth-Shaded Images
Chapter10 image segmentation
Defocus magnification
Filtering.ppt
lec04_harris_for_web computer vision and
Edge Detection
Ad

More from BaliThorat1 (17)

PDF
8 operating system concept
PDF
7 processor
PDF
6 input output devices
PDF
2 windows operating system
PDF
5 computer memory
PDF
4 computer languages
PDF
1 fundamentals of computer
PDF
1 fundamentals of computer system
PDF
Computer generation and classification
PDF
Algorithm and flowchart
PDF
6 cpu scheduling
PDF
5 process synchronization
PDF
4 threads
PDF
3 processes
PDF
2 os structure
PDF
1 intro and overview
PDF
Lec01 introduction
8 operating system concept
7 processor
6 input output devices
2 windows operating system
5 computer memory
4 computer languages
1 fundamentals of computer
1 fundamentals of computer system
Computer generation and classification
Algorithm and flowchart
6 cpu scheduling
5 process synchronization
4 threads
3 processes
2 os structure
1 intro and overview
Lec01 introduction

Recently uploaded (20)

PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
Trump Administration's workforce development strategy
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
advance database management system book.pdf
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PPTX
Introduction to Building Materials
PDF
Empowerment Technology for Senior High School Guide
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Computer Architecture Input Output Memory.pptx
FORM 1 BIOLOGY MIND MAPS and their schemes
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
Trump Administration's workforce development strategy
202450812 BayCHI UCSC-SV 20250812 v17.pptx
advance database management system book.pdf
Unit 4 Computer Architecture Multicore Processor.pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Introduction to Building Materials
Empowerment Technology for Senior High School Guide
B.Sc. DS Unit 2 Software Engineering.pptx
Practical Manual AGRO-233 Principles and Practices of Natural Farming
TNA_Presentation-1-Final(SAVE)) (1).pptx
Introduction to pro and eukaryotes and differences.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Weekly quiz Compilation Jan -July 25.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Computer Architecture Input Output Memory.pptx

Lec06 edge

  • 1. Edge detection • Goal: Identify sudden changes (discontinuities) in an image • Intuitively, most semantic and shape information from the image can be encoded in the edges • More compact than pixels • Ideal: artist’s line drawing (but artist is also using object-level knowledge) Source: D. Lowe
  • 2. Origin of Edges Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity Source: Steve Seitz
  • 3. Characterizing edges • An edge is a place of rapid change in the image intensity function image intensity function (along horizontal scanline) first derivative edges correspond to extrema of derivative
  • 4. The gradient points in the direction of most rapid increase in intensity Image gradient The gradient of an image: The gradient direction is given by • how does this relate to the direction of the edge? The edge strength is given by the gradient magnitude Source: Steve Seitz
  • 5. Differentiation and convolution Recall, for 2D function, f(x,y): This is linear and shift invariant, so must be the result of a convolution. We could approximate this as (which is obviously a convolution) -1 1 Source: D. Forsyth, D. Lowe
  • 6. Finite difference filters Other approximations of derivative filters exist: Source: K. Grauman
  • 7. Finite differences: example Which one is the gradient in the x-direction (resp. y-direction)?
  • 8. Effects of noise Consider a single row or column of the image • Plotting intensity as a function of position gives a signal Where is the edge? Source: S. Seitz
  • 9. Effects of noise • Finite difference filters respond strongly to noise • Image noise results in pixels that look very different from their neighbors • Generally, the larger the noise the stronger the response • What is to be done? Source: D. Forsyth
  • 10. Effects of noise • Finite difference filters respond strongly to noise • Image noise results in pixels that look very different from their neighbors • Generally, the larger the noise the stronger the response • What is to be done? • Smoothing the image should help, by forcing pixels different to their neighbors (=noise pixels?) to look more like neighbors Source: D. Forsyth
  • 11. Solution: smooth first • To find edges, look for peaks in ) ( g f dx d ∗ f g f * g ) ( g f dx d ∗ Source: S. Seitz
  • 12. • Differentiation is convolution, and convolution is associative: • This saves us one operation: g dx d f g f dx d ∗ = ∗ ) ( Derivative theorem of convolution g dx d f ∗ f g dx d Source: S. Seitz
  • 13. Derivative of Gaussian filter Is this filter separable? * [1 -1] =
  • 14. Derivative of Gaussian filter Which one finds horizontal/vertical edges? x-direction y-direction
  • 15. Smoothed derivative removes noise, but blurs edge. Also finds edges at different “scales”. 1 pixel 3 pixels 7 pixels Tradeoff between smoothing and localization Source: D. Forsyth
  • 16. • The gradient magnitude is large along a thick “trail” or “ridge,” so how do we identify the actual edge points? • How do we link the edge points to form curves? Implementation issues Source: D. Forsyth
  • 17. Designing an edge detector • Criteria for an “optimal” edge detector: • Good detection: the optimal detector must minimize the probability of false positives (detecting spurious edges caused by noise), as well as that of false negatives (missing real edges) • Good localization: the edges detected must be as close as possible to the true edges • Single response: the detector must return one point only for each true edge point; that is, minimize the number of local maxima around the true edge Source: L. Fei-Fei
  • 18. Canny edge detector • This is probably the most widely used edge detector in computer vision • Theoretical model: step-edges corrupted by additive Gaussian noise • Canny has shown that the first derivative of the Gaussian closely approximates the operator that optimizes the product of signal- to-noise ratio and localization J. Canny, A Computational Approach To Edge Detection, IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986. Source: L. Fei-Fei
  • 19. Canny edge detector 1. Filter image with derivative of Gaussian 2. Find magnitude and orientation of gradient 3. Non-maximum suppression: • Thin multi-pixel wide “ridges” down to single pixel width 4. Linking and thresholding (hysteresis): • Define two thresholds: low and high • Use the high threshold to start edge curves and the low threshold to continue them MATLAB: edge(image, ‘canny’) Source: D. Lowe, L. Fei-Fei
  • 24. Non-maximum suppression At q, we have a maximum if the value is larger than those at both p and at r. Interpolate to get these values. Source: D. Forsyth
  • 25. Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s). Edge linking Source: D. Forsyth
  • 26. Hysteresis thresholding Check that maximum value of gradient value is sufficiently large • drop-outs? use hysteresis – use a high threshold to start edge curves and a low threshold to continue them. Source: S. Seitz
  • 27. Hysteresis thresholding original image high threshold (strong edges) low threshold (weak edges) hysteresis threshold Source: L. Fei-Fei
  • 28. Effect of σ (Gaussian kernel spread/size) Canny with Canny with original The choice of σ depends on desired behavior • large σ detects large scale edges • small σ detects fine features Source: S. Seitz
  • 29. Edge detection is just the beginning… Berkeley segmentation database: http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/ image human segmentation gradient magnitude
  • 30. Next: Corner and blob detection