Optical flow Cordelia Schmid Motion field The motion field is the - - PowerPoint PPT Presentation

optical flow
SMART_READER_LITE
LIVE PREVIEW

Optical flow Cordelia Schmid Motion field The motion field is the - - PowerPoint PPT Presentation

Optical flow Cordelia Schmid Motion field The motion field is the projection of the 3D scene motion into the image Optical flow Definition: optical flow is the apparent motion of brightness patterns in the image Ideally, optical


slide-1
SLIDE 1

Optical flow

Cordelia Schmid

slide-2
SLIDE 2

Motion field

  • The motion field is the projection of the 3D scene motion

into the image

slide-3
SLIDE 3

Optical flow

  • Definition: optical flow is the apparent motion of

brightness patterns in the image

  • Ideally, optical flow would be the same as the motion

field

  • Have to be careful: apparent motion can be caused by

lighting changes without any actual motion

– Think of a uniform rotating sphere under fixed lighting

  • vs. a stationary sphere under moving illumination
slide-4
SLIDE 4

Estimating optical flow

  • Given two subsequent frames, estimate the apparent motion

field u(x,y) and v(x,y) between them

  • Key assumptions
  • Brightness constancy: projection of the same point looks the

same in every frame

  • Small motion: points do not move very far
  • Spatial coherence: points move like their neighbors

I(x,y,t–1) I(x,y,t)

slide-5
SLIDE 5

