Motion Estimation I - MIT...

80
Motion Estimation (II) Ce Liu [email protected] Microsoft Research New England

Transcript of Motion Estimation I - MIT...

Page 1: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Motion Estimation (II)

Ce Liu

[email protected]

Microsoft Research New England

Page 2: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Last time

• Motion perception

• Motion representation

• Parametric motion: Lucas-Kanade

• Dense optical flow: Horn-Schunck

• Robust estimation

• Applications (1)

d𝑢d𝑣

= −𝐈𝑥𝑇𝐈𝑥 𝐈𝑥

𝑇𝐈𝑦

𝐈𝑥𝑇𝐈𝑦 𝐈𝑦

𝑇𝐈𝑦

−1𝐈𝑥𝑇𝐈𝑡𝐈𝑦𝑇𝐈𝑡

𝐈𝑥2 + 𝛼𝐋 𝐈𝑥𝐈𝑦

𝐈𝑥𝐈𝑦 𝐈𝑦2 + 𝛼𝐋

𝑈𝑉

= −𝐈𝑥𝐼𝑡𝐈𝑦𝐼𝑡

𝚿𝑥𝑥′ + 𝛼𝐋 𝚿𝑥𝑦

𝚿𝑥𝑦′ 𝚿𝑦𝑦

′ + 𝛼𝐋𝑑𝑈𝑑𝑉

= −𝚿𝑥𝑡

′ + 𝛼𝐋𝑈𝐈𝑦𝐼𝑡 + 𝛼𝐋𝑉

Page 3: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Who are they?

Berthold K. P. Horn Takeo Kanade

Page 4: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Today

• Discrete optical flow

• Layer motion analysis

• Contour motion analysis

• Obtaining motion ground truth

Page 5: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Block matching

• Both Horn-Schunk and Lucas-Kanade are sub-pixel accuracy algorithms

• But in practice we may not need sub-pixel accuracy

• MPEG: 16 × 16 block matching using MMSE (insert a block matching example)

Page 6: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Tracking reliable features

• Idea: no need to work on ambiguous regions pixels (flat regions & line structures)

• Instead, we can track features and then propagate the tracking to ambiguous pixels

• Good features to track [Shi & Tomasi 94]

• Block matching + Lucas-Kanade refinement

d𝑢d𝑣

= −𝐈𝑥𝑇𝐈𝑥 𝐈𝑥

𝑇𝐈𝑦

𝐈𝑥𝑇𝐈𝑦 𝐈𝑦

𝑇𝐈𝑦

−1𝐈𝑥𝑇𝐈𝑡𝐈𝑦𝑇𝐈𝑡

Page 7: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Feature detection & tracking

Page 8: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

From sparse to dense

• Interpolation: given values *𝑑𝑖+ at 𝑥𝑖 , 𝑦𝑖 , reconstruct a smooth plane 𝑓(𝑥, 𝑦)

• Membrane model

𝑤𝑖 𝑓 𝑥𝑖 , 𝑦𝑖 − 𝑑𝑖2

𝑖

+ 𝛼 𝑓𝑥2 + 𝑓𝑦

2 𝑑𝑥𝑑𝑦

• Thin plate model

𝑤𝑖 𝑓 𝑥𝑖 , 𝑦𝑖 − 𝑑𝑖2

𝑖

+ 𝛼 𝑓𝑥𝑥2 + 𝑓𝑥𝑦

2 + 𝑓𝑦𝑦2 𝑑𝑥𝑑𝑦

Page 9: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Membrane vs. thin plate

Page 10: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Dense flow field from sparse tracking

Page 11: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Pros and Cons of Feature Matching

• Pros

– Efficient (a few feature points vs. all pixels)

– Reliable (with advanced feature descriptors)

• Cons

– Independent tracking (tracking can be unreliable)

– Not all information is used (may not capture weak features)

• How to improve

– Track every pixel with uncertainty

