0% found this document useful (0 votes)
283 views56 pages

Digital Image Processing & Computer Vision: Edge Detection

The document discusses edge detection in digital images. It begins by defining what an edge is and discussing traditional approaches to edge detection using derivative operators and template matching. It then covers several prominent edge detection models: the Marr-Hildreth edge detector uses the Laplacian of Gaussian (LoG) filter, the Canny edge detector detects edges by looking for local maxima of the gradient of the image, and the Shen-Castan edge detector uses an iterative method. The document also discusses comparing optimal edge detectors and detecting color edges.

Uploaded by

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

Digital Image Processing & Computer Vision: Edge Detection

The document discusses edge detection in digital images. It begins by defining what an edge is and discussing traditional approaches to edge detection using derivative operators and template matching. It then covers several prominent edge detection models: the Marr-Hildreth edge detector uses the Laplacian of Gaussian (LoG) filter, the Canny edge detector detects edges by looking for local maxima of the gradient of the image, and the Shen-Castan edge detector uses an iterative method. The document also discusses comparing optimal edge detectors and detecting color edges.

Uploaded by

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

Digital Image Processing &

Computer Vision

Edge Detection
Agenda
 Purpose of Edge detection

 Traditional approaches and Theory

 Noise

 Derivative Operators

 Template based Edge Detection

 Edge Models

 Marr-Hildreth Edge Detector

 Canny Edge Detector

 The Shen-Castan (ISEF) Edge Detection

 Comparison of Optimal Edge Detectors

 Color Edges

2
3
Stanford University Lecture 5
4 10-Oct-17
-
(A) Cave painting at Chauvet, France, about 30,000 B.C.;
(B) Aerial photograph of the picture of a monkey as part of the Nazca Lines geoglyphs, Peru, about 700 – 200 B.C.;
(C) Shen Zhou (1427-1509 A.D.): Poet on a mountain top, ink on paper, China;
(D) Line drawing by 7-year old I. Lleras (2010 A.D.).

Stanford University Lecture 5


5 10-Oct-17
-
Stanford University Lecture 5
6 10-Oct-17
-
Walther, Chai, Caddigan, Beck & Fei-Fei, PNAS, 2011
Stanford University Lecture 5
7 10-Oct-17
-
What is an Edge?

An edge in an image is a significant local change in the image intensity, usually associated with a discontinuity

in either the image intensity or the first derivative of the image intensity

8
An edge point is a point in an image with coordinates [i, j] at the location of a significant local intensity change

in the image.

An edge fragment corresponds to the i and j coordinates of an edge and the edge orientation θ , which may be

the gradient angle

An edge detector is an algorithm that produces a set of edges (edge points or edge fragments) from an image

9
Some more definitions

• A contour is a list of edges or the mathematical curve that models the list
of edges

• Edge linking is the process of forming an ordered list of edges from an


unordered list. By convention, edges are ordered by traversal in a
clockwise direction.

• Edge following is the process of searching the (filtered) image to


determine contours.
10
Traditional Approaches and
Theory

11
 Algorithms

 Clear Statement of the problem

 Analysis

 Conditions

 Edge detection algorithm

 What is an edge

 Suggest methods of enhancement and identification

12
13
Issues / Complications

• Digitization

• Noise
• Reasons for Noise
• light intensity
• type of camera and lens
• Motion
• Temperature
• Atmospheric effects
• Dust
14
15
Models of Edges

16
Background

Local changes in intensity can be detected using derivatives.


Derivatives of a digital function are defined in terms of finite differences
Requirements
Any approximation used for first derivatives should satisfy
1. Must be zero in areas of constant intensity
2. Must be non-zero at the onset of an intensity step or ramp
3. Must be nonzero at points along an intensity ramp
An approximation used for second derivatives should satisfy
1. Must be zero in areas of constant intensity
2. Must be nonzero at the onset and end of an intensity step or ramp
3. Must be zero along intensity ramps

17
Contd…

• An approximation to the first derivative at an arbitrary point x of a one-dimensional function f(x) by


expanding the function f(x+Δx) in to a Taylor series about x.

(1)

where Δx is the separation between samples of f.


Δx = 1  for the sample preceding x
Δx = -1  for the sample following x
When Δx = 1
(2)
18
Contd…

When Δx = -1

• We compute intensity differences using just a few terms of the Taylor series.
• For first-order derivatives we use only the linear terms, and we can form differences in one of three
ways
Backward difference

Forward difference Central difference 19


Second-order derivative

••  Based
on a central difference, , the 2nd order derivative is obtained by
adding (1) & (2)

• For 2 variables,

20
 First derivatives produce “Thick” edges
 2nd derivative produces much thinner edges

 Single Isolated Point


 Magnitude of 2nd derivative is stronger
 Hence it is aggressive in enhancing sharp
changes

 In ramp & step edges, 2nd derivative has


opposite signs - used to locate edges
 Sign of 2nd derivative – used to determine
whether a transition to an edge is from light to
dark or dark to light.

21
Approach for Computing first & second derivatives

• Using spatial convolution


• Compute the sum of products of the kernel coefficients with the intensity
values in the region encompassed by the kernel.
• The response of the filter at the center point of the kernel is

zk is the intensity of the pixel whose spatial location corresponds to the location
of the k-th kernel coefficient
22
Detection of Isolated Points

• Laplacian operator for a function (image) f(x, y) of two variables is


defined as

Implemented
using mask

• Discrete Laplacian of two variables is


23
Contd..

• A point is said to be detected at a location (x, y) on which the kernel is centred if the absolute value of
the response of the filter at that point exceeds a specified threshold.

where g(x, y) is the output image, T is a nonnegative


threshold

24
25
• Laplacian operator highlights sharp intensity transitions in an image and de-emphazises regions of
slowly varying intensities.

where f (x, y) and g(x, y) are the input and sharpened images, respectively.
1. c = −1 if the Laplacian kernels in (a) or (b) is used,
2. c = 1 if either of the other two kernels is used.

26
Line Detection

• Second derivatives result in a stronger filter response


• Produce thinner lines than 1st derivatives
• Can use Laplacian kernel
• Double-line effect to be handled

27
Edge Models Step Edge
Edge Models classified according to intensity profiles.

• A step edge is characterized by a transition between two intensity levels occurring ideally over the
distance of one pixel.
• They occur in computer generated images (solid modeling and animation).
• 1 pixel wide, no additional processing (Smoothing) needed to make them look real.
• Canny edge detection was devised originally using a step-edge model

28
Edge Models contd.. Ramp edges

• Digital images have edges – blurred, noisy


• Degree of blurring determined by the limitations in the focusing mechanism.
• Noise level determined by the electronic components of the imaging system.
• Edges of these types are modeled as ramp edges.
• Slope of the ramp is inversely proportional to the degree to which the edge is blurred.

29
Edge Models contd.. Roof Edge

• Lines through a region with the base(width) of th edge being determined by the thickness and sharpness
of the line.

30
• First derivative is positive at the beginning of the ramp, negative at the end of the ramp, zero at points on the ramp and zero
at points of constant intensity.
• The second derivative is positive at the beginning of the ramp, negative at the end of the ramp, zero at points on the ramp
and zero at points of constant intensity.
• Signs of the derivatives would be reversed for an edge that transitions from light to dark.
• Intersection between the zero intensity axis and a line extending between the extrema of the second derivative marks a
point called the zero crossing of the second derivative.

31
Steps for Edge detection

1. Image smoothing for noise reduction.


2. Detection of edge points.
3. Edge localization

32
Edge Detection

The tool of choice for finding edge strength and direction at an arbitrary location (x, y) of an image, f, is the
gradient, denoted by f and defined as the vector

When evaluated for all applicable values of x and y, f (x, y) becomes a vector image, each element of which is a
vector.
The magnitude, M(x, y), of this gradient vector at a point (x, y) is given by its Euclidean vector norm:

33
Edge Detection

Value of the rate of change in the direction of the gradient vector at point (x, y). Note that M(x, y), f (x, y) , g x y
x( , ), and g x y y( , ) are arrays of the same size as f, created when x and y are allowed to vary over all pixel locations
in f. It is common practice to refer to M(x, y) and f (x, y) as the gradient image, or simply as the gradient when the
meaning is clear

The direction of the gradient vector at a point (x, y) is given by

Angles are measured in the counterclockwise direction with respect to the x-axis

34
• Filter kernels used to compute the derivatives needed for the gradient are often called gradient operators,
difference operators, edge operators or edge detectors

35
Roberts cross-gradient operators

• 2-d kernels with a diagonal preference.


• This implements the diagonal differences

• Disadvantage:
• Eventhough simple, not useful 36
• 3x3 kernelss carry more information regarding the direction of the edge
Prewitt operators

• It detects two types of edges ; Horizontal & vertical

37
Sobel Operator

• Uses a weight of 2 in the centre coefficient.


• This provides an image smoothing.

38
• Any pairs of the kernels are convolved with an image to obtain the gradient components g x and gy at
every pixel location.
• These two partial derivative arrays are then used to estimate edge strength and direction.
• Obtaining the magnitude of the gradient requires the computations.

• Hence approximate the magnitude by absolute values

39
40
41
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

Stanford University Lecture 5


42 10-Oct-17
-
Why do we care about edges?
• Extract information,
recognize objects

• Recover geometry and Vertical vanishing


point
(at infinity)
Vanishing

viewpoint line

Vanishing Vanishing
point point

Source: J. Hayes

Stanford University Lecture 5


43 10-Oct-17
-
Origins of
edges

surface normal discontinuity

depth discontinuity surface

color discontinuity

illumination discontinuity

Source: D. Hoiem

Stanford University Lecture 5


44 10-Oct-17
-
Closeup of edges

Surface normal discontinuity

Source: D. Hoiem

Stanford University
10-Oct-17 Lecture 5 -
Closeup of edges

Depth discontinuity

Source: D. Hoiem

Stanford University
10-Oct-17 Lecture 5 -
Closeup of edges

Surface color discontinuity

Source: D. Hoiem

Stanford University
10-Oct-17 Lecture 5 -
Convolution

48
Slide credit: Ulas Bagci

11
2D convolution
example

50 6-Oct-16
2D convolution
example

51 6-Oct-16
2D convolution
example

52 6-Oct-16
2D convolution
example

53 6-Oct-16
2D convolution
example

54 6-Oct-16
2D convolution
example

55 6-Oct-16
2D convolution
example

56 6-Oct-16

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