motion detail preserving optical flow estimation

82
Tzu ming Su Advisor S.J.Wang MOTION DETAIL PRESERVING OPTICAL FLOW ESTIMATION 2013/1/28 L. Xu, J. Jia, and Y. Matsushita. Motion detail preserving optical ow estimation. In CVPR, 2010. 1

Upload: arvid

Post on 23-Feb-2016

65 views

Category:

Documents


0 download

DESCRIPTION

Motion Detail Preserving Optical Flow Estimation. Tzu ming Su Advisor : S.J.Wang. L. Xu , J. Jia , and Y. Matsushita. Motion detail preserving optical flow estimation. In CVPR, 2010. Outline. Previous Work Optical flow Conventional optical flow estimation. CCD. 3D motion vector. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Motion Detail Preserving  Optical  Flow Estimation

1

Tzu ming Su

Advisor : S.J.Wang

MOTION DETAIL PRESERVING OPTICAL FLOW ESTIMATION

2013/1/28

L. Xu, J. Jia, and Y. Matsushita. Motion detail preserving

optical flow estimation. In CVPR, 2010.

Page 2: Motion Detail Preserving  Optical  Flow Estimation

2

OUTLINE

2013/1/28

• Previous Work

• Optical flow

• Conventional optical flow estimation

Page 3: Motion Detail Preserving  Optical  Flow Estimation

3

MOTION FIELD

2013/1/28

• Definition : an ideal representation of 3D motion as it is projected onto a camera image.

3D motion vector

2D optical flow vector

CCD

Page 4: Motion Detail Preserving  Optical  Flow Estimation

4

MOTION FIELD

2013/1/28

• Applications :• Video enhancement : stabilization, denoising, super resolution

• 3D reconstruction : structure from motion (SFM)

• Video segmentation

• Tracking/recognition

• Advanced video editing (label propagation)

Page 5: Motion Detail Preserving  Optical  Flow Estimation

5

MOTION FIELD ESTIMATION

2013/1/28

• Optical flowRecover image motion at each pixel from spatio-temporal

image brightness variations

• Feature-trackingExtract visual features (corners, textured areas) and “track”

them over multiple frames

Page 6: Motion Detail Preserving  Optical  Flow Estimation

6

OPTICAL FLOW

2013/1/28

• Definition : the apparent motion of brightness patterns in the images

• Map flow vector to color

• Magnitude: saturation

• Orientation: hue

Page 7: Motion Detail Preserving  Optical  Flow Estimation

7

OPTICAL FLOW

2013/1/28

• Key assumptions

• Brightness constancy

• Small motion

• Spatial coherence

Remark : Brightness constancy is often violatedÞ Use gradient constancy for addition , both of them are called data constraint

Page 8: Motion Detail Preserving  Optical  Flow Estimation

8

BRIGHTNESS CONSISTENCY

2013/1/28

• 1-D case

Ix v It

Page 9: Motion Detail Preserving  Optical  Flow Estimation

9

BRIGHTNESS CONSISTENCY