– Integrate spatial regularity (neighboring pixels go together)

Page 12: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Discrete Optical Flow

• The objective function is similar to continuous flow

𝐸 w = min( 𝐼1 x − 𝐼2 w x , 𝑡) +

x

𝜂 𝑢 x + 𝑣 x

x

min 𝛼 𝑢 x1 − 𝑢 x2 , 𝑑

(x1,x2)∈𝜀

+min 𝛼 𝑣 x1 − 𝑣 x2 , 𝑑

• x = (𝑥, 𝑦) is pixel coordinate, w = (𝑢, 𝑣) is flow vector

• Truncated L1 norms: – Account for outliers in the data term

– Encourage piecewise smoothness in the smoothness term

Data term

Small displacement

Spatial regularity

Page 13: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Decoupled smoothness

Smoothness O(L4)

Smoothness: O(L2)

Smoothness: O(L2)

Data term: O(L2) Data term: O(L2)

Coupled smoothness

Decoupled smoothness Smoothness: O(L)

Smoothness: O(L)

Page 14: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Dual-layer belief propagation

[Shekhovtsov et al. CVPR 07]

Horizontal flow u

Vertical flow v

u

v

w = (𝑢, 𝑣)

Data term

𝐼1 x − 𝐼2 x + w1

Smoothness term on u

min 𝛼 𝑢 x1 − 𝑢 x2 , 𝑑

Smoothness term on v

min 𝛼 𝑣 x1 − 𝑣 x2 , 𝑑

Regularization term on u 𝜂|𝑢 x |

Regularization term on v 𝜂|𝑣 x |

Page 15: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Dual-layer belief propagation

u

v

Update within u plane

𝑘 𝑗

Message 𝑀𝑗𝑘: given

all the information at node 𝑘, predict the distribution at node 𝑗

Page 16: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Dual-layer belief propagation

u

v

Update within v plane

Page 17: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Dual-layer belief propagation

u

v

Update from u plane to v plane

Page 18: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Dual-layer belief propagation

u

v

Update from v plane to u plane

Page 19: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Examples

Input two frames

Coarse-to-fine LK with median filtering

Flow visualization

Robust optical flow

Discrete optical flow

Page 20: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Content

• Discrete optical flow

• Layer motion analysis

• Contour motion analysis

• Obtaining motion ground truth

Page 21: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Layer representation

• Optical flow field is able to model complicated motion

• Different angle: a video sequence can be a composite of several moving layers

• Layers have been widely used

– Adobe Photoshop

– Adobe After Effect

• Compositing is straightforward, but inference is hard

Wang & Adelson, 1994

Page 22: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Wang & Adelson, 1994

• Strategy

– Obtaining dense optical flow field

– Divide a frame into non-overlapping regions and fit affine motion for each region

– Cluster affine motions by k-means clustering

– Region assignment by hypothesis testing

– Region splitter: disconnected regions are separated

Page 23: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Results

Flower garden

Optical flow field Clustering to affine regions Clustering with error metric

Three layers with affine motion superimposed

Reconstructed background layer

Page 24: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Weiss & Adelson, 1996

• Chicken & egg problem

– Good motion → good segmentation

– Good segmentation → good motion

• We don’t have either of them, so iterate!

• Perceptually organized expectation & maximization (POEM)

– E-step: estimate the motion parameter of each layer

– M-step: estimate the likelihood that a pixel belongs to each of the layers (segmentation)

Page 25: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Liu & Torralba et. al. 2005

• Reliable layer segmentation for motion magnification

• Layer segmentation pipeline

Feature point

tracking

Trajectory

clustering

Dense optical

flow interpolation

Layer

segmentation

Input video sequence Feature point tracking

Page 26: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Normalized complex correlation

• The similarity metric should be independent of phase and magnitude

• Normalized complex correlation

tt

t

tCtCtCtC

