Professional Documents
Culture Documents
1 2 3 4
5
6
Introduc,on
• We
first
select
a
First
Image
and
then
we
manually
adjust
the
others
to
made
the
panorama:
Homogeneous coordinates
⎡ xT ⎤ ⎡s ⋅ cos θ −s ⋅ sin θ t x ⎤⎡ x R ⎤
⎢ y ⎥ = ⎢ s ⋅ sin θ s ⋅ cosθ t y ⎥⎢ y R ⎥
⎢ T⎥ ⎢ ⎥⎢ ⎥
⎢⎣ 1 ⎥⎦ ⎢⎣ 0 0 1 ⎥⎦ ⎢⎣ 1 ⎥⎦
Affine
• 6
D.O.F.
Inhomogeneous coordinates
⎡ xT ⎤ ⎡ a11 a12 ⎤⎡ x R ⎤ ⎡ t x ⎤
• Parallel
lines
are
preserved
⎢ y ⎥ = ⎢a
⎣ T ⎦ ⎣ 21
+
a22 ⎥⎦⎢⎣ y R ⎥⎦ ⎢⎣ t y ⎥⎦
If
we
have
a
set
of
matched
points?
How
we
find
the
transforma,on
H?
Projec,on
Model
es,ma,on
Each
point
to
point
correspondences
give
rise
to
two
independent
equa,ons
(XT=HXR)
xT ( h31 x R + h32 y R + h33 ) = h11 x R + h12 y R + h13 ; yT ( h31 x R + h32 y R + h33 ) = h21 x R + h22 y R + h23
Template Target
(57,58) (320,406)
(52,67) (318,411)
(14,76) (249,477)
(38,35) (302,384)
(37,12) (301,364)
(7,25) (251,467)
(30,69) (295,414)
(18,70) (284,414)
(15,58) (281,404)
(20,53) (286,400)
(29,55) (294,402)
Reference
Target
(0,0)
(267,351)
(93,0)
(352,352)
(0,91)
(272,433)
(93,91)
(350,430)
XR XT=HSIFTXR
XT=HSIFTXR
(0,0)
(293,439)
1
(93,0)
(315,400)
2
(0,91)
(324,383)
3
(93,91)
(306,418)
4
Number
of
Samples
N
to
ensure
with
a
probabily
p=0.99,
that
a
least
one
sample
is
free
of
outliers
RANSAC:
Number
of
samples
Adap,vely
method
• Onen
ε
is
unknown
• So
define
the
worst
case
ε=0.5.
• Begin
with
a
large
N
and
recalculate
as
soon
as
we
are
evalua,ng
the
ra,o
of
inliers/outliers.
RANSAC:
Min
Consensus
• Terminate
when
the
consensus
of
a
trial
set
is
similar
to
the
size
of
the
number
of
inliers
believed
to
be
on
the
data
(size
n),
assuming
a
a
propor,on
of
outliers.
Consensusmin = (1− ε )n
Example
with
Homography
Matched
points
and
the
given
homography
Template Target
(57,58) (320,406)
(52,67) (318,411)
(14,76) (249,477)
(38,35) (302,384)
(37,12) (301,364)
(7,25) (251,467)
(30,69) (295,414)
(18,70) (284,414)
(15,58) (281,404)
(20,53) (286,400)
(29,55) (294,402)
Example
with
Homography
• n=11
Number
of
sample
• s=4
points
needed
to
es,mate
homography
• p=0.99 probability
of
a
least
1
sample
free
of
outliers
• ε=0.5
Worst
es,ma,on
(50
%
of
points
are
outliers)
• σ = 2 standard
devia,on
in
measured
error
(pixels)
• t2=5.99σ2=23.96 t=4.89 distance
threshold
• MinConsensus=round((1-0.5)*11)=6
log(1− p) log(1− 0.99)
N= = = 71.35
log(1− (1− ε ) ) log(1− (1− 0.5) )
s 4
Example
with
Homography
Reprojec,on
error
d⊥ = d ( x R ,H xT ) + d ( x T ,Hx R )
-1 2 2
Example
with
Homography
First
Trial
Selected
Points
⎡1.9893 −4.6401 249.9359 ⎤
Template Target Distance H1 = ⎢3.1725 −8.6414 468.9252⎥
⎢ ⎥
(57,58) (320,406) 56,1296
⎢⎣ 0.0071 −0.0184 1 ⎥⎦
(52,67) (318,411) 0.0000
(14,76) (249,477) 0.0000
ε1 = 1− 4 /11 = 0.6364
(38,35) (302,384) 91.7587
log(1− 0.99)
N1 = = 261.1722
(37,12) (301,364) 120.5504
log(1− (1− 0.6364) )
4
Consensus 6
Example
with
Homography
Third
Trial
Selected
Points
Template Target Distance ⎡ 0.4820 0.2232 267.5248 ⎤
(57,58) (320,406) 0.0000
H 3 = ⎢−0.5194 1.1472 353.7777⎥
(52,67) (318,411) 5.8306 ⎢ ⎥
(14,76) (249,477) 115.6277
⎢⎣−0.0014 0.0007 1 ⎥⎦
(38,35) (302,384) 1.3215 ε 3 = 1− 8 /11 = 0.2727
(37,12) (301,364) 0.0000
log(1− 0.99)
N 3= = 14.0302
log(1− (1− 0.2727) 4 )
(7,25) (251,467) 155.9488
(30,69) (295,414) 0.0000
(18,70) (284,414) 0.8439
(15,58) (281,404) 11.651
Repeat
the
process
un,l
a
new
(20,53) (286,400) 0.0000
consensus
is
found
or
the
Number
of
(29,55) (294,402) 0.1256
trials
is
reach.
Consensus 8
Example
Object
Tracking
with
RANSAC
Summary
• Introduc,on
• Projec,on
Models
• Projec,on
Model
es,ma,on
based
on
features
• Bad
Correspondences
• RANSAC
• Image
resampling
– Applica,ons
Image
Resampling
• Image
Resampling
depends
of
the
desired
applica,on
– Tracking:
Only
project
the
reference
Frame
on
the
current
image.
Object I n = H R −n FrameI 0
– Image
Stabiliza,on:
Resampling
the
current
Image
to
the
reference
frame
by
means
of
IStable (x, y) = H R−1−n In (x, y)
– Mosaic:
For
each
new
image,
project
it
to
the
−1
reference
frame
Mosaic
I (x, y) = H R −n I n (x, y)
• If
pixel
(x,y)
on
mosaic
don’t
have
data.
Put
the
projected
pixel
• If
pixe
(x,y)
already
have
informa,on,
make
a
data
interpola,on
Applica,ons:
Video
Stabiliza,on
Refrence
Euclidean Homography
Reference
Image
for
Mosaic
Applica,ons:
Mosaics
• Define
a
Reference
Image:
• For
each
image
– Calculate
the
Homography
between
Reference
Image
and
current
−1
image.
IMosaic (x, y) = H R −n In (x, y)
– Reproject
pixel
to
pixel
the
each
image
on
the
reference
space.
– If
pixel
(x,y)
on
mosaic
don’t
have
data.
Put
the
projected
pixel
– If
pixe
(x,y)
already
have
informa,on,
make
a
data
interpola,on
Reference
Image
for
Mosaic
Applica,ons:
Mosaics
Applica,ons:
SuperResolu,on
• SuperResolu,on:
Given
a
s e t
o f
o b s e r v e d
images,
es,mate
an
i m a g e
a t
a
h i g h e r-‐
r e s o l u , o n
t h a n
i s
present
in
any
of
the
individual
images
Applica,ons:
SuperResolu,on
References
• D.
Lowe,
“Dis,nc,ve
image
features
from
scale-‐invariant
keypoints,”
Interna,onal.
Journal
of
Computer
Vision,
vol.
2,
no.
60,
pp.
91–110,
2004.
• H.
Bay,
T.
Tuytelaars,
and
L.
Van
Gool,
“SURF:
Speeded
up
robust
features,”
• R.
Hartley
and
A.
Zisserma.
Mul,ple
View
Geometry.
Second
Edi,on
• Barbara
Zitová,
Jan
Flusser:
Image
registra,on
methods:
a
survey.
Image
Vision
Comput.
21(11):
977-‐1000
(2003)