Transcript FAsT-Match

FAsT-Match:
Fast Affine Template Matching
Simon Korman, Daniel Reichman, Gilad Tsur, Shai Avidan
CVPR 2013
Presented by Lee, YoonSeok
Review :
Boundary Preserving Dense Local Regions
2
Overview
● Template Matching : Related Work
● Main Idea
● Algorithm
● Result
● Summary
3
Generalized Template Matching
● Find the best
…/Translation/Euclidean/Similarity/Affine/Projective/…
transformation between two given images:
4
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Generalized Template Matching
● The algorithm:
1. Take a sample of the Affine transformations
2. Evaluate each transformation in the sample
3. Return the best
● Questions:
● Which sample to use?
● How does is guarantee a bound?
5
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Related Work : Direct methods
6
Lucas, Kanade “An iterative image registration technique with an application to stereo vision” [ICAI 1981]
Baker, Matthews “Lucas-Kanade 20 years on: A unifying framework” [IJCV 04]
Related Work : Indirect methods
7
Lowe “Distinctive image features from scale-invariant key-points” [IJCV 04]
Morel, Yu “Asift: A new framework for fully affine invariant image comparison” [SIAM 09]
M.A. Fichler, R.C. Bolles “Random sample consensus” [Comm. of ACM 81]
The Main Idea
template
Transformation
space (e.g. affine)
8
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
image
Formal Problem Statement
● Input: Grayscale image (template) I 1 ( n1  n1 ) and image I 2
I2
I1
T
● Distance with respect to a specific transformation T :
 T ( I1 , I 2 ) 
1
n

2
1 p I 1
I 1 ( p )  I 2 ( T ( p ))
● Distance with respect to any transformation in a family  (affinities):
 ( I 1 , I 2 )  min  T ( I 1 , I 2 )
T 
● Goal: Given 𝛿 > 0, find a transformation T * in  for which:
 ( I1 , I 2 )   T * ( I1 , I 2 )  
9
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Simple Algorithm

For each affine transformation 𝑇





10
Compute the distance ∆ 𝑇 (𝐼1 , 𝐼2 )
Return 𝑇 ∗ with smallest distance
∞ transformations – need to discretize
“Combinatorial bounds and algorithmic aspects of image
matching under projective transformations” [Hundt &
Liskiewicz MFCS, 2008]
 Enumerate ≈ 𝑛18 affine transformations (for 𝑛 × 𝑛
images)
Guarantee: best possible transformation
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Algorithm – take2

For each affine transformation 𝑇 in a Net 𝐴𝛿



Return 𝑇 ∗ with smallest distance
build a Net 𝐴𝛿 of transformations
Guarantee

‘𝛿 – away’ from best possible distance
∆ 𝑇 𝑂𝑃𝑇 𝐼1 , 𝐼2 − ∆ 𝑇 ∗ (𝐼1 , 𝐼2 ) = 𝑂(𝛿)
11
O ( )
Sample transformation space


Compute the distance ∆ 𝑇 (𝐼1 , 𝐼2 )
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
𝑇 𝑂𝑃𝑇
𝑇∗
Algorithm – take3

For each affine transformation 𝑇 in a Net 𝐴𝛿


Compute the distance ∆ 𝑇 (𝐼1 , 𝐼2 )
Estimate
Return 𝑇 ∗ with smallest distance
estimate



Estimate the SAD to within O(𝛿)
By sampling  (1 /  2 )
pixels
Thus – total runtime is: | A |  (1 /  2 )   ( 1  ( nn ) 2 )
2
8
∆ 𝑇 𝑂𝑃𝑇 𝐼1 , 𝐼2 − ∆ 𝑇 ∗ (𝐼1 , 𝐼2 ) = 𝑂(𝛿)
12
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
1
The net 𝐴𝛿
● Transformations T1 and T2 are x-close
𝑇ℎ𝑒 𝑛𝑒𝑡 𝐴𝛿
T1
T2
L  (T1 , T 2 )  max T1 ( p )  T 2 ( p )
p I 1
2
 x
● The Net 𝐴𝛿
●
x = δn1
Any affine transformation is δn1-close to some tran
s. in 𝐴𝛿
●(𝐴𝛿 is a δn1-cover of affine transformations)
● Possible construction with size:  (
13
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
1

6
 ( n12 ) )
n
2
Fast-Match:
a Branch-and-Bound Scheme
● Iteratively increase Net-precision (decrease δ)
● Throw away irrelevant transformation regions
●
𝑇 𝐶𝑙𝑜𝑠𝑒𝑠𝑡 is guaranteed to move to next round
●
(off-net neighbors of above- threshold points are worse than 𝑇 ∗ )
𝑇ℎ𝑒 𝑛𝑒𝑡 𝐴𝛿
𝑇
14
𝑂𝑃𝑇
𝑇 𝐶𝑙𝑜𝑠𝑒𝑠𝑡
𝑇∗
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Result
● Pascal VOC 2010 data-set
● 200 random image/templates
● Template dimensions of 10%, 30%, 50%, 70%,
90%
● ‘Comparison’ to a feature-based method - ASIFT
● Image degradations (template left in-tact):
●Gaussian Blur with STD of {0,1,2,4,7,11} pixels
●Gaussian Noise with STD of {0,5,10,18,28,41}
●JPEG compression of quality {75,40,20,10,5,2}
15
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Result

16
Fast-Match vs. ASIFT – template dimension 50%
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Result

17
Fast-Match vs. ASIFT – template dimension 20%
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Result
● Runtimes
18
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Template Dim:
45%
19
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Template Dim:
35%
20
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Template Dim:
25%
21
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Template Dim:
15%
22
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Template Dim:
10%
23
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Bad overlap due to ambiguity
24
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
High SAD due to high TV and ambiguity
25
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Fast-Match: Summary
● Handles template matching under arbitrary
Affine (6 dof) transformations with
● Guaranteed error bounds
● Fast execution
● Main ingredients
● Sampling of transformation space (based on variation)
● Quick transformation evaluation (‘property testing’)
● Branch-and-Bound scheme
26
FAsT-Match: Fast Affine Template Matching [Simon Korman et al., CVPR 2013]
Q&A
27