1
Edge Detection
(points and lines too)
Image analysis
- Image Analysis
– Derive “features” from an image – segment an image into its constituent parts or objects
- how and why depends on application
- Segmentation
Edge Detection (points and lines too) Image analysis Image - - PDF document
Edge Detection (points and lines too) Image analysis Image Analysis Derive features from an image segment an image into its constituent parts or objects how and why depends on application Segmentation Hard
1
2
Low-Level Processing Segmentation Feature Detection Analysis
Fish at (x,y) Fish at (u,v)
(x,y) (u,v)
(Early Vision) (Higher Vision) (Early Vision)
3
8
|R| > T R is the response, T is a non-negative threshold |Responses| greater than T are points Apply this mask to each point in image
Example
4
2 2 2
|R| > T T is a non-negative threshold Construct a mask to find “features” of interest
5
2 2 2
2
2
2
2
2
2
2
2
2
Horizontal +45o
Vertical
6
Real Edge False Edge (Occluding Edge) False Edge (Shadow)
7
1
1
1
1 1 1
Gx Gy
⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ ⎡ ∂ ∂ ∂ ∂ = ∇ y f x f y) f(x,
⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎣ ⎡ = ∇ Gy Gx y) f(x,
8
2 / 1 2 2
y x
9
T = 100 T = 150 T = 50 Results with different threshold T (Lets call this image Ie)
10
−
1 Gy
11
−
1 Gy
atan(-1) = -45o (which is really 45o) Edge Direction
Assume the Gradient was computed via Prewitt Mask
Edge Normal
Edges should have similar edge normals
12
– search the N_8 neighbors (x’,y’)
– Link Pixels
13
Edges (Just an example)
14
15
– Suppress as much noise as possible (without blurring out the true edge)
Global edge + local edge
CANNY_ENHANCER
NONMAX_SUPPRESSION
16
– Gaussian filter
– (a) Compute Gx and Gy – (b) Compute mag(G) = es(i,j)
– (call es (i,j) edge strength)
– (c) estimate the orientation of the edge
– arctan( Gy/Gx) – (call this ea (i,j) edge angle) – often ea (i,j) = atan(-Gy/Gx) » Need to negate the Y-direction to flip the axis » Add pi to the negative values » Making the angles range from 0 to pi
2 2 2
2 2
σ
y x
+ −
[-2,2] with σ=1
Filter Size
17
these directions (next slide)
In(i,j) = 0
– In(i,j) = es (i,j)
d = 0 n4 n6 d = 45 n7 n3 d = 90 n2 n8 d= 135 n1 n9
n1 n2 n3 n4 n5 n6 n7 n8 n9
n1 n2 n3 n4 n5 n6 n7 n8 n9 n1 n2 n3 n4 n5 n6 n7 n8 n9 n1 n2 n3 n4 n5 n6 n7 n8 n9 n1 n2 n3 n4 n5 n6 n7 n8 n9
Direction Neighbors Representation
18
– tl, th (where tl < th)
– Locate the next unvisited edge pixel In(i,j) such that In(i,j) > th – Starting from In(i,j)
the edge normal that have values In > tl
th is global threshold. At least one pixel in the edge has to satisfy this. tl is local, the connecting edgelets have to satisfy this.
19
d = 0 n2 n8 d = 45 n1 n9 d = 90 n4 n6 d= 135 n7 n3
n1 n2 n3 n4 n5 n6 n7 n8 n9
n1 n2 n3 n4 n5 n6 n7 n8 n9 n1 n2 n3 n4 n5 n6 n7 n8 n9 n1 n2 n3 n4 n5 n6 n7 n8 n9 n1 n2 n3 n4 n5 n6 n7 n8 n9
Direction P-Neighbors Representation
th = 150, tl = 50
20
Input Sobel Canny
21
1
2
1
1 2 1
– Build an appropriate mask to generate the desired response
– Relies on Image Gradient Gx and Gy, Gradient Magnitude, Gradient Angle
– Very common edge detector – Introduces NON_MAXSUPPRESSION – Uses a two level threshold
22