SlideShare a Scribd company logo
1 of 49
The blue and green colors are actually the same
http://blogs.discovermagazine.com/badastronomy/2009/06/24/the-blue-and-the-green/
Previous Lectures
• We’ve now touched on
– Image Formation
• Now we’re moving on to
– Feature Detection and Matching
Edge / Boundary Detection
Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li, and Derek Hoiem
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
Why do we care about edges?
• Extract information,
recognize objects
• Recover geometry and
viewpoint
Vanishing
point
Vanishing
line
Vanishing
point
Vertical vanishing
point
(at infinity)
Origin of Edges
• Edges are caused by a variety of factors
depth discontinuity
surface color discontinuity
illumination discontinuity
surface normal discontinuity
Source: Steve Seitz
Closeup of edges
Source: D. Hoiem
Closeup of edges
Source: D. Hoiem
Closeup of edges
Source: D. Hoiem
Closeup of edges
Source: D. Hoiem
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
Intensity profile
Source: D. Hoiem
With a little Gaussian noise
Gradient
Source: D. Hoiem
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
• 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 can we do about it?
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
* [1 -1] =
• 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 a good edge detector:
– Good detection: the optimal detector should find all
real edges, ignoring noise or other artifacts
– Good localization
• the edges detected must be as close as possible to
the true edges
• the detector must return one point only for each
true edge point
• Cues of edge detection
– Differences in color, intensity, or texture across the
boundary
– Continuity and closure
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
Stages of Canny Algorithm
–Noise reduction
–Finding the intensity gradient of the image
–Non-maximum suppression
–Tracing edges through the image and
hysteresis thresholding
Example
original image (Lena)
Derivative of Gaussian filter
x-direction y-direction
The Canny edge detector is susceptible to noise present in raw unprocessed
image data, it uses a filter based on a Gaussian (bell) curve, where the raw
image is convolved with a Gaussian filter. The result is a slightly blurred version
of the original which is not affected by a single noisy pixel to any significant
degree.
Compute Gradients (DoG)
X-Derivative of Gaussian Y-Derivative of Gaussian Gradient Magnitude
An edge in an image may point in a variety of directions, so the Canny algorithm
uses filters to detect horizontal, vertical and diagonal edges in the blurred image.
The edge detection operator (Roberts, Prewitt, Sobel for example) returns a value
for the first derivative in the horizontal direction (Gx) and the vertical direction (Gy).
From this the edge gradient and direction can be determined.
Get Orientation at Each Pixel
• Threshold at minimum level
• Get orientation
theta = atan2(gy, gx)
The edge direction angle is
rounded to one of four angles
representing vertical,
horizontal and the two
diagonals (0, 45, 90 and 135
degrees for example).
Non-maximum suppression for each
orientation
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
Non-maximum suppression is an edge thinning technique.
Given estimates of the image gradients, a search is carried out to determine if the
gradient magnitude assumes a local maximum in the gradient direction.
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
Sidebar: Interpolation options
• imx2 = imresize(im, 2, interpolation_type)
• ‘nearest’
– Copy value from nearest known
– Very fast but creates blocky edges
• ‘bilinear’
– Weighted average from four nearest known
pixels
– Fast and reasonable results
• ‘bicubic’ (default)
– Non-linear smoothing over larger area (4x4)
– Slower, visually appealing, may create
negative pixel values
Examples from http://en.wikipedia.org/wiki/Bicubic_interpolation
Before Non-max Suppression
After non-max suppression
Hysteresis thresholding
• Threshold at low/high
levels to get weak/strong
edge pixels
• Do connected
components, starting
from strong edge pixels
Large intensity gradients are more likely to correspond to edges than small
intensity gradients. It is in most cases impossible to specify a threshold at which a
given intensity gradient switches from corresponding to an edge into not doing so.
Therefore Canny uses thresholding with hysteresis.
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
Final Canny Edges
Canny edge detector
1. Filter image with x, y derivatives of Gaussian
2. Find magnitude and orientation of gradient
3. Non-maximum suppression:
– Thin multi-pixel wide “ridges” down to single pixel width
4. Thresholding and linking (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
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
Where do humans see boundaries?
• Berkeley segmentation database:
http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/
image human segmentation gradient magnitude
pB boundary detector
Figure from Fowlkes
Martin, Fowlkes, Malik 2004: Learning to Detect
Natural Boundaries…
http://www.eecs.berkeley.edu/Research/Projects/C
S/vision/grouping/papers/mfm-pami-boundary.pdf
pB Boundary Detector
Figure from Fowlkes
Brightness
Color
Texture
Combined
Human
Results
Human (0.95)
Pb (0.88)
Results
Human
Pb
Human (0.96)
Global Pb
Pb (0.88)
Human (0.95)
Pb (0.63)
Human (0.90)
Pb (0.35)
For more:
http://www.eecs.berkeley.edu/Research/Projects
/CS/vision/bsds/bench/html/108082-color.html
45 years of boundary detection
Source: Arbelaez, Maire, Fowlkes, and Malik. TPAMI 2011 (pdf)
State of edge detection
• Local edge detection works well
– But many false positives from illumination and
texture edges
• Some methods to take into account longer
contours, but could probably do better
• Few methods that actually “learn” from data
• Poor use of object and high-level information
Style and abstraction in portrait sketching,
Berger et al. SIGGRAPH 2013
• Learn from artist’s strokes so that edges are
more likely in certain parts of the face.

More Related Content

Similar to Feature Detection and Matching

Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentationasodariyabhavesh
 
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 AlgorithmPrasad Thakur
 
Real time Canny edge detection
Real time Canny edge detectionReal time Canny edge detection
Real time Canny edge detectionShashank Kapoor
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
06 image features
06 image features06 image features
06 image featuresankit_ppt
 
Denoising and Edge Detection Using Sobelmethod
Denoising and Edge Detection Using SobelmethodDenoising and Edge Detection Using Sobelmethod
Denoising and Edge Detection Using SobelmethodIJMER
 
Edge Drawing - An Heuristic Approach to Robust Real-Time Edge Detection
Edge Drawing - An Heuristic Approach to Robust Real-Time Edge DetectionEdge Drawing - An Heuristic Approach to Robust Real-Time Edge Detection
Edge Drawing - An Heuristic Approach to Robust Real-Time Edge Detectioncihantopal2
 
Erik Bernhardsson, CTO, Better Mortgage
Erik Bernhardsson, CTO, Better MortgageErik Bernhardsson, CTO, Better Mortgage
Erik Bernhardsson, CTO, Better MortgageMLconf
 
Edge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy LogicEdge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy LogicIJERA Editor
 
Introduction to Binocular Stereo in Computer Vision
Introduction to Binocular Stereo in Computer VisionIntroduction to Binocular Stereo in Computer Vision
Introduction to Binocular Stereo in Computer Visionothersk46
 
Seminar report on edge detection of video using matlab code
Seminar report on edge detection of video using matlab codeSeminar report on edge detection of video using matlab code
Seminar report on edge detection of video using matlab codeBhushan Deore
 
image-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.pptimage-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.pptRaviSharma65345
 
X-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and AnalysisX-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and AnalysisIJREST
 

Similar to Feature Detection and Matching (20)

cv1.ppt
cv1.pptcv1.ppt
cv1.ppt
 
Chapter10 image segmentation
Chapter10 image segmentationChapter10 image segmentation
Chapter10 image segmentation
 
Edge Detection
Edge Detection Edge Detection
Edge Detection
 
Canny Edge Detection
Canny Edge DetectionCanny Edge Detection
Canny Edge Detection
 
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
 
Lec05 filter
Lec05 filterLec05 filter
Lec05 filter
 
Real time Canny edge detection
Real time Canny edge detectionReal time Canny edge detection
Real time Canny edge detection
 
Recognition
RecognitionRecognition
Recognition
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
06 image features
06 image features06 image features
06 image features
 
Denoising and Edge Detection Using Sobelmethod
Denoising and Edge Detection Using SobelmethodDenoising and Edge Detection Using Sobelmethod
Denoising and Edge Detection Using Sobelmethod
 
Edge Drawing - An Heuristic Approach to Robust Real-Time Edge Detection
Edge Drawing - An Heuristic Approach to Robust Real-Time Edge DetectionEdge Drawing - An Heuristic Approach to Robust Real-Time Edge Detection
Edge Drawing - An Heuristic Approach to Robust Real-Time Edge Detection
 
Erik Bernhardsson, CTO, Better Mortgage
Erik Bernhardsson, CTO, Better MortgageErik Bernhardsson, CTO, Better Mortgage
Erik Bernhardsson, CTO, Better Mortgage
 
Edge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy LogicEdge Detection Using Fuzzy Logic
Edge Detection Using Fuzzy Logic
 
Lecture 06: Features
Lecture 06: FeaturesLecture 06: Features
Lecture 06: Features
 
Introduction to Binocular Stereo in Computer Vision
Introduction to Binocular Stereo in Computer VisionIntroduction to Binocular Stereo in Computer Vision
Introduction to Binocular Stereo in Computer Vision
 
Seminar report on edge detection of video using matlab code
Seminar report on edge detection of video using matlab codeSeminar report on edge detection of video using matlab code
Seminar report on edge detection of video using matlab code
 
image-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.pptimage-processing-husseina-ozigi-otaru.ppt
image-processing-husseina-ozigi-otaru.ppt
 
16 17 bag_words
16 17 bag_words16 17 bag_words
16 17 bag_words
 
X-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and AnalysisX-Ray Image Acquisition and Analysis
X-Ray Image Acquisition and Analysis
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Feature Detection and Matching

  • 1. The blue and green colors are actually the same
  • 3. Previous Lectures • We’ve now touched on – Image Formation • Now we’re moving on to – Feature Detection and Matching
  • 4. Edge / Boundary Detection Many slides from Lana Lazebnik, Steve Seitz, David Forsyth, David Lowe, Fei-Fei Li, and Derek Hoiem
  • 5. 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
  • 6. Why do we care about edges? • Extract information, recognize objects • Recover geometry and viewpoint Vanishing point Vanishing line Vanishing point Vertical vanishing point (at infinity)
  • 7. Origin of Edges • Edges are caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity Source: Steve Seitz
  • 12. 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
  • 14. With a little Gaussian noise Gradient Source: D. Hoiem
  • 15. 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
  • 16. Effects of noise • 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 can we do about it? Source: D. Forsyth
  • 17. 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
  • 18. • 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
  • 19. Derivative of Gaussian filter * [1 -1] =
  • 20. • 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
  • 21. • 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
  • 22. Designing an edge detector • Criteria for a good edge detector: – Good detection: the optimal detector should find all real edges, ignoring noise or other artifacts – Good localization • the edges detected must be as close as possible to the true edges • the detector must return one point only for each true edge point • Cues of edge detection – Differences in color, intensity, or texture across the boundary – Continuity and closure Source: L. Fei-Fei
  • 23. 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
  • 24. Stages of Canny Algorithm –Noise reduction –Finding the intensity gradient of the image –Non-maximum suppression –Tracing edges through the image and hysteresis thresholding
  • 26. Derivative of Gaussian filter x-direction y-direction The Canny edge detector is susceptible to noise present in raw unprocessed image data, it uses a filter based on a Gaussian (bell) curve, where the raw image is convolved with a Gaussian filter. The result is a slightly blurred version of the original which is not affected by a single noisy pixel to any significant degree.
  • 27. Compute Gradients (DoG) X-Derivative of Gaussian Y-Derivative of Gaussian Gradient Magnitude An edge in an image may point in a variety of directions, so the Canny algorithm uses filters to detect horizontal, vertical and diagonal edges in the blurred image. The edge detection operator (Roberts, Prewitt, Sobel for example) returns a value for the first derivative in the horizontal direction (Gx) and the vertical direction (Gy). From this the edge gradient and direction can be determined.
  • 28. Get Orientation at Each Pixel • Threshold at minimum level • Get orientation theta = atan2(gy, gx) The edge direction angle is rounded to one of four angles representing vertical, horizontal and the two diagonals (0, 45, 90 and 135 degrees for example).
  • 29. Non-maximum suppression for each orientation 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 Non-maximum suppression is an edge thinning technique. Given estimates of the image gradients, a search is carried out to determine if the gradient magnitude assumes a local maximum in the gradient direction.
  • 30. 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
  • 31. Sidebar: Interpolation options • imx2 = imresize(im, 2, interpolation_type) • ‘nearest’ – Copy value from nearest known – Very fast but creates blocky edges • ‘bilinear’ – Weighted average from four nearest known pixels – Fast and reasonable results • ‘bicubic’ (default) – Non-linear smoothing over larger area (4x4) – Slower, visually appealing, may create negative pixel values Examples from http://en.wikipedia.org/wiki/Bicubic_interpolation
  • 34. Hysteresis thresholding • Threshold at low/high levels to get weak/strong edge pixels • Do connected components, starting from strong edge pixels Large intensity gradients are more likely to correspond to edges than small intensity gradients. It is in most cases impossible to specify a threshold at which a given intensity gradient switches from corresponding to an edge into not doing so. Therefore Canny uses thresholding with hysteresis.
  • 35. 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
  • 37. Canny edge detector 1. Filter image with x, y derivatives of Gaussian 2. Find magnitude and orientation of gradient 3. Non-maximum suppression: – Thin multi-pixel wide “ridges” down to single pixel width 4. Thresholding and linking (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
  • 38. 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
  • 39. Where do humans see boundaries? • Berkeley segmentation database: http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/ image human segmentation gradient magnitude
  • 40. pB boundary detector Figure from Fowlkes Martin, Fowlkes, Malik 2004: Learning to Detect Natural Boundaries… http://www.eecs.berkeley.edu/Research/Projects/C S/vision/grouping/papers/mfm-pami-boundary.pdf
  • 46. Human (0.90) Pb (0.35) For more: http://www.eecs.berkeley.edu/Research/Projects /CS/vision/bsds/bench/html/108082-color.html
  • 47. 45 years of boundary detection Source: Arbelaez, Maire, Fowlkes, and Malik. TPAMI 2011 (pdf)
  • 48. State of edge detection • Local edge detection works well – But many false positives from illumination and texture edges • Some methods to take into account longer contours, but could probably do better • Few methods that actually “learn” from data • Poor use of object and high-level information
  • 49. Style and abstraction in portrait sketching, Berger et al. SIGGRAPH 2013 • Learn from artist’s strokes so that edges are more likely in certain parts of the face.