Professional Documents
Culture Documents
EDGE DETECTION
2020/2021 - 1 Pengolahan Citra
Definition of Edges
1
Geometric events
surface orientation (boundary) discontinuities
depth discontinuities
color and texture discontinuities
inter-reflections
illumination discontinuity
Goal of Edge Detection
3
Edge direction:
perpendicular to the direction
of maximum intensity change
(i.e., edge normal)
Edge strength: related to the
local image contrast along
the normal.
Edge position: the image
position at which the edge is
located.
Modeling Intensity Changes
7
Assume 1D functions:
(not centered at x)
(centered at x)
(centered at x+1)
ramp edge
roof edge
Edge Detection Using Second
19
Derivative (cont’d)
Four cases of zero-crossings:
{+,-}, {+,0,-},{-,+}, {-,0,+}
Slope of zero-crossing {a, -b} is: |a+b|.
To detect zero-crossing threshold the slope.
i.e.,if the slope is above some threshold, then that point
is an edge point.
Effect Smoothing on Derivates
20
Cartesian vs pixel-coordinates:
- j corresponds to the x direction
- i to the negative y direction
Approximating Gradient (cont’d)
28
∂f
sensitive to vertical edges
∂x
Approximating Gradient (cont’d)
29
(x+1/2,y)
good approximation
(x,y+1/2)
at (x+1/2,y) *
*
good approximation
at (x,y+1/2)
30
Approximating Gradient (cont’d)
3 x 3 neighborhood:
The constant c implies the emphasis given to pixels closer to the center of
the mask.
Prewitt Operator
32
d
I
dx
d
I
dy
Another Example (cont’d)
37
2
d d
2
∆ = I + I
dx dy
∆ ≥ Threshold = 100
Isotropic property of gradient
38
magnitude
The magnitude of the gradient detects edges in all
directions.
2
d d
2
d d
I I ∆ = I + I
dx dy dx dy
Criteria for Optimal Edge Detection
39
(and direction)
Canny edge detector - example
43
original image
Canny edge detector – example
44
(cont’d)
Gradient magnitude
Canny edge detector – example
45
(cont’d)
Thresholded gradient magnitude
Canny edge detector – example
46
(cont’d)
Thinning (non-maxima suppression)
Non-maxima suppression
47
(i,j)
Hysteresis thresholding
49
• Standard thresholding:
th
tl th
tl
Use edge
“direction” for
linking edges
Hysteresis Thresholding/Edge Linking
52
(cont’d)
detect zero-crossings
Properties of Laplacian
57
It is an isotropic operator.
It is cheaper to implement than the gradient (i.e.,
one mask only).
It does not provide information about edge
direction.
It is more sensitive to noise (i.e., differentiates
twice).
Laplacian of Gaussian (LoG)
(Marr-Hildreth operator)
58
2σ2
Laplacian of Gaussian (LoG) -
59
Example
(inverted LoG)
(inverted LoG)
filtering zero-crossings
Decomposition of LoG
60
Algorithm
Difference of Gaussians (DoG)
62
approximation
actual LoG
Difference of Gaussians (DoG) (cont’d)
63
ramp edge
Second Directional Derivative
65
Steps
1. Fit a bi-quadratic polynomial to a small
neighborhood of a pixel.
2. Compute analytically the second and third directional
derivatives in the direction of gradient.
3. If the second derivative is equal to zero, and the third
derivative is negative, then that point is an edge
point.
Edge detection is just the beginning…
71
Choice of threshold.
gradient magnitude