Professional Documents
Culture Documents
Computer Vision: Spring 2006 15-385,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm - 4:20pm
Computer Vision: Spring 2006 15-385,-685 Instructor: S. Narasimhan Wean 5403 T-R 3:00pm - 4:20pm
Instructor: S. Narasimhan
Wean 5403
T-R 3:00pm – 4:20pm
Lecture #16
Announcements
Lecture #16
Optical Flow and Motion
• Lots of uses
– Track object behavior
– Correct for camera jitter (stabilization)
– Align images (mosaics)
– 3D shape reconstruction
– Special effects
Tracking – Rigid Objects
Query
Result
(Michal Irani, Weizmann)
Motion Field
• Image velocity of a point moving in the scene
v ot
X ro
f'
Z
ri dro
v it Y Scene point velocity: v o
dri dt
Image velocity: v i
dt
1 ro
Perspective projection: ri
f' ro Z
Motion field
vi
dri
f'
ro Z v o v o Z ro
f'
ro v o Z
dt ro Z 2
ro Z 2
Optical Flow
Motion field exists but no optical flow No motion field but shading changes
Problem Definition: Optical Flow
( x u t , y v t )
E ( x u t , y v t , t t ) E ( x, y, t )
– Assume small motion: (Taylor expansion of LHS upto first order)
E E E
E ( x, y, t ) x y t E ( x, y , t )
x y t
Optical Flow Constraint Equation
E E E
x y t 0
x y t
Divide by t and take the limit t 0
u
dx E dy E E
0
dt x dt y t
Constraint Equation
E x u E y v Et 0 v
time
j+1
k+1
j
k
x
i i+1
1
Ex [( Ei 1, j ,k Ei 1, j ,k 1 Ei 1, j 1,k Ei 1, j 1,k 1 )
4 x
( Ei , j ,k Ei , j ,k 1 Ei , j 1,k Ei , j 1,k 1 )]
Optical Flow Constraint
• Intuitively, what does this constraint mean?
x y t dx dy
2
ec ( E u E v E )
image
(u
2 2 2 2
es x u ) (v v ) dx dy
y x y
image
e es ec
weighting
factor
Discrete Optical Flow Algorithm
Consider image pixel (i, j)
• Departure from Smoothness Constraint:
1
sij [(ui 1, j ui , j ) 2 (ui , j 1 ui , j ) 2
4
(vi 1, j vi , j ) 2 (vi , j 1 vi , j ) 2 ]
•Error in Optical Flow constraint equation:
ij ij ij 2
cij ( E x uij E y vij E t )
• We seek the set {uij } & {vij } that minimize:
n 1 n
E xkl ukln E ykl vkln Etkl kl
v kl v
kl kl 2 kl 2
E y
1 [( E ) ( E ) ]
x y
Example
Optical Flow Result
Low Texture Region - Bad
f 1 ( x0 , y0 , z0 )
f 1 ( x0 , y0 , z0 )
( x' , y ' ) x0 ut y0 vt
( x' , y ' ) { , }
z0 wt z0 wt
• As t varies the image point moves along a straight line in the image
http://homepages.inf.ed.ac.uk/rbf/BOOKS/BANDB/LIB/bandb7_12.pdf
Revisiting the Small Motion Assumption
u=1.25 pixels
u=2.5 pixels
u=5 pixels
imageHH
image u=10 pixels image
image II
run iterative OF
upsample
run iterative OF
.
.
.
imageHJ
image image
image II