Brightness Constancy Equation:

) , ( ) 1 , , (

), , ( ) , ( t y x y x

v y u x I t y x I     ) , ( ) , ( ) , , ( ) 1 , , ( y x v I y x u I t y x I t y x I

y x

   

Linearizing the right side using Taylor expansion:

The brightness constancy constraint

I(x,y,t–1) I(x,y,t)

  

t y x

I v I u I

Hence,

slide-6
SLIDE 6

The brightness constancy constraint

  • How many equations and unknowns per pixel?

– One equation, two unknowns

  • What does this constraint mean?
  • The component of the flow perpendicular to the gradient

(i.e., parallel to the edge) is unknown

  

t y x

I v I u I

) ' , ' (    v u I

edge (u,v) (u’,v’) gradient (u+u’,v+v’)

If (u, v) satisfies the equation, so does (u+u’, v+v’) if

) , (    

t

I v u I

slide-7
SLIDE 7

The aperture problem

Perceived motion

slide-8
SLIDE 8

The aperture problem

Actual motion

slide-9
SLIDE 9

Solving the aperture problem

  • How to get more equations for a pixel?
  • Spatial coherence constraint: pretend the pixel’s

neighbors have the same (u,v)

– E.g., if we use a 5x5 window, that gives us 25 equations per pixel

  • B. Lucas and T. Kanade. An iterative image registration technique with an application to

stereo vision. In International Joint Conference on Artificial Intelligence,1981.

                                  ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (

2 1 2 2 1 1 n t t t n y n x y x y x

I I I v u I I I I I I x x x x x x x x x   

slide-10
SLIDE 10

Lucas-Kanade flow

  • Linear least squares problem

The summations are over all pixels in the window

Solution given by

                                  ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (

2 1 2 2 1 1 n t t t n y n x y x y x

I I I v u I I I I I I x x x x x x x x x   

1 1 2 2   

n n

b d A

b A A)d A

T T

 (

                       

     

t y t x y y y x y x x x

I I I I v u I I I I I I I I

slide-11
SLIDE 11

Lucas-Kanade flow

  • Recall the Harris corner detector: M = ATA is

the second moment matrix

  • When is the system solvable?
  • By looking at the eigenvalues of the second moment matrix
  • The eigenvectors and eigenvalues of M relate to edge

direction and magnitude

  • The eigenvector associated with the larger eigenvalue points

in the direction of fastest intensity change, and the other eigenvector is orthogonal to it

                       

     

t y t x y y y x y x x x

I I I I v u I I I I I I I I

slide-12
SLIDE 12

Uniform region

– gradients have small magnitude

– small 1, small 2 – system is ill-conditioned

slide-13
SLIDE 13

Edge

– gradients have one dominant direction – large 1, small 2 – system is ill-conditioned

slide-14
SLIDE 14

High-texture or corner region

– gradients have different directions, large magnitudes

– large 1, large 2 – system is well-conditioned

slide-15
SLIDE 15

Optical Flow Results

slide-16
SLIDE 16

Multi-resolution registration

slide-17
SLIDE 17

Coarse to fine optical flow estimation

slide-18
SLIDE 18

Optical Flow Results

slide-19
SLIDE 19

Horn & Schunck algorithm

Additional smoothness constraint :

  • nearby point have similar optical flow
  • Addition constraint

, )) ( ) ((

2 2 2 2

dxdy v v u u e

y x y x s

    

B.K.P. Horn and B.G. Schunck, "Determining optical flow." Artificial Intelligence,1981

slide-20
SLIDE 20

Horn & Schunck algorithm

Additional smoothness constraint :

, )) ( ) ((

2 2 2 2

dxdy v v u u e

y x y x s

    

besides OF constraint equation term

, ) (

2dxdy

I v I u I e

t y x c

   

minimize es+ec λ regularization parameter

B.K.P. Horn and B.G. Schunck, "Determining optical flow." Artificial Intelligence,1981

slide-21
SLIDE 21

Horn & Schunck algorithm

Coupled PDEs solved using iterative methods and finite differences

slide-22
SLIDE 22

Horn & Schunck

  • Works well for small displacements

– For example Middlebury sequence

slide-23
SLIDE 23

Large displacement estimation in optical flow

Large displacement is still an open problem in optical flow estimation MPI Sintel dataset

slide-24
SLIDE 24

Large displacement optical flow

Classical optical flow [Horn and Schunck 1981]

energy:

minimization using a coarse-to-fine scheme

Large displacement approaches:

LDOF [Brox and Malik 2011] a matching term, penalizing the difference between flow and HOG matches

MDP-Flow2 [Xu et al. 2012]

expensive fusion of matches (SIFT + PatchMatch) and estimated flow at each level

DeepFlow [Weinzaepfel et al. 2013] deep matching + flow refinement with variational approach

color/gradient constancy smoothness constraint

slide-25
SLIDE 25

CNN to estimate optical flow: FlowNet

[A. Dosovitskiy et al. ICCV’15]

slide-26
SLIDE 26

Architecture FlowNetSimple

slide-27
SLIDE 27

Architecture FlowNetCorrelation

slide-28
SLIDE 28

Synthetic dataset for training: Flying chairs

A dataset of approx. 23k image pairs

slide-29
SLIDE 29

Experimental results

S: simple, C: correlation, v: variational refinement, ft:fine-tuning

slide-30
SLIDE 30

Experimental results

slide-31
SLIDE 31

FlowNet2.0 [Ilg et al. CVPR’17]

slide-32
SLIDE 32

FlyingThings3D [Mayer et al., CVPR’16]

slide-33
SLIDE 33

Comparison training data

Best: pretraining on a simpler dataset, then fine tuning on a more complex set FlowNetC better than FlowNetS

slide-34
SLIDE 34

Stacking of networks

Importance of warping

slide-35
SLIDE 35

Comparison to the state of the art

slide-36
SLIDE 36

Optical flow results on Sintel

slide-37
SLIDE 37

Video object segmentation

  • Segment the moving object in all the frames of a video

DAVIS (ground-truth)

[Tokmakov et al., CVPR 2017]

slide-38
SLIDE 38
  • Strong camera or background motion

Challenges

DAVIS LDOF flow

slide-39
SLIDE 39

Network architecture – MP-Net

Convolutional/deconvolutional network, similar to U-Net

slide-40
SLIDE 40
  • FlyingThings3D dataset [Mayer et al., CVPR’16]
  • 2700 synthetic, 10-frame stereo videos of random object

flying in random trajectories (2250/450 training/test split)

  • Ground-truth optical flow and camera data available
  • Labels for moving object can be obtained from the data

Training data

slide-41
SLIDE 41

Results on FlyingThings3D test set

slide-42
SLIDE 42
  • Flow estimation inaccuracies
  • Background motion

Motion estimation in real videos

DAVIS LDOF MP-Net DAVIS LDOF MP-Net

slide-43
SLIDE 43
  • Extract 100 object proposals per frame with SharpMask

[Pinheiro et al., ECCV’16]

  • Aggregate to obtain pixel-level objectness scores oi
  • Combine with the motion predictions mi

Addition of an objectness measure

DAVIS Objectness LDOF MP-Net Result

slide-44
SLIDE 44

FlowNet 2.0 Evaluation

Setting LDOF flow FLowNet 2.0 flow MP-Net 52.4 62.6 MP-Net + Obj 63.3 69.0 MP-Net + Obj + CRF 69.7 72.5 Mean IoU on DAVIS trainval set