Presentation is loading. Please wait.

Presentation is loading. Please wait.

Motion estimation Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/12 with slides by Michael Black and P. Anandan.

Similar presentations


Presentation on theme: "Motion estimation Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/12 with slides by Michael Black and P. Anandan."— Presentation transcript:

1 Motion estimation Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/12 with slides by Michael Black and P. Anandan

2 Announcement The first part of project #2 (feature detection and matching) is due on Sunday, please send your source code and two images showing your results to TAs.

3 Outline Motion estimation Lucas-Kanade algorithm Tracking Optical flow

4 Motion estimation Parametric motion (image alignment) Tracking Optical flow

5 Parametric motion direct method for image stitching

6 Tracking

7 Optical flow

8 Three assumptions Brightness consistency Spatial coherence Temporal persistence

9 Brightness consistency

10 Spatial coherence

11 Temporal persistence

12 Image registration Goal: register a template image J(x) and an input image I(x), where x=(x,y) T. Image alignment: I(x) and J(x) are two images Tracking: I(x) is the image at time t. J(x) is a small patch around the point p in the image at t+1. Optical flow: I(x) and J(x) are images of t and t+1.

13 Simple approach Minimize brightness difference

14 Simple SSD algorithm For each offset (u, v) compute E(u,v); Choose (u, v) which minimizes E(u,v); Problems: Not efficient No sub-pixel accuracy

15 Lucas-Kanade algorithm

16 Newton’s method Root finding for f(x)=0

17 Newton’s method Root finding for f(x)=0 Taylor’s expansion:

18 Newton’s method Root finding for f(x)=0 x0x0 x1x1 x2x2

19 Newton’s method pick up x = x 0 iterate compute update x by x+Δx until converge Minimize g(x) → find f(x)=g’(x)=0

20 Lucas-Kanade algorithm

21

22 iterate shift I(x,y) with (u,v) compute gradient image I x, I y compute error image J(x,y)-I(x,y) compute Hessian matrix solve the linear system (u,v)=(u,v)+(∆u,∆v) until converge

23 Parametric model translation affine Our goal is to find p to minimize E(p)

24 Parametric model minimize with respect to minimize

25 Parametric model image gradient Jacobian of the warp warped image

26 Jacobian of the warp For example, for affine

27 Parametric model minimize Hessian

28 Lucas-Kanade algorithm iterate 1) warp I with W(x;p) 2) compute error image J(x,y)-I(W(x,p)) 3) compute gradient image with W(x,p) 4) evaluate Jacobian at (x;p) 5) compute 6) compute Hessian 7) compute 8) solve 9) update p by p+ until converge

29

30 Coarse-to-fine strategy J JwJw I warp refine + J JwJw I warp refine + J pyramid construction J JwJw I warp refine + I pyramid construction

31 Application of image alignment

32 Tracking

33 I(x,y,t) I(x,y,t+1)

34 Tracking optical flow constraint equation brightness constancy

35 Optical flow constraint equation

36 Multiple constraints

37 Area-based method Assume spatial smoothness

38 Aperture problem

39

40

41 Demo for aperture problem http://www.sandlotscience.com/Distortions/Br eathing_Square.htmhttp://www.sandlotscience.com/Distortions/Br eathing_Square.htm http://www.sandlotscience.com/Ambiguous/Ba rberpole_Illusion.htmhttp://www.sandlotscience.com/Ambiguous/Ba rberpole_Illusion.htm

42 Aperture problem Larger window reduces ambiguity, but easily violates spatial smoothness assumption

43 Area-based method Assume spatial smoothness

44 Area-based method must be invertible

45 Area-based method The eigenvalues tell us about the local image structure. They also tell us how well we can estimate the flow in both directions Link to Harris corner detector

46 Textured area

47 Edge

48 Homogenous area

49 KLT tracking Select feature by Monitor features by measuring dissimilarity

50

51

52

53 KLT tracking http://www.ces.clemson.edu/~stb/klt/

54 KLT tracking http://www.ces.clemson.edu/~stb/klt/

55 SIFT tracking (matching actually)  Frame 0 Frame 10

56 SIFT tracking  Frame 0 Frame 100

57 SIFT tracking  Frame 0 Frame 200

58 KLT vs SIFT tracking KLT has larger accumulating error; partly because our KLT implementation doesn’t have affine transformation? SIFT is surprisingly robust Combination of SIFT and KLT (example)example http://www.frc.ri.cmu.edu/projects/buzzard/smalls/

59 Tracking for rotoscoping

60

61 Waking life

62 Optical flow

63 Single-motion assumption Violated by Motion discontinuity Shadows Transparency Specular reflection …

64 Multiple motion

65

66 Simple problem: fit a line

67 Least-square fit

68

69 Robust statistics Recover the best fit for the majority of the data Detect and reject outliers

70 Approach

71 Robust weighting

72 Robust estimation

73

74

75

76 Regularization and dense optical flow

77

78

79

80

81

82

83

84

85

86

87 Input for the NPR algorithm

88 Brushes

89 Edge clipping

90 Gradient

91 Smooth gradient

92 Textured brush

93 Edge clipping

94 Temporal artifacts Frame-by-frame application of the NPR algorithm

95 Temporal coherence

96 RE:Vision

97 What dreams may come

98 Reference B.D. Lucas and T. Kanade, An Iterative Image Registration Technique with an Application to Stereo Vision, Proceedings of the 1981 DARPA Image Understanding Workshop, 1981, pp121-130.An Iterative Image Registration Technique with an Application to Stereo Vision Bergen, J. R. and Anandan, P. and Hanna, K. J. and Hingorani, R., Hierarchical Model-Based Motion Estimation, ECCV 1992, pp237-252. Hierarchical Model-Based Motion Estimation J. Shi and C. Tomasi, Good Features to Track, CVPR 1994, pp593-600.Good Features to Track Michael Black and P. Anandan, The Robust Estimation of Multiple Motions: Parametric and Piecewise-Smooth Flow Fields, Computer Vision and Image Understanding 1996, pp75-104.The Robust Estimation of Multiple Motions: Parametric and Piecewise-Smooth Flow Fields S. Baker and I. Matthews, Lucas-Kanade 20 Years On: A Unifying Framework, International Journal of Computer Vision, 56(3), 2004, pp221 - 255.Lucas-Kanade 20 Years On: A Unifying Framework Peter Litwinowicz, Processing Images and Video for An Impressionist Effects, SIGGRAPH 1997.Processing Images and Video for An Impressionist Effects Aseem Agarwala, Aaron Hertzman, David Salesin and Steven Seitz, Keyframe-Based Tracking for Rotoscoping and Animation, SIGGRAPH 2004, pp584-591. Keyframe-Based Tracking for Rotoscoping and Animation


Download ppt "Motion estimation Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/12 with slides by Michael Black and P. Anandan."

Similar presentations


Ads by Google