Features and Fitting
St Stanfor
- rd University
08-Oct-2019 1
Lecture: RANSAC and feature detectors 08-Oct-2019 Juan Carlos - - PowerPoint PPT Presentation
Features and Fitting Lecture: RANSAC and feature detectors 08-Oct-2019 Juan Carlos Niebles and Ranjay Krishna Stanford Vision and Learning Lab 1 St Stanfor ord University CS 131 Roadmap Features and Fitting Pixels Segments Images
Features and Fitting
St Stanfor
08-Oct-2019 1
Features and Fitting
St Stanfor
08-Oct-2019 2
Convolutions Edges Features
Resizing Segmentation Clustering Recognition Detection Machine learning
Motion Tracking
Neural networks Convolutional neural networks
Features and Fitting
St Stanfor
08-Oct-2019 3
– RANSAC
– Motivation – Requirements, invariances
– Harris corner detector
Features and Fitting
St Stanfor
08-Oct-2019 4
– RANSAC
– Motivation – Requirements, invariances
– Harris corner detector
Features and Fitting
St Stanfor
08-Oct-2019 5
– Can’t tell whether a point belongs to a given model just by looking at that point.
– What model represents this set of features best? – Which of several model instances gets which feature? – How many model instances are there?
– It is infeasible to examine every possible set of parameters and every possible combination
Source: L. Lazebnik
Features and Fitting
St Stanfor
08-Oct-2019 6
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 7
– Which points go with which line, if any?
– How to find a line that bridges missing evidence?
– How to detect true underlying parameters?
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 8
– Cycle through features, cast votes for model parameters. – Look for model parameters that receive a lot of votes.
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 9
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 10
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 11
– How many points do we need to estimate the line?
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 12
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 13
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 14
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 15
“7 inlier points”
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 16
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 17
“11 inlier points”
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 18
Features and Fitting
St Stanfor
08-Oct-2019 19
– n points needed to define hypothesis (2 for lines) – k samples chosen.
n
k n
Slide credit: David Lowe
Features and Fitting
St Stanfor
08-Oct-2019 20
Sample size
n Proportion of outliers 5% 10% 20% 25% 30% 40% 50%
Slide credit: David Lowe
Features and Fitting
St Stanfor
08-Oct-2019 21
Slide credit: David Lowe
Features and Fitting
St Stanfor
08-Oct-2019 22
– General method suited for a wide range of model fitting problems – Easy to implement and easy to calculate its failure rate
– Only handles a moderate percentage of outliers without cost blowing up – Many real problems have high rate of outliers (but sometimes selective choice of random subsets can help)
Features and Fitting
St Stanfor
08-Oct-2019 23
– RANSAC
– Motivation – Requirements, invariances
– Harris corner detector
Some background reading: Rick Szeliski, Chapter 4.1.1; David Lowe, IJCV 2004
Features and Fitting
St Stanfor
08-Oct-2019 24
Features and Fitting
St Stanfor
08-Oct-2019 25
by Diva Sian by swashford
Slide credit: Steve Seitz
Features and Fitting
St Stanfor
08-Oct-2019 26
by Diva Sian by scgbt
Slide credit: Steve Seitz
Features and Fitting
St Stanfor
08-Oct-2019 27
NASA Mars Rover images
Slide credit: Steve Seitz
Features and Fitting
St Stanfor
08-Oct-2019 28
NASA Mars Rover images with SIFT feature matches (Figure by Noah Snavely)
Slide credit: Steve Seitz
Features and Fitting
St Stanfor
08-Oct-2019 29
– Occlusions – Articulation – Intra-category variations
θq
φ
dq
φ θ
d
Features and Fitting
St Stanfor
08-Oct-2019 30
N pixels N pixels
Similarity measure A
e.g. color
B
e.g. color
distinctive key- points
normalize the region content
around each keypoint
descriptor from the normalized region
descriptors
Slide credit: Bastian Leibe
A1 A2 A3 B1 B2 B3
T f f d
B A
< ) , (
Features and Fitting
St Stanfor
08-Oct-2019 31
No chance to match!
Slide credit: Darya Frolova, Denis Simakov
Features and Fitting
St Stanfor
08-Oct-2019 32
Slide credit: Darya Frolova, Denis Simakov
Features and Fitting
St Stanfor
08-Oct-2019 33
Slide credit: Steve Seitz
Features and Fitting
St Stanfor
08-Oct-2019 34
Slide credit: Bastian Leibe
Features and Fitting
St Stanfor
08-Oct-2019 35
transformation:
– Scaling + Offset
Slide credit: Tinne Tuytelaars
Features and Fitting
St Stanfor
08-Oct-2019 36
– Invariant to translation, rotation, scale changes – Robust or covariant to out-of-plane (»affine) transformations – Robust to lighting variations, noise, blur, quantization
Slide credit: Bastian Leibe
Features and Fitting
St Stanfor
08-Oct-2019 37
[Beaudet ‘78], [Harris ‘88]
[Lindeberg ‘98], [Lowe ‘99]
[Mikolajczyk & Schmid ‘04]
[Tuytelaars & Van Gool ‘04]
[Matas ‘02]
[Kadir & Brady ‘01]
Slide credit: Bastian Leibe
Features and Fitting
St Stanfor
08-Oct-2019 38
– RANSAC
– Motivation – Requirements, invariances
– Harris corner detector
Some background reading: Rick Szeliski, Chapter 4.1.1; David Lowe, IJCV 2004
Features and Fitting
St Stanfor
08-Oct-2019 39
– Repeatable detection – Precise localization – Interesting content
Þ Look for two-dimensional signal changes
Slide credit: Bastian Leibe
Features and Fitting
St Stanfor
08-Oct-2019 40
– In the region around a corner, image gradient has two or more dominant directions
C.Harris and M.Stephens. "A Combined Corner and Edge Detector.“ Proceedings of the 4th Alvey Vision Conference, 1988.
Slide credit: Svetlana Lazebnik
Features and Fitting
St Stanfor
08-Oct-2019 41
“edge”: no change along the edge direction “corner”: significant change in all directions “flat” region: no change in all directions
Slide credit: Alyosha Efros
Features and Fitting
St Stanfor
08-Oct-2019 42
Large Large
Small Large
Small Small
Features and Fitting
St Stanfor
08-Oct-2019 43
?? ??
Features and Fitting
St Stanfor
08-Oct-2019 44
“corner”: significant change in all directions
𝐽 𝑦, 𝑧
𝐽 𝑦 + 𝑣, 𝑧 + 𝑤
Measure change as intensity difference:
𝑣, 𝑤 That’s for a single point, but we have to accumulate over a ”small window” around that point…
Features and Fitting
St Stanfor
08-Oct-2019 45
2 x,y
Intensity Shifted intensity Window function
Window function w(x,y) = Gaussian 1 in window, 0 outside
Slide credit: Rick Szeliski
Features and Fitting
St Stanfor
08-Oct-2019 46
Sum over image region – the area we are checking for corner
Gradient with respect to x, times gradient with respect to y
2 2 ,
x x y x y x y y
Slide credit: Rick Szeliski
Features and Fitting
St Stanfor
08-Oct-2019 47
Ix
Image I
IxIy Iy
Sum over image region – the area we are checking for corner
Gradient with respect to x, times gradient with respect to y
2 2 ,
x x y x y x y y
Slide credit: Rick Szeliski
Features and Fitting
St Stanfor
08-Oct-2019 48
– Dominant gradient directions align with x or y axis – If either λ is close to 0, then this is not a corner, so look for locations where both are large.
2 1 2 2
y y x y x x
Slide credit: David Jacobs
Features and Fitting
St Stanfor
08-Oct-2019 49
– Dominant gradient directions align with x or y axis – If either λ is close to 0, then this is not a corner, so look for locations where both are large.
2 1 2 2
y y x y x x
Slide credit: David Jacobs
Features and Fitting
St Stanfor
08-Oct-2019 50
1 1
Direction of the slowest change Direction of the fastest change
adapted from Darya Frolova, Denis Simakov
(Eigenvalue decomposition)
Features and Fitting
St Stanfor
08-Oct-2019 51
“Corner” l1 and l2 are large, l1 ~ l2; E increases in all directions l1 and l2 are small; E is almost constant in all directions “Edge” l1 >> l2 “Edge” l2 >> l1 “Flat” region
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 52
– Avoid computing the eigenvalues – α: constant (0.04 to 0.06)
“Corner” θ > 0 “Edge” θ < 0 “Edge” θ < 0 “Flat” region
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 53
– Sum over square window – Problem: not rotation invariant
– Gaussian already performs weighted sum – Result is rotation invariant 1 in window, 0 outside
2 2 ,
x x y x y x y y
Gaussian
2 2 , x x y x y x y y
I I I M I I I é ù = ê ú ê ú ë û
2 2
( )
x x y x y y
I I I M g I I I s é ù = *ê ú ê ú ë û
Slide credit: Bastian Leibe
Features and Fitting
St Stanfor
08-Oct-2019 54
derivatives
Ix Iy
derivatives
Ix2 Iy2 IxIy
filter g(sI)
g(Ix2) g(Iy2) g(IxIy) R
2 2
( ) ( ) ( , ) ( ) ( ) ( )
x D x y D I D I x y D y D
I I I M g I I I s s s s s s s é ù = *ê ú ê ú ë û
2 2 2 2 2 2
( ) ( ) [ ( )] [ ( ) ( )]
x y x y x y
g I g I g I I g I g I a =
θ = det[M (σ I,σ D)]−α[trace(M (σ I,σ D))]2
Slide credit: Krystian Mikolajczyk
𝜏*: for Gaussian in the derivative calculation 𝜏+: for Gaussian in the windowing function
Features and Fitting
St Stanfor
08-Oct-2019 55
Slide adapted from Darya Frolova, Denis Simakov
Features and Fitting
St Stanfor
08-Oct-2019 56
Slide adapted from Darya Frolova, Denis Simakov
Features and Fitting
St Stanfor
08-Oct-2019 57
Slide adapted from Darya Frolova, Denis Simakov
Features and Fitting
St Stanfor
08-Oct-2019 58
Slide adapted from Darya Frolova, Denis Simakov
Features and Fitting
St Stanfor
08-Oct-2019 59
Effect: A very precise corner detector.
Slide credit: Krystian Mikolajczyk
Features and Fitting
St Stanfor
08-Oct-2019 60
Slide credit: Krystian Mikolajczyk
Features and Fitting
St Stanfor
08-Oct-2019 61
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 62
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 63
Ellipse rotates but its shape (i.e. eigenvalues) remains the same
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 64
All points will be classified as edges! Corner
Slide credit: Kristen Grauman
Features and Fitting
St Stanfor
08-Oct-2019 65
– RANSAC
– Motivation – Requirements, invariances
– Harris corner detector