Edge Detection.ppt Image processing chapter of the Computer Vision

BhawnaSaini45 7 views 21 slides Feb 26, 2025
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

Topic related to Computer Vision


Slide Content

0 - 0 - 11
© 2007 Texas Instruments Inc,
Content developed in partnership with
Tel-Aviv University
From MATLAB
®
and Simulink
®
to
Real Time with TI DSPs
Edge Detection

Slide Slide 22
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Edge Detection?
“The ability to measure gray-level transitions in a
meaningful way.”
(R.C. Gonzales & R. E. Woods – Digital Image Processing, 2
nd

Edition, Prentice-Hall, 2001)

Slide Slide 33
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Gray-Level Transition
Ideal Ramp

Slide Slide 55
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Detecting the Edge (1)
yxI, 
x
yxI

,
x
Original
First Derivative
TRSH
x

DetectedEdgeTRSH
x
yxI


,

Slide Slide 66
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Detecting the Edge (2)
Original First Derivative
yxI, 
x
yxI

,

DetectedNotEdgeTRSH
x
yxI


,
TRSH

Slide Slide 77
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Gradient Operators
•The gradient of the image I(x,y) at location (x,y), is
the vector:
•The magnitude of the gradient:
•The direction of the gradient vector:

























y
yxI
x
yxI
G
G
I
y
x
,
,
 
22
yx
GGII 











y
x
G
G
yx
1
tan,

Slide Slide 88
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Meaning of the Gradient
•It represents the direction of the strongest
variation in intensity
0

yx
GI
x
,
The direction of the edge at location (x,y) is
perpendicular to the gradient vector at that point

2

 

yx
GI
y
,
Vertical Horizontal Generic
Edge Strength:
Edge Direction:
 












x
y
yx
G
G
yx
GGI
1
22
tan,

Slide Slide 99
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Calculating the Gradient
For each pixel the
gradient is calculated,
based on a 3x3
neighborhood around
this pixel. z
1z
2z
3
z
4z
5z
6
z
7
z
8
z
9

Slide Slide 1010
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Sobel Edge Detector
-1 -2 -1
0 0 0
1 2 1
-1 0 1
-2 0 2
-1 0 1
  
321987 22 zzzzzzG
x    
741963
22 zzzzzzG
y


Slide Slide 1111
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Prewitt Edge Detector
-1 -1 -1
0 0 0
1 1 1
-1 0 1
-1 0 1
-1 0 1
  
321987 zzzzzzG
x    
741963 zzzzzzG
y 

Slide Slide 1212
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Roberts Edge Detector
0 0 0
0 -1 0
0 0 1
0 0 0
0 0 -1
0 1 0
59
zzG
x

68zzG
y 
The Roberts Edge Detector is in fact a 2x2 operator

Slide Slide 1313
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Canny Method
Two Possible Implementations:
1.The image is convolved with a Gaussian filter before gradient
evaluation
2.The image is convolved with the gradient of the Gaussian
Filter.

22
2
2
2
yxr
erh
r



Slide Slide 1414
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Edge Detection Algorithm
•The gradient is calculated (using any of the four
methods described in the previous slides), for each
pixel in the picture.
•If the absolute value exceeds a threshold, the pixel
belongs to an edge.
•The Canny method uses two thresholds, and enables
the detection of two edge types: strong and weak
edge. If a pixel's magnitude in the gradient image,
exceeds the high threshold, then the pixel
corresponds to a strong edge. Any pixel connected to
a strong edge and having a magnitude greater than
the low threshold corresponds to a weak edge.

Slide Slide 1515
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
The Edge Detection Block
•The Edge Detection Block supports the four methods
described in the pervious slides

Slide Slide 1616
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Hands-On
•Simulation
•Implementation using the DSK6416

Slide Slide 1717
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Simulation
Image File
MATLAB
®

Display
Edge
Detection

Slide Slide 1818
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Edge Detection Simulation

Slide Slide 1919
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
DSK6416
Image
File
MATLAB
Display
Edge
Detection
Script
RGB
to
Grayscale
RTDXRTDX
Edge Detection on Stills Images

Slide Slide 2020
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Edge Detection Using the DSK6416

Slide Slide 2121
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Video
in
Video
out
DM6437 DVDP
Edge
Detection
Video ScreenCamera
Edge Detection on Video

Slide Slide 2222
© © 2007 Texas Instruments Inc, 2007 Texas Instruments Inc,
Edge Detection Real Time Model for the
DM6437 DVDP