Professional Documents
Culture Documents
Digital Image
Processing
Edge Detection
Edge Detection
depth discontinuity
illumination discontinuity
Step Edges
– Edge Magnitude
– Edge Orientation
– High Detection Rate and Good Localization
Gradient
• Gradient equation:
• Gradient direction:
Ideal edge
y
B1 Lx, y x sin y cos 0
B1 : Lx, y 0
B2 t B2 : Lx, y 0
x
Unit step function:
1 for t 0
u t 1 u t s ds
t
for t 0
2
0 for t 0
• Squared gradient:
2
I I
2
x y
Edge Magnitude: sx, y
I I
Edge Orientation: arctan / (normal of the edge)
y x
Rotationally symmetric, non-linear operator
Theory of Edge Detection
• Image intensity (brightness):
I x, y B1 B2 B1 u x sin y cos
• Partial derivatives (gradients):
I
sin B2 B1 x sin y cos
x
I
cos B2 B1 x sin y cos
y
• Laplacian:
2I 2I
I 2 2 B2 B1 ' x sin y cos
2
x y
Rotationally symmetric, linear operator
I 2I
I
x x 2 zero-crossing
x
x x
Discrete Edge Operators
• How can we differentiate a discrete image?
I
1
Ii1, j 1 I i, j 1 Ii1, j I i, j I i , j 1 I i 1, j 1
x 2
I
1
I i1, j 1 I i1, j I i, j 1 I i, j I i, j I i 1, j
y 2
Convolution masks :
I 1 1 1 I 1 1 1
x 2 y 2
1 1 1 1
Discrete Edge Operators
• Second order partial derivatives:
I i 1, j 1 I i , j 1 I i 1, j 1
I 1
2 I i 1, j 2 I i , j I i 1, j
2
x 2
I i 1, j I i , j I i 1, j
2I 1
2 I i , j 1 2 I i , j I i , j 1 I i 1, j 1 I i , j 1 I i 1, j 1
y 2
• Laplacian :
2I 2I
I 2 2
2
x y
Convolution masks :
0 1 0 1 4 1
1 1
2I 1 4 1 or 20 4
2 6 2
4 (more accurate)
0 1 0 1 4 1
The Sobel Operators
• Better approximations of the gradients exist
-1 0 1 1 2 1
-2 0 2 0 0 0
-1 0 1 -1 -2 -1
Comparing Edge Operators
Good Localization
Gradient: Noise Sensitive
Poor Detection
Roberts (2 x 2): 0 1 1 0
-1 0 0 -1
Sobel (3 x 3):
-1 0 1 1 1 1
-1 0 1 0 0 0
-1 0 1 -1 -1 1
Sobel (5 x 5):
-1 -2 0 2 1 1 2 3 2 1
-2 -3 0 3 2 2 3 5 3 2
Poor Localization
-3 -5 0 5 3 0 0 0 0 0
Less Noise Sensitive
-2 -3 0 3 2 -2 -3 -5 -3 -2 Good Detection
-1 -2 0 2 1 -1 -2 -3 -2 -1
Effects of Noise
• Consider a single row or column of the image
– Plotting intensity as a function of position gives a signal
Fourier Transform
100
200
300 – =
400
500
+a =
Finding Zero Crossing
Example: For “maybe” edges, decide on the edge if neighboring pixel is a strong edge.
Convolution
with LoG
𝜎 = 4, 𝑛 = 25
Some properties of Marr-Hildreth Edge
Detector
Canny Edge Operator
Canny Edge Operator
Canny Edge Operator
Canny Edge Operator
Canny Edge Operator
Canny Edge Operator
Canny Edge Operator