x

)1,( txII ( x , t )

p?v

• 1-D case

2013/1/28

Page 10: Motion Detail Preserving  Optical  Flow Estimation

10

BRIGHTNESS CONSISTENCY

x

)1,( txII ( x , t )

p

xI

Spatial derivative

Temporal derivative v

• 1-D case

2013/1/28

Page 11: Motion Detail Preserving  Optical  Flow Estimation

11

BRIGHTNESS CONSISTENCY• 1-D case

• 2-D case

One equation, two velocity (u,v) unknowns…

u v

2013/1/28

Page 12: Motion Detail Preserving  Optical  Flow Estimation

12

APERTURE PROBLEM

2013/1/28

Page 13: Motion Detail Preserving  Optical  Flow Estimation

13

APERTURE PROBLEM

2013/1/28

Page 14: Motion Detail Preserving  Optical  Flow Estimation

14

APERTURE PROBLEM

2013/1/28

Time t

?Time t+dt

• We know the movement parallel to the direction of gradient , but not the movement orthogonal to the gradient

• We need additional constraints

Page 15: Motion Detail Preserving  Optical  Flow Estimation

15

CONVENTIONAL ESTIMATION

2013/1/28

• Use data consistency & additional constraint to estimate optical flow

• Horn-Schunck

• Minimize energy function with smoothness term

• Lucas-Kanade

• Minimize least square error function with local region coherence

Page 16: Motion Detail Preserving  Optical  Flow Estimation

16

HORN-SCHUNCK ESTIMATION

2013/1/28

• Imposing spatial smoothness to the flow field

• Adjacent pixels should move together as much as possible

• Horn & Schunck equation

Page 17: Motion Detail Preserving  Optical  Flow Estimation

17

HORN-SCHUNCK ESTIMATION

2013/1/28

• Use 2D Euler Lagrange

• Can be iteratively solved

Page 18: Motion Detail Preserving  Optical  Flow Estimation

18

COARSE TO FINE ESTIMATION

2013/1/28

• Optical flow is assumed to be small motions , but in fact most motions are not

• Solved by coarse to fine resolution

Page 19: Motion Detail Preserving  Optical  Flow Estimation

19

image Iimage It-1

COARSE TO FINE ESTIMATION

run iteratively

run iteratively...

2013/1/28

Page 20: Motion Detail Preserving  Optical  Flow Estimation

20

OUTLINE

2013/1/28

• Previous Work

• Contributions

• Extended Flow Initialization

• Selective data term

• Efficient optimization solver

• Experimental result

• Conclusion

Page 21: Motion Detail Preserving  Optical  Flow Estimation

21

OUTLINE

2013/1/28

• Previous Work

• Contributions

• Extended Flow Initialization

• Selective data term

• Efficient optimization solver

• Experimental result

• Conclusion

Page 22: Motion Detail Preserving  Optical  Flow Estimation

22

MUTI-SCALE PROBLEM

2013/1/28

• Conventional coarse to fine estimation can’t deal with large displacement.

• With different motion scales between foreground & background , even small motions can be miss detected.

Page 23: Motion Detail Preserving  Optical  Flow Estimation

23

MUTI-SCALE PROBLEM

2013/1/28

Page 24: Motion Detail Preserving  Optical  Flow Estimation

24

Ground truth

… Estimate EstimateEstimate

Ground truthGround truth

2013/1/28

Page 25: Motion Detail Preserving  Optical  Flow Estimation

25

MUTI-SCALE PROBLEM

2013/1/28

• Large discrepancy between initial values and optimal motion vectors

• Solution : Improve flow initialization to reduce the reliance on the initialization from coarser levels

Page 26: Motion Detail Preserving  Optical  Flow Estimation

262013/1/28

Sparse feature matching

Fusion

Dense nearest-neighbor patch matching

Selection

Page 27: Motion Detail Preserving  Optical  Flow Estimation

EXTENDED FLOW INITIALIZATION• Sparse feature matching for each level

Page 28: Motion Detail Preserving  Optical  Flow Estimation

28

EXTENDED FLOW INITIALIZATION• Identify missing motion vectors

2013/1/28

Page 29: Motion Detail Preserving  Optical  Flow Estimation

29

EXTENDED FLOW INITIALIZATION• Identify missing motion vectors

2013/1/28

Page 30: Motion Detail Preserving  Optical  Flow Estimation

30

EXTENDED FLOW INITIALIZATION

2013/1/28

Page 31: Motion Detail Preserving  Optical  Flow Estimation

31

EXTENDED FLOW INITIALIZATION

Fuse

2013/1/28

Page 32: Motion Detail Preserving  Optical  Flow Estimation

322013/1/28

Sparse feature matching

Fusion

Dense nearest-neighbor patch matching

Selection

Page 33: Motion Detail Preserving  Optical  Flow Estimation

33

OUTLINE

2013/1/28

• Previous Work

• Contributions

• Extended Flow Initialization

• Selective data term

• Efficient optimization solver

• Experimental result

• Conclusion

Page 34: Motion Detail Preserving  Optical  Flow Estimation

34

CONSTRAINTS

2013/1/28

• Brightness consistency

• Gradient consistency

• Average

I 2 1(u, x) (x u) (x)I ID

I 2 1(u, x) (x u) (I I x)D

Ix

I1 1(u, x) (u, x) (u, x)2 2DE D D

Page 35: Motion Detail Preserving  Optical  Flow Estimation

35

• Pixels moving out of shadow

CONSTRAINTS

pI 1 1p(u , ) 6.63D

• Color constancy is violated

I Ip1 1 p1 11 (u , ) (u , ) = 3.482

p pD D

• Average:

p1u : ground truth motion of p1

• Gradient constancy holdsp 1I 1 p(u , ) 0.32D

2013/1/28

Page 36: Motion Detail Preserving  Optical  Flow Estimation

36

• Pixels undergoing rotational motion

CONSTRAINTS

• Color constancy holds

• Gradient constancy is violatedp2u : ground truth motion of p2

p 2I 2 p(u , ) 4.20D • Average:

I Ip2 2 p2 21 (u , ) (u , ) = 2.242

p pD D

pI 2 2p(u , ) 0.29D

2013/1/28

Page 37: Motion Detail Preserving  Optical  Flow Estimation

37

SELECTIVE DATA TERM• Selectively combine the constraints

where 2(x) : {0,1}

I Ix

(u, ) (u,x(x) 1) ( ) (u,x)(x)DE D D

2013/1/28

Page 38: Motion Detail Preserving  Optical  Flow Estimation

38

SELECTIVE DATA TERM

RubberWhale Urban22

2.5

3

3.5

4

4.5

5

colorgradientaverageours

AAE

selective

2013/1/28

Page 39: Motion Detail Preserving  Optical  Flow Estimation

39

OUTLINE

2013/1/28

• Previous Work

• Contributions

• Extended Flow Initialization

• Selective data term

• Efficient optimization solver

• Experimental result

• Conclusion

Page 40: Motion Detail Preserving  Optical  Flow Estimation

40

DISCRETE-OPTIMIZATION

2013/1/28

• Minimizing energy including discrete α & continuous u :

• Try to separate α & u

• For α• Probability of a particular state of MRF system

Ix

I(x) (u, x) (1 (x)) (u, x)(u, ) ( u, x)E SD D

(u, )1(u, ) EP eZ

Page 41: Motion Detail Preserving  Optical  Flow Estimation

41

DISCRETE-OPTIMIZATION

2013/1/28

• Partition function

• Sum over all possible values of α

(u, )

{u} { 0,1}

EZ e

I Ix

( u,x) (u, x) ((x) (x)

{ 0,

1 ) (u, x)

{u 1}}

x

S D D

e e

(u, x)(u, x) II

x

1{ ( u,x) ln( )}

{u}

DDS e e

e

Page 42: Motion Detail Preserving  Optical  Flow Estimation

• Optimal condition (Euler-Lagrange equations)

• It decomposes to

II (u, x)(u, x)

x

1(u) ( u,x) ln( )DDeffE S e e

I I( (u,x) (u,x))

1(x)1 D De

u I u I u(x) (u, x) (1 (x)) (u, x) div( ( u,x)) 0D D S

I I

I II I

(u,x) (u,x)

(u,x) (u,u I u I

u

x)(u,x) (u,x)(u, x) (u, x)

div( ( u,x)) 0

D D

D DD D

e ee e e e

D D

S

( )x 1 ( )x

DISCRETE-OPTIMIZATION

• Minimization – Update α– Compute flow field

Page 43: Motion Detail Preserving  Optical  Flow Estimation

43

CONTINUOUS-OPTIMIZATION

2013/1/28

• Energy function

• Variable splitting

Page 44: Motion Detail Preserving  Optical  Flow Estimation

44

CONTINUOUS-OPTIMIZATION

2013/1/28

• Fix u , estimate w,p

• Fix w,p , estimate u

• The Euler-Lagrange equation Is linear.

Page 45: Motion Detail Preserving  Optical  Flow Estimation

45

OUTLINE

2013/1/28

• Previous Work

• Contributions

• Extended Flow Initialization

• Selective data term

• Efficient optimization solver

• Experimental result

• Conclusion

Page 46: Motion Detail Preserving  Optical  Flow Estimation

46

SELECTIVE DATA TERM

Averaging Selective

Difference

2013/1/28

Page 47: Motion Detail Preserving  Optical  Flow Estimation

47

EXPERIMENTAL RESULTS

2013/1/28

Page 48: Motion Detail Preserving  Optical  Flow Estimation

48

RESULTS FROM DIFFERENT STEPS

Coarse-to-fine

Extended coarse-to-fine2013/1/28

Page 49: Motion Detail Preserving  Optical  Flow Estimation

492013/1/28

Page 50: Motion Detail Preserving  Optical  Flow Estimation

50

LARGE DISPLACEMENT

Overlaid Input 2013/1/28

Page 51: Motion Detail Preserving  Optical  Flow Estimation

51

LARGE DISPLACEMENT • Motion Estimates

Coarse-to-fine Result Warping Result2013/1/28

Page 52: Motion Detail Preserving  Optical  Flow Estimation

52

LARGE DISPLACEMENT • Motion Magnitude Maps

LDOP [Brox et al. 09 ] [Steinbrucker et al. 09]] Result2013/1/28