tCtCCCS

)()()()(

|)()(|),(

2211

2

21

21

Feature point

tracking

Trajectory

clustering

Dense optical

flow interpolation

Layer

segmentation

Page 27: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Spectral clustering

Feature point

tracking

Trajectory

clustering

Dense optical

flow interpolation

Layer

segmentation

Affinity matrix Clustering Reordering of affinity matrix

Two clusters Trajectory

Tra

jecto

ry

Page 28: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Clustering results

Feature point

tracking

Trajectory

clustering

Dense optical

flow interpolation

Layer

segmentation

Page 29: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

From sparse feature points to dense optical flow fields

Feature point

tracking

Trajectory

clustering

Dense optical

flow interpolation

Layer

segmentation

Flow vectors of

clustered sparse

feature points

Dense optical flow

field of cluster 1

(leaves)

Dense optical flow

field of cluster 2

(swing)

Cluster 1: leaves

Cluster 2: swing

• Interpolate dense optical flow field using locally weighted linear regression

Page 30: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Motion layer assignment

• Assign each pixel to a motion cluster layer, using four cues:

– Motion likelihood—consistency of pixel’s intensity if it moves with

the motion of a given layer (dense optical flow field)

– Color likelihood—consistency of the color in a layer

– Spatial connectivity—adjacent pixels favored to belong the same

group

– Temporal coherence—label assignment stays constant over time

• Energy minimization using graph cuts

Feature point

tracking

Trajectory

clustering

Dense optical

flow interpolation

Layer

segmentation

Page 31: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Segmentation results

Feature point

tracking

Trajectory

clustering

Dense optical

flow interpolation

Layer

segmentation

Page 32: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,
Page 33: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Generative models

• Learning flexible sprites [Frey & Jojic 2001, 2003]

Page 34: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Content

• Discrete optical flow

• Layer motion analysis

• Contour motion analysis

• Obtaining motion ground truth

Page 35: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Seemingly Simple Examples

Kanizsa square

From real video

Page 36: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Output from the State-of-the-Art Optical Flow Algorithm

T. Brox et al. High accuracy optical flow estimation based on a theory for warping. ECCV 2004

Optical flow field Kanizsa square

Page 37: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Output from the State-of-the-Art Optical Flow Algorithm

T. Brox et al. High accuracy optical flow estimation based on a theory for warping. ECCV 2004

Optical flow field

Dancer

Page 38: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Optical flow representation: aperture problem

Corners Lines Flat regions

Spurious junctions Boundary ownership Illusory boundaries

Page 39: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Optical Flow Representation

Corners Lines Flat regions

Spurious junctions Boundary ownership Illusory boundaries

We need motion representation beyond pixel level!

Page 40: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Challenge: Textureless Objects under Occlusion

• Corners are not always trustworthy (junctions)

• Flat regions do not always move smoothly (discontinuous at illusory boundaries)

• How about boundaries?

– Easy to detect and track for textureless objects

– Able to handle junctions with illusory boundaries

Page 41: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Analysis of Contour Motions

• Our approach: simultaneous grouping and motion analysis

– Multi-level contour representation

– Junctions are appropriated handled

– Formulate graphical model that favors good contour and motion criteria

– Inference using importance sampling

• Contribution

– An important component in motion analysis toolbox for textureless objects under occlusion

C. Liu, W. T. Freeman and E. H. Adelson. NIPS 2006

Page 42: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Three Levels of Contour Representation

– Edgelets: edge particles

– Boundary fragments: a chain of edgelets with small curvatures

– Contours: a chain of boundary fragments

Forming boundary fragments: easy (for textureless objects)

Forming contours: hard (the focus of our work)

Page 43: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Overview of our system

1. Extract boundary fragments 2. Edgelet tracking with uncertainty.

3. Boundary grouping and illusory boundary 4. Motion estimation based on the grouping

Page 44: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Local Spatial-Temporal Cues for Grouping

Motion stimulus Illusory boundaries corresponding to the groupings (generated by spline interpolation)

Page 45: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Local spatial-temporal cues for grouping: (a) Motion similarity

Motion stimulus

xv

yv

Velocity space

KL( ) < KL( )

The grouping with higher motion similarity is favored

Page 46: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Local spatial-temporal cues for grouping: (b) Curve smoothness

Motion stimulus

The grouping with smoother and shorter illusory boundary is favored

Page 47: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Local spatial-temporal cues for grouping: (c) Contrast consistency

Motion stimulus

The grouping with consistent local contrast is favored

Page 48: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

The Graphical Model for Grouping

• Affinity metric 𝜆(𝑆 𝑖, 𝑡𝑖 ; 𝐁, 𝑂) terms

– (a) Motion similarity

exp −𝛼𝐾𝐿𝐾𝐿 𝑁 𝜇11, Σ11 , 𝑁 𝜇21, Σ21

– (b) Curve smoothness

exp −𝛼𝑟 𝑑𝜃

𝑑𝑠

2

𝑟𝑑𝑠

– (c) Contrast consistency

exp −𝑑𝑚𝑎𝑥

2𝜎𝑚𝑎𝑥2 −

𝑑𝑚𝑖𝑛

2𝜎𝑚𝑖𝑛2

• The graphical model for grouping

1b

2b

),( 1111

),( 2121

1b

r

2b

reversibility affinity

11h

12h

21h

22h

1b

2b

no self-intersection

Pr 𝐒; 𝐁, 𝑂 =1

𝑍𝑆 𝜆(𝑆 𝑖, 𝑡𝑖 ;

1

𝑡𝑖=0

𝑁

𝑖=1

𝐁,𝑂)𝛿 𝑆 𝑆 𝑖, 𝑡𝑖 − 𝑖, 𝑡𝑖 ⋅ 𝜓(𝐜𝑗; 𝐁, 𝑂)

𝑀

𝑗=1

Page 49: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Motion estimation for grouped contours

• Gaussian MRF (GMRF) within a boundary fragment

𝜑 𝑣𝑖; 𝑏𝑖 = exp − 𝑣𝑖𝑘 − 𝜇𝑖𝑘𝑇 𝑣𝑖𝑘 − 𝜇𝑖𝑘

−1

𝑖𝑘

exp −1

2𝜎2𝑣𝑖𝑘 − 𝑣𝑖,𝑘+1

2𝑛𝑖−1

𝑘=1

𝑛𝑖

𝑘=1

• The motions of two end edgelets are similar if they are grouped together

𝜙 𝐕 𝑖, 𝑡𝑖 , 𝐕 𝑆 𝑖, 𝑡𝑖 = 1 if 𝑆 𝑖, 𝑡𝑖 = 𝑖, 𝑡𝑖

exp −1

2𝜎2𝐕 𝑖, 𝑡𝑖 − 𝐕 𝑆 𝑖, 𝑡𝑖

2otherwise

• The graphical model of motion: joint Gaussian given the grouping

Pr 𝐕 𝐒; 𝐁 =1

𝑍𝑉 𝜑 𝐯𝑖; 𝐛𝑖 𝜙(𝐕 𝑖, 𝑡𝑖 , 𝐕 𝑆 𝑖, 𝑡𝑖 )

1

𝑡𝑖

𝑁

𝑖

This problem is solved in early work: Y. Weiss, Interpreting images by propagating Bayesian beliefs, NIPS, 1997.

Page 50: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Inference

• Two-step inference – Grouping (switch variables)

– Motion based on grouping (easy, least square)

• Grouping: importance sampling to estimate the marginal of the switch variables – Bidirectional proposal density

𝑞 𝑆 𝑖, 𝑡𝑖 = 𝑗, 𝑡𝑗 ∝1

𝑍𝑞𝜆 𝑆 𝑖, 𝑡𝑖 = 𝑗, 𝑡𝑗 𝜆 𝑆 𝑗, 𝑡𝑗 = 𝑖, 𝑡𝑖

– Toss the sample if self-intersection is detected

• Obtain the optimal grouping from the marginal

Page 51: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Kanizsa Square

Page 52: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Frame 1

Page 53: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Frame 2

Page 54: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Extracted boundary fragments

Page 55: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Optical flow from Lucas-Kanade algorithm

Page 56: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Estimated motion by our system, after grouping

Page 57: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Boundary grouping and illusory boundaries (frame 1)

Page 58: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Boundary grouping and illusory boundaries (frame 2)

Page 59: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Rotating Chair

Page 60: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Frame 1

Page 61: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Frame 2

Page 62: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Extracted boundary fragments

Page 63: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Estimated flow field from Brox et al.

Page 64: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Estimated motion by our system, after grouping

Page 65: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Boundary grouping and illusory boundaries (frame 1)

Page 66: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Boundary grouping and illusory boundaries (frame 2)

Page 67: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Content

• Discrete optical flow

• Layer motion analysis

• Contour motion analysis

• Obtaining motion ground truth

Page 68: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

How to evaluate optical flow?

• Assume the ground truth motion is known

• Average Angular Error (AAE)

– Let 𝑤 = (𝑢, 𝑣, 1)

– Angular error: arccos(𝑤𝑇𝑤0

𝑤 𝑤0)

• Error in flow endpoint (EP)

– EP: 𝑢 − 𝑢02 + 𝑣 − 𝑣0

2

• Other metrics

Page 69: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Is optical flow solved

• The AAE (average angular error) race on the Yosemite sequence for over 15 years

#I. Austvoll. Lecture Notes in Computer Science, 2005 *Brox et al. ECCV, 2004.

Yosemite sequence State-of-the-art optical flow* Improvement#

Page 70: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

But when optical flow is applied to real-life videos…

Optical flow is far from being solved: – Often fails to capture occluding boundaries correctly

– Puzzles on the right choice of smoothness

Flow visualization

color map A sample sequence State-of-the-art optical flow

Page 71: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Middlebury flow database

Baker et. al. A Database and Evaluation Methodology for Optical Flow. ICCV 2007

Page 72: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Middlebury flow database

Page 73: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Measuring motion for real-life videos

• Challenging because of occlusion, shadow, reflection, motion blur, sensor noise and compression artifacts

• Accurately measuring motion also has great impact in scientific measurement and graphics applications

• Humans are experts in perceiving motion. Can we use human expertise to annotate motion?

[Video courtesy: Antonio Torralba]

Page 74: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Human-assisted motion annotation

• Our approach: an interactive system to combine human perception and the state-of-the-art computer vision algorithms to annotate motion

• User layers as the interface for user interaction – Decompose a video sequence into layers

– Motion analysis for each layer

Page 75: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Demo: interactive layer segmentation

Page 76: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Demo: interactive motion labeling

Page 77: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Motion database of natural scenes

Color map

Bruhn et al. Lucas/Kanade meets Horn/Schunck: combining local and global optical flow methods. IJCV, 2005

Page 78: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Optical flow is far from being solved

AAE=8.99°

AAE=5.24°

AAE=1.94°

Frame Ground-truth motion Optical flow

Page 79: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

LabelMe Video

J. Yuen, B. Russell, C. Liu and A. Torralba. ICCV, 2009

Page 80: Motion Estimation I - MIT CSAILpeople.csail.mit.edu/torralba/courses/6.869/lectures/lecture20/lectur… · Motion layer assignment • Assign each pixel to a motion cluster layer,

Summary

• Discrete optical flow matching

– Tracking & motion interpolation

– Belief propagation

• Other representations

– Layer motion analysis

– Contour motion analysis

• Obtaining motion ground truth

– Human assisted motion annotation

u

v