Professional Documents
Culture Documents
Erhardt Barth
June 4, 2020
1 E. Barth
Motion fields
Motion
Local motion estimation
What is motion?
Defining motion:
Motion is a powerful feature of image sequences that relates
spatial image features to temporal changes.
Optical flow
The notion of optical flow was introduced by J.J. Gibson, the
founder of ecological psychology.
w(X, Y, Z) ∈ R3 :
3-D motion field: relative motion between observer (camera) and a
fixed point in 3D space
u(x, y) ∈ R2 :
2-D motion field: projection of the 3-D motion field on the image
plane (only the motion vectors of visible points are projected)
v(x, y) ∈ R2 :
2-D optical flow : an approximation of the 2-D motion field that is
estimated from image intensities
5 E. Barth
Motion fields
Motion
Local motion estimation
Note that from the expression (4) on the previous slide (obtained
by a Taylor expansion of A(0)) it follows that −A0 = A0T .
Furthermore, for any vector x, we have:
x2 ω3 − x3 ω2
A0 x = x3 ω1 − x1 ω3 = x × (ω1 , ω2 , ω3 )T , (5)
x1 ω2 − x2 ω1
i.e., we can replace matrix multiplication with vector product.
8 E. Barth
Motion fields
Motion
Local motion estimation
9 E. Barth
Motion fields
Motion
Local motion estimation
10 E. Barth
Motion fields
Motion
Local motion estimation
d d
↓ ↓
dt dt
3D motion → projection
2D motion
w(P) 1 w1 x u(p)
u=− ( + w3 )
Z w 2 y
11 E. Barth
Motion fields
Motion
Local motion estimation
13 E. Barth
Motion fields
Motion
Local motion estimation
pitch (Nicken)
yaw (Gieren)
roll (Rollen)
14 E. Barth
Motion fields
Motion
Local motion estimation
roll: R = (0,
0, 1), ω = 1, and
y
u(x, y) =
−x
15 E. Barth
Motion fields
Motion
Local motion estimation
16 E. Barth
Motion fields
Motion
Local motion estimation
17 E. Barth
Motion fields
Motion
Local motion estimation
The total equation for the 2-D motion field induced by egomotion
is (putting together Eqs. 8 and 9): u(x, y) =
1 + x2
v T1 x xy y
( +T3 )+ω(−R1 2 +R2 +R3 ).
Z T2 y 1+y xy −x
(11)
Rigid motion can be separated into translation and rotation.
The translational field depends on depth Z and can thus be
used to infer 3D structure.
The rotational field does not contain information about 3D
structure.
The focus-of-expansion (FOE) can be used to infer the
direction of heading.
18 E. Barth
Motion fields
Motion
Local motion estimation
19 E. Barth
Motion fields
Motion
Local motion estimation
A sphere without
structure will not
generate optical flow
when is rotates but a
moving light source
might.
20 E. Barth
Motion fields
Motion
Local motion estimation
Summarizing this and the previous slide, we note that the optical
flow cannot be estimated at both constant and straight image
features (which have intrinsic dimension 0 and 1 respectively).
21 E. Barth
Motion fields
Motion
Local motion estimation
∂I ∂I ∂I
I(x + dx, y + dy, t + dt) = I(x, y, t) + dx + dy + dt (14)
∂x ∂y ∂t
The above assumption implies that
∂I ∂I ∂I
and it follows from (14) that dx + dy + dt = 0, and, as
∂x ∂y ∂t
on previous slide, that
∇xy I T v + It = 0.
24 E. Barth
Motion fields
Motion
Local motion estimation
Tensor methods
26 E. Barth
Motion fields
Motion
Local motion estimation
29 E. Barth
Motion fields
Motion
Local motion estimation
30 E. Barth
Motion fields
Motion
Local motion estimation
The minors of J
The minors Mij of J are the determinants of the matrices obtained
from J by eliminating the row 4 − i and the column 4 − j, for
example, M11 = (h ∗ Ix2 )(h ∗ Iy2 ) − (h ∗ (Ix Iy ))2 .
Fact
If a matrix has a single zero eigenvalue, the corresponding
eigenvector can be evaluated in terms of the minors of that matrix.
Based on this fact, one can show [1] that if a pattern moves with
constant velocity v, i.e., I(x, y, t) = I 0 (x − tvx , y − tvy ), we have:
(M31 , −M21 ) (M32 , −M22 ) (M33 , −M23 )
v= = = . (23)
M11 M12 M13
Correlation-based methods
The motion vector is approximated by
s(x, y)
v= , (24)
t2 − t1
where s(x, y) is the displacement that yields the best match
between two image regions in two consecutive frames.
The best match can be determined in 2 ways:
by maximizing the cross-correlation function
h ∗ (I(x0 , t1 )I(x0 − s, t2 ))
c(x, s) = p ; x = (x, y) (25)
(h ∗ I(x0 , t1 )(h ∗ I(x0 − s, t2 ))
33 E. Barth
Motion fields
Motion
Local motion estimation
Block matching
In practice, correlation-based methods are most often implemented
by using block-matching techniques:
Subdivide every image into square blocks
Find one displacement vector for each block
Within a search range, find a best match that minimizes an
error measure such as SSD or SAD.
P
SSD = block (It2 (x, y) −
It1 (x + sx , y + sy ))2
P
SAD = block |It2 (x, y) −
It1 (x + sx , y + sy )|
34 E. Barth
Motion fields
Motion
Local motion estimation
35 E. Barth
Motion fields
Motion
Local motion estimation
error measure than previous best result (note that the initial
estimate is important)
36 E. Barth
Motion fields
Motion
Local motion estimation
Hierarchical block-matching
Strategy:
Start to match at coarse level and then search around the coarse
estimate at finer levels. This strategy reduces the search space and
can handle large displacements.
37 E. Barth
Motion fields
Motion
Local motion estimation
Complex motions
Notations
39 E. Barth
Motion fields
Motion
Local motion estimation
Some parts of the course are based on an earlier course by T. Aach and E. Barth.
The books [4] and [3] have a good coverage of motion and are recommended for further reading.
E Barth.
The minors of the structure tensor.
In G Sommer, editor, Mustererkennung 2000, pages 221–228, Berlin, 2000. Springer.
Richard Szeliski.
Computer Vision: Algorithms and Applications.
Springer, Boston, 2011.
40 E. Barth