CS 664 Slides #7 Visual Motion: Prof. Dan Huttenlocher Fall 2003
CS 664 Slides #7 Visual Motion: Prof. Dan Huttenlocher Fall 2003
Visual Motion
Visual Motion
Over sequence of images can determine
which pixels move where
Differs from motion in the world
Camera motion
Pan, tilt, zoom
Motion parallax
Information about depth from camera motion
Scene motion
Reveals independent objects and behaviors
Un-detectable motion
No/low intensity variation
2
Camera stabilization
Remove jitter
Autonomous navigation
Path finding and depth from parallax
Panoramic mosaics
Synthesized views from video sequence
-1
-1
-1
-1
10
11
12
12
11
10
-1
-3
15
16
13
14
13
14
15
16
-2
-2
v
6
Linearization
Relate motion to image derivatives
Gradient constraint
Gradient Constraint
One-dimensional example linearization
Estimate displacement d using derivative
Two functions f(x) and g(x)=f(x-d)
Gradient Constraint
(or Optical Flow Constraint)
Same approach extends naturally to 2D
10
u
11
u
12
Translational Motion
Assume single displacement (u,v) for all
pixels within some region of image
Over-constrained system of linear
equations Ix(x,y)u+Iy(x,y)v=-It
Find least squares solution
In matrix form: minz Dz - t
where D =
Ix(x1,y1) Iy(x1,y1)
Ix(xn,yn) Iy(xn,yn)
I
IxIy
x
T
D D=
IxIy Iy2
DTt
IxIt
=
IyIt
a b
c d
A-1
= 1/(ad-bc)
d -b
-c a
Translational Motion
Can estimate small translation over local
patch around each pixel
Multiple Motions
Robust statistical techniques for finding
predominant motion in a region
Consider approach of iteratively
reweighted least squares (IRLS)
As illustration of robust methods
minz W(Dz t)
Weight matrix W is diagonal
Lessen importance of pixels that dont match
Iterate to find good weights
Note in unweighted case W is identity matrix
16
Updating Weights
To solve for zk given zk-1
Create weights Wk = diag(w1k wnk) where
wik =
1 if ri k-1 c
c/ri k-1 otherwise
Weights Example
8
zk-1
I
ri k-1: 0,0,1,0,1,1,6,5,6
11 10 10
J
median = 1
c 1.48
wi k: 1,1,1,1,1,1,.24,.29,.24
19
Affine Transformations
Consider points (x,y) in plane rather than
vectors for the moment
Linear transformation and translation
x = a1+a2x+a3y
y = a4 + a5x +a6y
In matrix form A(z)=Lz+b
x
y
a2 a3
a5 a6
x
y
a1
+ a
4
Ixn yn
Ix1
Ixn xn
D=
Ix1 y1
Ixn
24
res
Ik,Jk
res
I1,J1
Original
Pyramid of image I
I0,J0
Pyramid of image J
28
31
SSD
An alternative to gradient based methods
is template matching
Treat a rectangle around each pixel as a
template to find best match in other image
Search over possible translations minimizing
some error criterion (or maximizing quality)
Generally use sum squared difference (SSD)
(I(x,y)-J(x+u,y+v))2
Sometimes compute cross correlation
Compute over local neighborhood
32