Professional Documents
Culture Documents
IT5409 Ch4 Part1 Edges 4pages
IT5409 Ch4 Part1 Edges 4pages
Plan
• Edges
‒ Detection
‒ linking
1 2
3 4
22/05/2021
5 6
7 8
22/05/2021
Vanishing Vanishing
Source: J. Hayes point point
10 11
https://www.mathworks.com/help/images/intensity-profile-of-images.html
12 13
22/05/2021
The first
derivative
The second
derivative
Backward
• Discrete derivative in 1D
Forward
Central
16 17
22/05/2021
• Forward:
[-1 1 0]
f(x) : 0 0 0 0 0 50 50 50 50 50
f'(x): 0 0 0 0 0 50 0 0 0 0
• Central:
[1 0 -1]
18 19
y
0
0 1 -1 1
-1
-1 1
-1 1 0 1 0 1 0 -1
0 -1
20 21
22/05/2021
Image I (9 x 8)
0 0 0 0 0 0 0 0 0
Discrete derivate filters wrt. x and y 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Mx: Derivative filter wrt x
1 0 -1
0 0 0 0 0 0 0 0 0
• Robert filter (the first approximation filter for image derivative - 0 0 0 0 0 0 0 0 0 1
0 0 0 100 100 100 100 100 100
1965) 0
0 0 0 100 100 100 100 100 100
0 0 0 100 100 100 100 100 100 -1
0 0 0 100 100 100 100 100 100 My: Derivative filter wrt y
0 0 0 100 100 100 100 100 100
0 0 0 100 100 100 100 100 100
Image I (9 x 8)
0 0 0 0 0 0 0 0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Mx: Derivative filter wrt x
1 0 -1
3x3 image gradient filters
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1
0 0 0 100 100 100 100 100 100
0
0 0 0 100 100 100 100 100 100
0 0 0 100 100 100 100 100 100 -1
0 0 0 100 100 100 100 100 100 My: Derivative filter wrt y
0 0 0 100 100 100 100 100 100
0 0 0 100 100 100 100 100 100
• Gradient Direction: main direction of each pixel • The edge strength is given by the gradient magnitude
𝜃 = tan 𝐺 /𝐺
Source: Steve Seitz
26 27
Original Gradient
Image magnitude
x-direction y-direction
Source : Gonzalez and Woods. Digital Image Processing 3ed. Prentice-Hall, 2008. Source : Gonzalez and Woods. Digital Image Processing 3ed. Prentice-Hall, 2008.
30 31
32 33
22/05/2021
d d
g
( f g) dx
dx
d d
• To find edges, look for peaks in ( f g) f g
dx dx
Source: S. Seitz
Source: S. Seitz
34 35
1 0 −1 1
• This saves us one operation: 𝐺 = 2 0 −2 = 2 1 0 −1
f
1 0 −1 1
differentiation
d
g
1 2 1 1
dx 𝐺 = 0 0 0 = 0 1 2 1
−1 −2 −1 −1
d
f g
dx
Less sensible to noise
Source: S. Seitz
36 37
22/05/2021
38 39
Threshold
Threshold T = 60
T = 25
40
22/05/2021
Edge detector with 2nd derivative Edge detector with 2nd derivative
• 2nd derivative with Laplacian filter:
‒ convolution the image with one of 2 filters
• Edge detection
‒ Compute the 2nd derivative of the images
‒ Find the zero-crossing pixels edges
Zero-crossing
42 43
‒ Single response
‒ Sensible to noise
44
22/05/2021
J. Canny, A Computational Approach To Edge Detection, IEEE Trans. PAMI, 8:679-714, 1986.
Source: S. Seitz
Non-maxima Thresholding
suppression
Hough transform
Edge linking
Hough Transform
RANSAC
54 56
58
22/05/2021
y i = a xi + b b = - xi a + yi
yi = a x i + b b = - xi a + y i
59 60
Main idea for the Hough transform Computing the Hough transform
Accumulation cells - Matrix (a,b) We compute the contour points of the input image
Build an voting image Sobel, Prewitt, Canny, …
each point is voting for a particular line
For each contour point, we compute a line (a,b)
The lines receiving more votes are kept
Result is one line in the a-b plane for each pixel (x,y)
61 62
22/05/2021
D A E 1
3
3
4 B
F
θ = ±90 4 5
Image containing 5
5 points
Hough transform
Source : Gonzalez and Woods. Digital Image Processing 3ed. Prentice-Hall, 2008.
63 64
The transform of random points does not give any precise results
65 66
22/05/2021
Hough Final
Lines
Hough Final
Source : Gonzalez and Woods. Digital Image Processing. Prentice-Hall, 2002. 67 Source : Gonzalez and Woods. Digital Image Processing. Prentice-Hall 3ed, 2008. 68
Ransac Ransac
• A model fitting method:
‒ A learning technique to estimate parameters of a model
by random sampling of observed data
‒ Used for :
• Line detection
• Correspondance problem (matching between 2 sets of
features)
• …
CS231: Ransac, Juan Carlos Niebles and Ranjay Krishna, Stanford Vision and Learning Lab
69 70
22/05/2021
RANSAC [Fischler & Bolles 1981] RANSAC [Fischler & Bolles 1981]
“7 inlier points”
Plan References
• Edges • Lecture 3: CS231 - Juan Carlos Niebles and Ranjay
‒ Detection Krishna, Stanford Vision and Learning Lab
‒ linking • Vision par Ordinateur, Alain Boucher, IFI
• Feature extraction (next lesson)
‒ Global features
‒ Local features
• Image Matching and Applications (next lesson)
89 90
22/05/2021
91