Title: Optic Flow and Motion Detection
1Optic Flow and Motion Detection
- Cmput 498/613
- Martin Jagersand
- Readings Papers and chapters on 613 web page
2Image motion
- Somehow quantify the frame-to-frame differences
in image sequences. - Image intensity difference.
- Optic flow
- 3-6 dim image motion computation
3Motion is used to
- Attention Detect and direct using eye and head
motions - Control Locomotion, manipulation, tools
- Vision Segment, depth, trajectory
4Small camera re-orientation
Note Almost all pixels change!
5MOVING CAMERAS ARE LIKE STEREO
The change in spatial location between the two
cameras (the motion)
Locations of points on the object (the
structure)
6Classes of motion
- Still camera, single moving object
- Still camera, several moving objects
- Moving camera, still background
- Moving camera, moving objects
7The optic flow field
- Vector field over the image
- u,v f(x,y), u,v Vel vector, x,y
Im pos - FOE, FOC Focus of Expansion, Contraction
8Optic/image flow
- Assumption Image intensities from object points
remain constant over time.
9Taylor expansion of intensity variation
- Keep linear terms
- Use constancy assumption and rewrite
- Notice Linear constraint, but no unique solution
10Aperture problem
f
n
f
- Rewrite as dot product
- Each pixel gives one equation in two unknowns
- f . n k
- Notice Can only detect vectors normal to
gradient direction - The motion of a line cannot be recovered using
only local information
ò
ó
ò
ó
ð
ñ
î
x
î
x
_at_
I
m
_at_
I
m
_at_
I
m
Ã
ît
á
r
á
I
m
_at_
t
_at_
x
_at_
y
î
y
î
y
11Aperture problem 2
12The flow continuity constraint
- Flows of nearby patches are nearly equal
- Two equations, two unknowns
- f . n1 k1
- f . n2 k2
- Unique solution exists, provided n1 and n2 not
parallel
13Sensitivity to error
- n1 and n2 might be almost parallel
- Tiny errors in estimates of ks or ns can lead
to huge errors in the estimate of f
14Sometimes the continuity constraint is false
15Using several points
- Typically solve for motion in 2x2, 4x4 or larger
patches. - Over determined equation system
- dI Mu
- Can be solved in e.g. least squares sense using
matlab u M\dI
163-6D Optic flow
- Generalize to many freedooms (DOFs)
17All 6 freedoms
X Y Rotation Scale
Aspect Shear
18Flow vectors
- Norberts trick Use an mpeg-card to speed up
motion computation
19Application mpeg compression
20Other applications
- Recursive depth recovery Kostas Danilidis and
Jane Mulligan - Motion control (we will cover)
- Segmentation
- Tracking
21Lab
- Purpose
- Hands on optic flow experience
- Simple translation tracking
- Posted on www page.
- Prepare through readings (on-line papers.
- Lab tutorial How to capture.
- Questions Email or course newsgroup
- Due 1 week.
22Organizing different kinds of motion
- Two ideas
- Encode different motion structure in the
M-matrix. Examples in 4,6,8 DOF image plane
tracking. 3D a bit harder. - Attempt to find a low dimensional subspace for
the set of motion vectors. Can use e.g. PCA
23RememberThe optic flow field
- Vector field over the image
- u,v f(x,y), u,v Vel vector, x,y
Im pos - FOE, FOC Focus of Expansion, Contraction
24Remember last lecture
- Solving for the motion of a patch
- Over determined equation system
- Imt Mu
- Can be solved in e.g. least squares sense using
matlab u M\Imt
t
t1
253-6D Optic flow
- Generalize to many freedooms (DOFs)
Im Mu
26Know what type of motion(Greg Hager, Peter
Belhumeur)
ui A ui d
E.g. Planar Object gt Affine motion model
It g(pt, I0)
27Mathematical Formulation
- Define a warped image g
- f(p,x) x (warping function), p warp parameters
- I(x,t) (image a location x at time t)
- g(p,It) (I(f(p,x1),t), I(f(p,x2),t),
I(f(p,xN),t)) - Define the Jacobian of warping function
- M(p,t)
- Model
- I0 g(pt, It ) (image I, variation
model g, parameters p) - DI M(pt, It) Dp (local linearization M)
- Compute motion parameters
- Dp (MT M)-1 MT DI where M M(pt,It)
28Planar 3D motion
- From geometry we know that the correct
plane-to-plane transform is - for a perspective camera the projective
homography - for a linear camera (orthographic, weak-, para-
perspective) the affine warp
29Planar Texture Variability 1Affine Variability
- Affine warp function
- Corresponding image variability
- Discretized for images
30On The Structure of M
Planar Object linear (infinite) camera -gt
Affine motion model
ui A ui d
X Y Rotation Scale
Aspect Shear
31Planar Texture Variability 2Projective
Variability
- Homography warp
- Projective variability
- Where ,
- and
32Planar motion under perspective projection
- Perspective plane-plane transforms defined by
homographies
33Planar-perspective motion 3
- In practice hard to compute 8 parameter model
stably from one image, and impossible to find
out-of plane variation - Estimate variability basis from several images
- Computed Estimated
34Another idea Black, Fleet) Organizing flow fields
- Express flow field f in subspace basis m
- Different mixing coefficients a correspond to
different motions
35ExampleImage discontinuities
36Mathematical formulation
- Let
- Mimimize objective function
-
- Where
Robust error norm
Motion basis
37ExperimentMoving camera
- 4x4 pixel patches
- Tree in foreground separates well
38ExperimentCharacterizing lip motion
39Summary
- Three types of visual motion extraction
- Optic (image) flow Find x,y image velocities
- 3-6D motion Find object pose change in image
coordinates based more spatial derivatives (top
down) - Group flow vectors into global motion patterns
(bottom up) - Visual motion still not satisfactorily solved
problem
40Sensing and Perceiving Motionin Humans and
Animals
41How come perceived as motion?
Im sin(t)U5cos(t)U6
Im f1(t)U1f6(t)U6
42Counterphase sin grating
- Spatio-temporal pattern
- Time t, Spatial x,y
43Counterphase sin grating
- Spatio-temporal pattern
- Time t, Spatial x,y
- Rewrite as dot product
-
Result Standing wave is superposition of two
moving waves
44Analysis
- Only one term Motion left or right
- Mixture of both Standing wave
- Direction can flip between left and right
45Reichardt detector
46Severalmotion models
- Gradient in Computer Vision
- Correlation In bio vision
- Spatiotemporal filters Unifying model
47Spatial responseGabor function
48Temporal response
- Adelson, Bergen 85
- Note Terms from
- taylor of sin(t)
- Spatio-temporal DDsDt
49Receptor response toCounterphase grating
50Simplified
- For our grating (Theta0)
- Write as sum of components
- exp()(acos bsin)
51Space-time receptive field
52Combined cells
53Result
- More directionally specific response
54Energy model
- Sum odd and even phase components
- Quadrature rectifier
55AdaptionMotion aftereffect
56Where is motion processed?
57Higher effects
58EquivalenceReich and Spat
59Conclusion
- Evolutionary motion detection is important
- Early processing modeled by Reichardt detector or
spatio-temporal filters. - Higher processing poorly understood