0% found this document useful (0 votes)
14 views39 pages

2e. Edge Detection

The document discusses edge detection in images, focusing on the origins of edges and methods for detecting them, such as gradient operators and the Laplacian. It highlights the Canny edge detector as a widely used method, detailing its steps including Gaussian filtering, gradient computation, non-maximum suppression, and hysteresis thresholding. The document also addresses the trade-offs between smoothing and localization in edge detection and the influence of Gaussian kernel size on edge detection outcomes.

Uploaded by

atik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views39 pages

2e. Edge Detection

The document discusses edge detection in images, focusing on the origins of edges and methods for detecting them, such as gradient operators and the Laplacian. It highlights the Canny edge detector as a widely used method, detailing its steps including Gaussian filtering, gradient computation, non-maximum suppression, and hysteresis thresholding. The document also addresses the trade-offs between smoothing and localization in edge detection and the influence of Gaussian kernel size on edge detection outcomes.

Uploaded by

atik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 39

Edge Detection

Origin of Edges

surface normal discontinuity

depth discontinuity

surface color discontinuity

illumination discontinuity

Edges are caused by a variety of factors


Detecting edges
What’s an edge?
• intensity discontinuity (= rapid change)

How can we find large changes in intensity?


• gradient operator seems like the right solution
Edge Detection

First-order derivative of 1-D function f(x)


f
 f ( x  1)  f ( x)
x
second-order derivative of 1-D function f(x)
2 f
2
 f ( x  1)  f ( x  1)  2 f ( x)
x
• First-order derivatives
– Produce thicker edges
– Stronger response to a gray-level steps
• Second-order derivatives
– Stronger response to fine detail, such as thin lines and isolated points
– Double response at step changes in gray-level

-4-
-5-
Laplacian
• Isotropic filter: independent of the direction  rotation
invariant
Development of the method
• Lapacian: simplest isotropic derivative operator, Linear
operator
2 2 f 2 f
 f  2  2
x y

• discrete form (partial 2nd-order derivative in x, y direction)

2 f
x  direction :  f ( x  1, y )  f ( x  1, y )  2 f ( x, y )
x 2
2 f
y  direction :  f ( x, y  1)  f ( x, y  1)  2 f ( x, y )
y 2

-6-
• 2-D Laplacian is obtained by summing two components

2 f  f ( x  1, y )  f ( x  1, y )  f ( x, y  1)  f ( x, y  1)  4 f ( x, y )

-7-
• Adding the original and Laplacian images (superimpose)
 f ( x, y )  2 f ( x, y ) if the center coefficient of the

 Laplacian mask is negative
g ( x, y )  2
 f ( x, y )   f ( x, y ) if the center coefficient of the
 Laplacian mask is positive

• Example 3.11 & Fig 3.40

g ( x, y )  f ( x, y )   f ( x  1, y )  f ( x  1, y )  f ( x, y  1)  f ( x, y  1)  4 f ( x, y )
5 f ( x, y )   f ( x  1, y )  f ( x  1, y )  f ( x, y  1)  f ( x, y  1)

-8-
-9-
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?


Solution: smooth first

Where is the edge? Look for peaks in


Associative property 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

Laplacian of Gaussian

Gaussian derivative of Gaussian

is the Laplacian operator:


Derivative of Gaussian filter

* [1 -1] =
Tradeoff between smoothing and localization

1 pixel 3 pixels 7 pixels

Smoothed derivative removes noise, but blurs edge.


Also finds edges at different “scales”.

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
Example

original image (Lena)


Derivative of Gaussian filter

x-direction y-direction
Compute Gradients (DoG)

X-Derivative of Gaussian Y-Derivative of Gaussian Gradient Magnitude


Get Orientation at Each Pixel
Threshold at minimum level
Get orientation theta = atan2(gy, gx)
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
Edge linking

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).

Source: D. Forsyth
Bilinear Interpolation
Before Non-max Suppression
After non-max suppression
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
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)

original Canny with Canny with

The choice of  depends on desired behavior


• large  detects large scale edges
• small  detects fine features

Source: S. Seitz
Where do humans see boundaries?
image human segmentation gradient magnitude

Berkeley segmentation database:


http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy