Presentation is loading. Please wait.

Presentation is loading. Please wait.

Multimedia Programming 21: Video and its applications Departments of Digital Contents Sang Il Park Lots of Slides are stolen from Alexei Efros, CMU.

Similar presentations


Presentation on theme: "Multimedia Programming 21: Video and its applications Departments of Digital Contents Sang Il Park Lots of Slides are stolen from Alexei Efros, CMU."— Presentation transcript:

1 Multimedia Programming 21: Video and its applications Departments of Digital Contents Sang Il Park Lots of Slides are stolen from Alexei Efros, CMU

2 Outline Review: OpenCV Video I/O Video Texture

3 OpenCV Video I/O OpenCV 의 Video Reading Functions CvCapture cvCaptureFromFile cvCaptureFromCAM cvReleaseCapture cvQueryFrame cvGetCaptureProperty cvSetCaptureProperty

4 OpenCV Video I/O OpenCV 의 Video Writing Functions cvCreateVideoWriter cvReleaseVideoWriter cvWriteFrame

5 날씨 예보는 어떻게 할까 ? 일기예보문제 : 오늘의 날씨를 알 때, 내일의 날씨를 알고 싶다 날씨가 오직 {Sunny( 맑음 ), Cloudy( 흐림 ), Raining( 비 )} 만 있다면 … The “Weather Channel” algorithm: 긴 세월 동안 기록해 놓은 것 : – 비 (R) 온 다음날에 얼마나 자주 맑음 (S) 이었나 – 맑은 날 (S) 뒤에 얼마나 자주 자주 맑음 (S) 이었나 –Etc. 각각의 상태에 대해 확률 (%) 를 계산한다. : –P(R|S), P(S|S), etc. 오늘의 날씨에 대비해 내일의 날씨는 이 확률 중 가장 높은 것 !  It’s a Markov Chain

6 Markov Chain 만약 오늘과 어제의 날씨를 알고 있다면 ?

7 문장 합성 [ Shannon,’48] 은 N-gram 을 이용한 ‘ 영어같은 ’ 문장 만드는 법을 개발했다 : Markov model 을 일반화 아주 많은 문서들을 분석하여 N-1 개의 글자가 주어졌을 때 그 뒤에 붙을 수 있는 글자들을 각 각의 글자들의 확률로 계산 첫 글자로 시작하여 Markov chain 을 돌며 확률적으로 선택 글자 단위가 아니라 단어 단위로도 적용 가능 WE NEEDTOEATCAKE

8 Mark V. Shaney (Bell Labs) Results ( alt.singles 의 글들로 훈련 ): “One morning I shot an elephant in my arms and kissed him.” “I spent an interesting evening recently with a grain of salt” 개그 콘서트의 “ 애드리부라더스 ” 와 비슷

9 Video Textures Arno Schödl Richard Szeliski David Salesin Irfan Essa Microsoft Research, Georgia Tech

10 Still photos

11 Video clips

12 Video textures

13 Problem statement video clipvideo texture

14 Our approach How do we find good transitions?

15 Finding good transitions Compute L 2 distance D i, j between all frames Similar frames make good transitions frame ivs. frame j

16 Markov chain representation Similar frames make good transitions

17 Transition costs Transition from i to j if successor of i is similar to j Cost function: C i  j = D i+1, j

18 Transition probabilities Probability for transition P i  j inversely related to cost: P i  j ~ exp ( – C i  j /  2 ) high  low 

19 Preserving dynamics

20

21 Cost for transition i  j C i  j = w k D i+k+1, j+k

22 Preserving dynamics – effect Cost for transition i  j C i  j = w k D i+k+1, j+k

23 Dead ends No good transition at the end of sequence

24 Future cost Propagate future transition costs backward Iteratively compute new cost F i  j = C i  j +  min k F j  k

25 Future cost Propagate future transition costs backward Iteratively compute new cost F i  j = C i  j +  min k F j  k

26 Future cost Propagate future transition costs backward Iteratively compute new cost F i  j = C i  j +  min k F j  k

27 Future cost Propagate future transition costs backward Iteratively compute new cost F i  j = C i  j +  min k F j  k

28 Propagate future transition costs backward Iteratively compute new cost F i  j = C i  j +  min k F j  k Q-learning Future cost

29 Future cost – effect

30 Finding good loops Alternative to random transitions Precompute set of loops up front

31 Visual discontinuities Problem: Visible “Jumps”

32 Crossfading Solution: Crossfade from one sequence to the other.

33 Morphing Interpolation task:

34 Morphing Interpolation task: Compute correspondence between pixels of all frames

35 Morphing Interpolation task: Compute correspondence between pixels of all frames Interpolate pixel position and color in morphed frame based on [Shum 2000]

36 Results – crossfading/morphing

37 Jump Cut Crossfade Morph

38 Crossfading

39 Frequent jump & crossfading

40 Video portrait Useful for web pages

41 Combine with IBR techniques Video portrait – 3D

42 Region-based analysis Divide video up into regions Generate a video texture for each region

43 Automatic region analysis

44 User selects target frame range User-controlled video textures slowvariablefast

45 Lengthen / shorten video without affecting speed Time warping shorteroriginallonger

46 Video-based animation Like sprites computer games Extract sprites from real video Interactively control desired motion ©1985 Nintendo of America Inc.

47 Video sprite extraction

48 Video sprite control Augmented transition cost:

49 Video sprite control Need future cost computation Precompute future costs for a few angles. Switch between precomputed angles according to user input [GIT-GVU-00-11]

50 Interactive fish

51 Summary Video clips  video textures define Markov process preserve dynamics avoid dead-ends disguise visual discontinuities

52 Summary Extensions regions external constraints video-based animation

53 Discussion Some things are relatively easy

54 Discussion Some are hard

55 A final example


Download ppt "Multimedia Programming 21: Video and its applications Departments of Digital Contents Sang Il Park Lots of Slides are stolen from Alexei Efros, CMU."

Similar presentations


Ads by Google