9 ComputerVision
9 ComputerVision
1
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
1 Recap
2
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
1 Recap
3
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
4
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
5
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
6
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
7
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
8
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Object recognition
Wide baseline matching
Tracking
9
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
We want invariance!
10
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Image matching
11
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Image matching
Harder case
12
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Image matching
"How the Afghan Girl was Identified by Her Iris Patterns1 "
1
https://www.cl.cam.ac.uk/~jgd1000/afghan.html 13
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Image matching
Image matching
Image matching
16
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Image matching
17
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
18
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
19
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
More motivation
20
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Uniqueness
21
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
22
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
23
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
24
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
25
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
1 Recap
26
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
27
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
The problem
How do we choose corresponding circles independently in
each image?
Do objects in the image have a characteristic scale that we
can identify?
28
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Solution
29
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
30
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
31
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Goal
32
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Properties of SIFT
Highly distinctive
A single feature can be correctly matched with high
probability against a large database of features from many
images.
Scale and rotation invariant.
Partially invariant to 3D camera viewpoint
Can tolerate up to about 60 degree out of plane rotation
Can handle significant changes in illumination
Sometimes even day vs. night (below)
Fast and efficient - can run in real time
Lots of code available
33
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Advantages
34
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
35
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Scales
36
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
37
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
38
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
39
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Laplacian-of-Gaussian (LoG)
40
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
41
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
42
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
43
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
44
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
45
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
46
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
47
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
48
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
49
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
50
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
51
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Solution(1/3)
∂D T 1 ∂2D
D(xo + x) ≈ D(Xo ) + x + xT x (1)
∂x 2 ∂x 2
To find maxima or minima, we know that
∂D(xo + x)
=0 (2)
∂x
Derivate 1 w.r.t. x
∂D(xo +x) ∂D 1 ∂2D
∂x
=0+ ∂x
+ 2
×2× ∂x 2
x̂
Put in 2, which becomes
∂D ∂2D
+ x̂ = 0 (3)
∂x ∂x 2
By solving 3, we get
∂ 2 D −1 ∂D
x̂ = − (4)
∂x 2 ∂x
52
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Solution(2/3)
1 can be modified as
∂D T 1 ∂2D
D(xo + x̂) ≈ D(Xo ) + x̂ + x̂ T x̂ (5)
∂x 2 ∂x 2
Put the value of x̂ computed in 4. 5 becomes
T 2
∂D T ∂ 2 D −1 ∂D
1 ∂ D
D(xo + x̂) ≈ D(Xo ) + x̂ + − x̂ (6)
∂x 2 ∂x 2 ∂x ∂x 2
T −1
!T
∂D T ∂2D ∂2D
1 ∂D
D(xo + x̂) ≈ D(Xo ) + x̂ − x̂ (7)
∂x 2 ∂x ∂x 2 ∂x 2
T
−1
∂2D
In 7, ∂x 2
represents the Hessian matrix which is symmetric in nature.
53
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Solution(3/3)
7 is solved to
∂D T 1 ∂D T
D(xo + x̂) ≈ D(Xo ) + x̂ − x̂ (8)
∂x 2 ∂x
1 ∂D T
D(xo + x̂) ≈ D(Xo ) + x̂ (9)
2 ∂x
If the result of (9) is less than 0.03, it is discarded saying it’s a
low contrast point.
All pixels are normalized
h between
i 0 and 1.
∂D ∂D ∂D ∂D
Note that ∂z = ∂x ∂y ∂σ
54
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
55
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Det(H) = r β2
= (r +1)
r
Keep only those values which satisfies the following condition
Tr (H)2 (r +1)2
Det(H) < r for r = 10
56
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
57
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
58
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
59
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Orientation Assignment
60
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Orientation Assignment
61
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Orientation Assignment
62
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Orientation Assignment
63
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
64
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
65
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
66
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Ambiguous matches
69
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
L2 Distance
70
CS-477 Computer Vision by Dr. Mohsin Kamal
Recap Scale-Invariant Feature Transform
Normalized Correlation
P
[(H1 (k ) − H̄1 )(H2 (k ) − H̄2 )]
k
d(H1 , H2 ) = rP rP (10)
(H1 (k ) − H̄1 )2 (H2 (k ) − H̄2 )2
k k
N
1 P
where Ĥi = N Hi (k )
k =1
Larger the distance metric, better the match
Perfect match when d(H1 , H2 ) = 1
71
CS-477 Computer Vision by Dr. Mohsin Kamal