Page 53: Motion Detail Preserving  Optical  Flow Estimation

53

OVERLAID INPUT

2013/1/28

Page 54: Motion Detail Preserving  Optical  Flow Estimation

54Conventional Coarse-to-fine Result2013/1/28

Page 55: Motion Detail Preserving  Optical  Flow Estimation

55

EXPERIMENTAL RESULTS

Overlaid Input2013/1/28

Page 56: Motion Detail Preserving  Optical  Flow Estimation

56Coarse-to-fine Result2013/1/28

Page 57: Motion Detail Preserving  Optical  Flow Estimation

57

OUTLINE

2013/1/28

• Previous Work

• Contributions

• Extended Flow Initialization

• Selective data term

• Efficient optimization solver

• Experimental result

• Conclusion

Page 58: Motion Detail Preserving  Optical  Flow Estimation

58

CONCLUSION

2013/1/28

• To solve the coarse-to-fine problem , it seems more easier to make a correctness in every level.

• Using optical flow for small motion & other tracking skill for large displacement seems reasonable.

• It takes 40s ~ 3mins to compute an optical flow field respect to the amount of missing parts. Tradeoff problem.

Page 59: Motion Detail Preserving  Optical  Flow Estimation

592013/1/28

Thank you for your listening

Page 60: Motion Detail Preserving  Optical  Flow Estimation

