0% found this document useful (0 votes)
6 views

Lecture2-1

The document discusses edge detection in images, focusing on identifying visual changes and the factors that cause edges, such as surface normal, depth, and illumination. It explains the process of edge detection, including the use of gradients, the Sobel operator, and the Canny edge detector, which is a widely used method in computer vision. Key criteria for a good edge detector include accurate detection, localization, and the ability to ignore noise.

Uploaded by

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

Lecture2-1

The document discusses edge detection in images, focusing on identifying visual changes and the factors that cause edges, such as surface normal, depth, and illumination. It explains the process of edge detection, including the use of gradients, the Sobel operator, and the Canny edge detector, which is a widely used method in computer vision. Key criteria for a good edge detector include accurate detection, localization, and the ability to ignore noise.

Uploaded by

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

Edge detection

• Convert a 2D image into a set of curves


– Extracts salient features of the scene
– More compact than pixels
Edge detection

• Goal: Identify visual changes


(discontinuities) in an image.

• Intuitively, semantic information


is encoded in edges.

• What are some ‘causes’ of


visual edges?

Source: D. Lowe
Origin of Edges
surface normal

depth

surface color

illumination

• Edges are caused by a variety of factors


Images as functions…

• Edges look like


steep cliffs
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
intensity function
image (along horizontal scanline) first derivative

edges correspond to
Source: L. Lazebnik extrema of derivative
Image derivatives
• How can we differentiate a digital image F[x,y]?
– Option 1: reconstruct a continuous image, f, then
compute the derivative
– Option 2: take discrete derivative (finite difference)

How would you implement this as a linear filter?

: 1 -1 : -1
1

Source: S. Seitz
Image gradient
• The gradient of an image:
The gradient points in the direction of most rapid increase in intensity

The edge strength is given by the gradient magnitude:

The gradient direction is given by:

Source: Steve Seitz


Image gradient

Source: L. Lazebnik
Effects of noise

Noisy input image

Where is the edge?


Source: S. Seitz
Solution: smooth first
f

f*h

To find edges, look for peaks in


Source: S. Seitz
Associative property of convolution
• Differentiation is convolution, and convolution
is associative:
• This saves us one operation:

Source: S. Seitz
The 1D Gaussian and its derivatives
Derivative of Gaussian filter

x-direction y-direction
The Sobel operator
• Common approximation of derivative of Gaussian

-1 0 1 1 2 1
-2 0 2 0 0 0
-1 0 1 -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 magnitude
Sobel operator: example

x-gradient y-gradient gradient magnitude

Source: Wikipedia
Sobel operator

Original Magnitude Orientation


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
– High-level knowledge

Source: L. Fei-Fei
Canny edge detector

• This is probably the most widely used edge


detector in computer vision

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)


Finding edges

gradient magnitude
Finding edges

where is the edge?

thresholding
Get Orientation at Each Pixel
• Threshold at minimum level
• Get orientation
theta = atan2(gy, gx)
Non-maximum suppression

1. Perform comparisons on the edge


strength of the current pixel with the
edge strength of the pixel in the
positive and negative gradient
directions.
2. Preserve the largest and suppress
the others.

• Check if pixel is local maximum along


gradient direction

27
Picture from Prem K Kalra
Before Non-max Suppression
After Non-max Suppression
Finding edges

thresholding
Finding edges

thinning
(non-maximum suppression)
Canny edge detector
MATLAB: edge(image,‘canny’)

1. Filter image with derivative of Gaussian

2. Find magnitude and orientation of gradient

3. Non-maximum suppression

4. Linking and thresholding

Source: D. Lowe, L. Fei-Fei

You might also like