Edge Detection
By:- Pratik Gohel
Edge detection
Convert a 2D image into a set of curves
• Extracts salient features of the scene
• More compact than pixels
Origin of Edges
Edges are caused by a variety of factors
depth discontinuity
surface color discontinuity
illumination discontinuity
surface normal discontinuity
Edge detection
How can you tell that a pixel is on an edge?
Profiles of image intensity edges
Edge detection
1. Detection of short linear edge segments (edgels)
2. Aggregation of edgels into extended edges
(maybe parametric description)
Edgel detection
• Difference operators
• Parametric-model matchers
Edge is Where Change Occurs
Change is measured by derivative in 1D
Biggest change, derivative has maximum magnitude
Or 2nd
derivative is zero.
Image gradient
The gradient of an image:
The gradient points in the direction of most rapid change in intensity
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
The discrete gradient
How can we differentiate a digital image f[x,y]?
• Option 1: reconstruct a continuous image, then take gradient
• Option 2: take discrete derivative (finite difference)
How would you implement this as a cross-correlation?
Template based edge detector:
The Sobel operator
Better approximations of the derivatives exist
• The Sobel operators below are very commonly used
-1 0 1
-2 0 2
-1 0 1
1 2 1
0 0 0
-1 -2 -1
• The standard defn. of the Sobel operator omits the 1/8 term
– doesn’t make a difference for edge detection
– the 1/8 term is needed to get the right gradient value, however
Gradient operators
(a): Roberts’ cross operator (b): 3x3 Prewitt operator
(c): Sobel operator (d) 4x4 Prewitt operator
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?
Where is the edge?
Solution: smooth first
Look for peaks in
Derivative theorem of convolution
This saves us one operation:
Laplacian of Gaussian
Consider
Laplacian of Gaussian
operator
Where is the edge? Zero-crossings of bottom graph
2D edge detection filters
is the Laplacian operator:
Laplacian of Gaussian
Gaussian derivative of Gaussian
Another perspective of Marr-Hildreth for
LoG
Numerical measures for Edge detection
• False positives: an edge detector reports an edge
where non exists.
• False negatives: an edge detector fails to report an
edge where there is an edge.
Optimal Edge Detection: Canny
Non Maximum supression
Hysteresis Thresholding
Finding lines in an image (parametric
models)
Option 1:
• Search for the line at every possible position/orientation
• What is the cost of this operation?
Option 2:
• Use a voting scheme: Hough transform
Finding lines in an image
Connection between image (x,y) and Hough (m,b) spaces
• A line in the image corresponds to a point in Hough space
• To go from image space to Hough space:
– given a set of points (x,y), find all (m,b) such that y = mx + b
x
y
m
b
m0
b0
image space Hough space
Finding lines in an image
Connection between image (x,y) and Hough (m,b) spaces
• A line in the image corresponds to a point in Hough space
• To go from image space to Hough space:
– given a set of points (x,y), find all (m,b) such that y = mx + b
• What does a point (x0, y0) in the image space map to?
x
y
m
b
image space Hough space
– A: the solutions of b = -x0m + y0
– this is a line in Hough space
x0
y0
Hough transform
Typically use a different parameterization
• d is the perpendicular distance from the line to the origin
  is the angle this perpendicular makes with the x axis
Voting scheme
Thank you

EDGEDETECTION algorithm and theory for image processing

  • 1.
  • 2.
    Edge detection Convert a2D image into a set of curves • Extracts salient features of the scene • More compact than pixels
  • 3.
    Origin of Edges Edgesare caused by a variety of factors depth discontinuity surface color discontinuity illumination discontinuity surface normal discontinuity
  • 4.
    Edge detection How canyou tell that a pixel is on an edge?
  • 5.
    Profiles of imageintensity edges
  • 6.
    Edge detection 1. Detectionof short linear edge segments (edgels) 2. Aggregation of edgels into extended edges (maybe parametric description)
  • 7.
    Edgel detection • Differenceoperators • Parametric-model matchers
  • 8.
    Edge is WhereChange Occurs Change is measured by derivative in 1D Biggest change, derivative has maximum magnitude Or 2nd derivative is zero.
  • 9.
    Image gradient The gradientof an image: The gradient points in the direction of most rapid change in intensity 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
  • 10.
    The discrete gradient Howcan we differentiate a digital image f[x,y]? • Option 1: reconstruct a continuous image, then take gradient • Option 2: take discrete derivative (finite difference) How would you implement this as a cross-correlation?
  • 11.
    Template based edgedetector: The Sobel operator Better approximations of the derivatives exist • The Sobel operators below are very commonly used -1 0 1 -2 0 2 -1 0 1 1 2 1 0 0 0 -1 -2 -1 • The standard defn. of the Sobel operator omits the 1/8 term – doesn’t make a difference for edge detection – the 1/8 term is needed to get the right gradient value, however
  • 12.
    Gradient operators (a): Roberts’cross operator (b): 3x3 Prewitt operator (c): Sobel operator (d) 4x4 Prewitt operator
  • 13.
    Effects of noise Considera single row or column of the image • Plotting intensity as a function of position gives a signal Where is the edge?
  • 14.
    Where is theedge? Solution: smooth first Look for peaks in
  • 15.
    Derivative theorem ofconvolution This saves us one operation:
  • 16.
    Laplacian of Gaussian Consider Laplacianof Gaussian operator Where is the edge? Zero-crossings of bottom graph
  • 17.
    2D edge detectionfilters is the Laplacian operator: Laplacian of Gaussian Gaussian derivative of Gaussian
  • 18.
    Another perspective ofMarr-Hildreth for LoG
  • 23.
    Numerical measures forEdge detection • False positives: an edge detector reports an edge where non exists. • False negatives: an edge detector fails to report an edge where there is an edge.
  • 24.
  • 29.
  • 33.
  • 35.
    Finding lines inan image (parametric models) Option 1: • Search for the line at every possible position/orientation • What is the cost of this operation? Option 2: • Use a voting scheme: Hough transform
  • 36.
    Finding lines inan image Connection between image (x,y) and Hough (m,b) spaces • A line in the image corresponds to a point in Hough space • To go from image space to Hough space: – given a set of points (x,y), find all (m,b) such that y = mx + b x y m b m0 b0 image space Hough space
  • 37.
    Finding lines inan image Connection between image (x,y) and Hough (m,b) spaces • A line in the image corresponds to a point in Hough space • To go from image space to Hough space: – given a set of points (x,y), find all (m,b) such that y = mx + b • What does a point (x0, y0) in the image space map to? x y m b image space Hough space – A: the solutions of b = -x0m + y0 – this is a line in Hough space x0 y0
  • 38.
    Hough transform Typically usea different parameterization • d is the perpendicular distance from the line to the origin   is the angle this perpendicular makes with the x axis
  • 43.
  • 44.