60

FEATURE MATCHING

2013/1/28

• Feature :” interesting “ , ” unique” part of image

• Two components of feature :

Test image Detector: where are the local features?

Descriptor: how to describe them?

Page 61: Motion Detail Preserving  Optical  Flow Estimation

61

FEATURE MATCHING

2013/1/28

• Local measure of feature uniqueness Shifting the window in any direction causes a big change

“flat” :no change in all directions

“edge”: no change along the edge direction

“corner”:significant change in all directions

Page 62: Motion Detail Preserving  Optical  Flow Estimation

62

SIFT FEATURE MATCHING

2013/1/28

• SIFT : Scale Invariant Feature Transform

• Problem: non-invariant between image scales

All points will be classified as edges

Corner

Page 63: Motion Detail Preserving  Optical  Flow Estimation

63

SIFT FEATURE MATCHING

2013/1/28

• Find scale that gives local maxima of some function f in both position and scale

Page 64: Motion Detail Preserving  Optical  Flow Estimation

64

SIFT FEATURE MATCHING

2013/1/28

• Function f : Laplacian-of-Gaussian

Page 65: Motion Detail Preserving  Optical  Flow Estimation

65

SIFT FEATURE MATCHING

2013/1/28

• We define the characteristic scale as the scale that produces peak of Laplacian response

Page 66: Motion Detail Preserving  Optical  Flow Estimation

66

ALGORITHM• Scale-space extrema detection

• Keypoint localization

• Orientation assignment

• Keypoint descriptor

( )local descriptor

detector

descriptor

Page 67: Motion Detail Preserving  Optical  Flow Estimation

67

