You are on page 1of 25

Digital Image Processing, 2nd ed. www.imageprocessingbook.

com

Detection of Discontinuities
Edge Detection

Definition of edges
- Edges are significant local changes of intensity in an image.
- Edges typically occur on the boundary between two different
regions in an image.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Edge Detection
Goal of edge detection
- Produce a line drawing of a scene from an image of that scene.
- Important features can be extracted from the edges of an image
(e.g., corners, lines, curves).
- These features are used by higher-level computer vision algorithms
(e.g., recognition).

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Edge Detection

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Edge Detection

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Edge Detection

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Edge Detection

Ramp edge: a step edge where the intensity change is not


instantaneous but occur over a finite distance.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities - Edge Detection

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities - Edge Detection

From left to right along the intensity profile :


•First derivate is positive at the onset of the ramp and at points
on the ramp and is zero in areas of constant intensity.
•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.
•The 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.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities - Edge Detection

Conclusions :
•The magnitude of the first derivative can be used to detect
the presence of an edge at a point in an image.
•Sign of the second derivative can be used to determine
whether an edge pixel lies on the dark or light side of an
edge.
•Second derivative produces two values for every edge in an
image.
•Its zero crossings can be used for locating the centers of thick
edges.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators

• First-order derivatives:
– The gradient of an image f(x,y) at location (x,y) is defined
as the vector:
 g x   fx 
f  grad ( f )      f 
 g y   y 

– The magnitude of this vector: M ( x, y )  mag(f )  g  g 


1
2 2 2
x y

– The direction of this vector:  gx 


 ( x, y )  tan  
1

f  M ( x , y )  g x  g y
 gy 
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators

• :

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators

• Gradient vector is also known as edge normal.


• When the vector is normalized to unit length by dividing it by
its magnitude, the resulting vector is commonly referred to as
the edge unit normal.
• To obtain gradient of an image , it requires computation of
partial derivatives at every pixel location in the image.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Roberts cross-gradient operators

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators

Roberts cross-gradient operators

Prewitt operators

Sobel operators

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Prewitt operators

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Sobel operators

• Prewitt masks are simpler to implement than sobel masks.


• But Sobel masks have better noise-suppression(smoothing)
characteristics makes them preferable.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators

Prewitt masks for


detecting diagonal edges

Sobel masks for


detecting diagonal edges

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators: Example

f  G x  G y

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators: Example

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Detection of Discontinuities
Gradient Operators: Example

© 2002 R. C. Gonzalez & R. E. Woods

You might also like