ALGORITHM• Scale-space extrema detection

• Keypoint localization

• Orientation assignment

• Keypoint descriptor

( )local descriptor

detector

descriptor

Page 68: Motion Detail Preserving  Optical  Flow Estimation

68

DETECTOR

2013/1/28

Page 69: Motion Detail Preserving  Optical  Flow Estimation

69

SCALE-SPACE EXTREMA DETECTION

2013/1/28

• Use Difference of Gaussian instead of LOG

• More efficient

DOG & LOG

Page 70: Motion Detail Preserving  Optical  Flow Estimation

70

KEYPOINT LOCALIZATION

2013/1/28

• X is selected if it is larger or smaller than all 26 neighbors

• Eliminating edge responses

Page 71: Motion Detail Preserving  Optical  Flow Estimation

71

ALGORITHM• Scale-space extrema detection

• Keypoint localization

• Orientation assignment

• Keypoint descriptor

( )local descriptor

detector

descriptor

Page 72: Motion Detail Preserving  Optical  Flow Estimation

72

ORIENTATION ASSIGNMENT

2013/1/28

• Use orientation histogram in the window to vote for total orientation

• Rotation-Invariant

Page 73: Motion Detail Preserving  Optical  Flow Estimation

73

KEYPOINT DESCRIPTOR

2013/1/28

• Describe the orientation histogram in 8x8 window near the pixel

• Illumination-robust

Back

Page 74: Motion Detail Preserving  Optical  Flow Estimation

74

PATCH MATCHING

2013/1/28

• SIFT still lose information about objects lacking features

• Using “patch” as a unit , minimizing

• Without smoothness term , it can detect large replacement , but also produce errors . Errors can be eliminate by fusion step.

Page 75: Motion Detail Preserving  Optical  Flow Estimation

75

PATCH MATCHING

2013/1/28

• Randomized Correspondence Algorithm

• Idea : Coherent matches with neighbors

• Algorithm

• Initialization

• Propagation

• Search

Page 76: Motion Detail Preserving  Optical  Flow Estimation

76

PATCH MATCHING

2013/1/28Back

Page 77: Motion Detail Preserving  Optical  Flow Estimation

77

GRAPHIC CUT

2013/1/28

• Regard every pixel of image as a random variable , then the image is a “ random field .”

• Every pixel is only related to its neighbors , the filed is a “ Markov random field. ”(MRF)

• MRF can be viewed as a graph.

Page 78: Motion Detail Preserving  Optical  Flow Estimation

78

GRAPHIC CUT

2013/1/28

• Regard the optical field as a MRF.

• The value of a pixel is chosen within optical flow frames produced previously , it’s a “ labeling problem. ”

• The edges between pixels are smoothness relation.

• Cut the graph with minimum energy.

Page 79: Motion Detail Preserving  Optical  Flow Estimation

79

GRAPHIC CUT

2013/1/28

• Minimize the energy function

• Multi-labeling problem

• expansion move algorithm : expanse the label which can decrease the energy

V. Lempitsky, S. Roth, and C. Rother, “Fusionflow: Discrete-Continuous Optimization for Optical Flow Estimation,”Proc. IEEE Conf. Computer Vision and Pattern Recognition,2008Back

Page 80: Motion Detail Preserving  Optical  Flow Estimation

80

FEATURE MATCHING

2013/1/28

• Find corners

Change of intensity for the shift [u,v]:

IntensityShifted intensity

Window function

orWindow function w(x,y) =

Gaussian1 in window, 0 outside

Page 81: Motion Detail Preserving  Optical  Flow Estimation

81

FEATURE MATCHING

2013/1/28

• For small shifts [u,v] we have a bilinear approximation:

where M is a 22 matrix computed from image derivatives:

Page 82: Motion Detail Preserving  Optical  Flow Estimation

82

FEATURE MATCHING

2013/1/28

2

“Corner”1 and 2 are large, 1 ~ 2;E increases in all directions

1 and 2 are small;E is almost constant in all directions

“Edge” 1 >> 2

“Edge” 2 >> 1

“Flat” region

Classification of image points using eigenvalues of M: