Mo#on and Op#cal Flow Ali Farhadi CSE 576 - - PowerPoint PPT Presentation

mo on and op cal flow
SMART_READER_LITE
LIVE PREVIEW

Mo#on and Op#cal Flow Ali Farhadi CSE 576 - - PowerPoint PPT Presentation

Mo#on and Op#cal Flow Ali Farhadi CSE 576 Several slides from Ce Liu, Steve Seitz, Larry Zitnick We live in a moving world


slide-1
SLIDE 1

Mo#on ¡and ¡Op#cal ¡Flow ¡

Ali ¡Farhadi ¡ CSE ¡576 ¡ ¡ ¡ ¡ ¡

Several ¡slides ¡from ¡Ce ¡Liu, ¡Steve ¡Seitz, ¡Larry ¡Zitnick ¡

slide-2
SLIDE 2

We ¡live ¡in ¡a ¡moving ¡world ¡

  • Perceiving, ¡understanding ¡and ¡predic#ng ¡mo#on ¡is ¡an ¡

important ¡part ¡of ¡our ¡daily ¡lives ¡

¡

slide-3
SLIDE 3

Mo#on ¡and ¡perceptual ¡organiza#on ¡

  • Even ¡“impoverished” ¡mo#on ¡data ¡can ¡evoke ¡a ¡

strong ¡percept ¡

  • G. ¡Johansson, ¡“Visual ¡Percep#on ¡of ¡Biological ¡Mo#on ¡and ¡a ¡Model ¡For ¡Its ¡Analysis", ¡

Percep&on ¡and ¡Psychophysics ¡14, ¡201-­‑211, ¡1973. ¡

slide-4
SLIDE 4

Mo#on ¡and ¡perceptual ¡organiza#on ¡

  • Even ¡“impoverished” ¡mo#on ¡data ¡can ¡evoke ¡a ¡

strong ¡percept ¡ ¡

  • G. ¡Johansson, ¡“Visual ¡Percep#on ¡of ¡Biological ¡Mo#on ¡and ¡a ¡Model ¡For ¡Its ¡Analysis", ¡

Percep&on ¡and ¡Psychophysics ¡14, ¡201-­‑211, ¡1973. ¡

slide-5
SLIDE 5

Seeing ¡mo#on ¡from ¡a ¡sta#c ¡picture? ¡

hSp://www.ritsumei.ac.jp/~akitaoka/index-­‑e.html ¡

slide-6
SLIDE 6

More ¡examples ¡

slide-7
SLIDE 7

How ¡is ¡this ¡possible? ¡

  • The ¡true ¡mechanism ¡is ¡to ¡

be ¡revealed ¡

  • FMRI ¡data ¡suggest ¡that ¡ ¡

illusion ¡is ¡related ¡to ¡some ¡ component ¡of ¡eye ¡ movements ¡

  • We ¡don’t ¡expect ¡computer ¡

vision ¡to ¡“see” ¡mo#on ¡from ¡ these ¡s#muli, ¡yet ¡

slide-8
SLIDE 8

What ¡do ¡you ¡see? ¡

slide-9
SLIDE 9

In ¡fact, ¡… ¡

slide-10
SLIDE 10

The ¡cause ¡of ¡mo#on ¡

  • Three ¡factors ¡in ¡imaging ¡process ¡

– Light ¡ – Object ¡ – Camera ¡ ¡

  • Varying ¡either ¡of ¡them ¡causes ¡mo#on ¡

– Sta#c ¡camera, ¡moving ¡objects ¡(surveillance) ¡ – Moving ¡camera, ¡sta#c ¡scene ¡(3D ¡capture) ¡ – Moving ¡camera, ¡moving ¡scene ¡(sports, ¡movie) ¡ – Sta#c ¡camera, ¡moving ¡objects, ¡moving ¡light ¡(#me ¡lapse) ¡

slide-11
SLIDE 11

Mo#on ¡scenarios ¡(priors) ¡

Sta#c ¡camera, ¡moving ¡scene ¡ Moving ¡camera, ¡sta#c ¡scene ¡ Moving ¡camera, ¡moving ¡scene ¡ Sta#c ¡camera, ¡moving ¡scene, ¡moving ¡light ¡

slide-12
SLIDE 12

We ¡s#ll ¡don’t ¡touch ¡these ¡areas ¡

slide-13
SLIDE 13

How ¡can ¡we ¡recover ¡mo#on? ¡

slide-14
SLIDE 14

Recovering ¡mo#on ¡

  • Feature-­‑tracking ¡

– Extract ¡visual ¡features ¡(corners, ¡textured ¡areas) ¡and ¡“track” ¡them ¡over ¡ mul#ple ¡frames ¡

  • Op#cal ¡flow ¡

– Recover ¡image ¡mo#on ¡at ¡each ¡pixel ¡from ¡spa#o-­‑temporal ¡image ¡ brightness ¡varia#ons ¡(op#cal ¡flow) ¡

  • B. ¡Lucas ¡and ¡T. ¡Kanade. ¡An ¡itera#ve ¡image ¡registra#on ¡technique ¡with ¡an ¡applica#on ¡to ¡

stereo ¡vision. ¡In ¡Proceedings ¡of ¡the ¡Interna&onal ¡Joint ¡Conference ¡on ¡Ar&ficial ¡Intelligence, ¡pp. ¡ 674–679, ¡1981. ¡

Two problems, one registration method

slide-15
SLIDE 15

Feature ¡tracking ¡

  • Challenges ¡

– Figure ¡out ¡which ¡features ¡can ¡be ¡tracked ¡ – Efficiently ¡track ¡across ¡frames ¡ – Some ¡points ¡may ¡change ¡appearance ¡over ¡#me ¡ (e.g., ¡due ¡to ¡rota#on, ¡moving ¡into ¡shadows, ¡etc.) ¡ – Drim: ¡small ¡errors ¡can ¡accumulate ¡as ¡appearance ¡ model ¡is ¡updated ¡ – Points ¡may ¡appear ¡or ¡disappear: ¡need ¡to ¡be ¡able ¡ to ¡add/delete ¡tracked ¡points ¡

slide-16
SLIDE 16

Feature ¡tracking ¡

  • Given ¡two ¡subsequent ¡frames, ¡es#mate ¡the ¡point ¡

transla#on ¡

  • Key ¡assump#ons ¡of ¡Lucas-­‑Kanade ¡Tracker ¡
  • Brightness ¡constancy: ¡ ¡projec#on ¡of ¡the ¡same ¡point ¡looks ¡the ¡same ¡in ¡

every ¡frame ¡

  • Small ¡mo3on: ¡ ¡points ¡do ¡not ¡move ¡very ¡far ¡
  • Spa3al ¡coherence: ¡points ¡move ¡like ¡their ¡neighbors ¡

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

slide-17
SLIDE 17

t y x

I v I u I t y x I t v y u x I + ⋅ + ⋅ + ≈ + + + ) , , ( ) 1 , , (

  • Brightness ¡Constancy ¡Equa#on: ¡

) , ( ) , , (

1 , +

+ + =

t

v y u x I t y x I

Take ¡Taylor ¡expansion ¡of ¡I(x+u, y+v, t+1) ¡at ¡(x,y,t) ¡to ¡linearize ¡the ¡right ¡side: ¡

The ¡brightness ¡constancy ¡constraint ¡

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

≈ + ⋅ + ⋅

t y x

I v I u I

So: ¡

Image derivative along x

[ ]

I v u I

t T

= + ⋅ ∇ →

t y x

I v I u I t y x I t v y u x I + ⋅ + ⋅ + = − + + + ) , , ( ) 1 , , (

Difference over frames

slide-18
SLIDE 18

The ¡brightness ¡constancy ¡constraint ¡

  • How ¡many ¡equa#ons ¡and ¡unknowns ¡per ¡pixel? ¡

The ¡component ¡of ¡the ¡mo#on ¡perpendicular ¡to ¡the ¡gradient ¡ (i.e., ¡parallel ¡to ¡the ¡edge) ¡cannot ¡be ¡measured ¡

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

If ¡(u, ¡v) ¡sa#sfies ¡the ¡equa#on, ¡ ¡ so ¡does ¡(u+u’, ¡v+v’ ¡) ¡if ¡ ¡

  • One ¡equa#on ¡(this ¡is ¡a ¡scalar ¡equa#on!), ¡two ¡unknowns ¡(u,v) ¡

[ ]

I v u I

t T

= + ⋅ ∇

[ ]

' v ' u I

T =

⋅ ∇

Can ¡we ¡use ¡this ¡equa#on ¡to ¡recover ¡image ¡mo#on ¡(u,v) ¡at ¡each ¡ pixel? ¡

slide-19
SLIDE 19

The ¡aperture ¡problem ¡

Actual motion

slide-20
SLIDE 20

The ¡aperture ¡problem ¡

Perceived motion

slide-21
SLIDE 21

The ¡barber ¡pole ¡illusion ¡

hSp://en.wikipedia.org/wiki/Barberpole_illusion ¡

slide-22
SLIDE 22

The ¡barber ¡pole ¡illusion ¡

hSp://en.wikipedia.org/wiki/Barberpole_illusion ¡

slide-23
SLIDE 23

Solving ¡the ¡ ¡ambiguity… ¡

  • How ¡to ¡get ¡more ¡equa#ons ¡for ¡a ¡pixel? ¡
  • Spa3al ¡coherence ¡constraint ¡ ¡
  • ¡ ¡ ¡ ¡Assume ¡the ¡pixel’s ¡neighbors ¡have ¡the ¡same ¡(u,v) ¡

– If ¡we ¡use ¡a ¡5x5 ¡window, ¡that ¡gives ¡us ¡25 ¡equa#ons ¡per ¡pixel ¡

  • B. ¡Lucas ¡and ¡T. ¡Kanade. ¡An ¡itera#ve ¡image ¡registra#on ¡technique ¡with ¡an ¡applica#on ¡to ¡stereo ¡vision. ¡In ¡Proceedings ¡of ¡the ¡

Interna&onal ¡Joint ¡Conference ¡on ¡Ar&ficial ¡Intelligence, ¡pp. ¡674–679, ¡1981. ¡

slide-24
SLIDE 24
  • Least ¡squares ¡problem: ¡

Solving ¡the ¡ ¡ambiguity… ¡

slide-25
SLIDE 25

Matching ¡patches ¡across ¡images ¡

  • Overconstrained ¡linear ¡system ¡

The ¡summa#ons ¡are ¡over ¡all ¡pixels ¡in ¡the ¡K ¡x ¡K ¡window ¡

Least ¡squares ¡solu#on ¡for ¡d ¡given ¡by ¡

slide-26
SLIDE 26

Condi#ons ¡for ¡solvability ¡

Op#mal ¡(u, ¡v) ¡sa#sfies ¡Lucas-­‑Kanade ¡equa#on ¡

Does this remind you of anything?

¡When ¡is ¡this ¡solvable? ¡ ¡I.e., ¡what ¡are ¡good ¡points ¡to ¡track? ¡

  • ATA ¡should ¡be ¡inver#ble ¡ ¡
  • ATA ¡should ¡not ¡be ¡too ¡small ¡due ¡to ¡noise ¡

– eigenvalues ¡l1 ¡and ¡l ¡2 ¡of ¡ATA ¡should ¡not ¡be ¡too ¡small ¡

  • ATA ¡should ¡be ¡well-­‑condi#oned ¡

– ¡l ¡1/ ¡l ¡2 ¡should ¡not ¡be ¡too ¡large ¡(l1 ¡= ¡larger ¡eigenvalue) ¡

Criteria for Harris corner detector

slide-27
SLIDE 27

Aperture ¡problem ¡

Corners ¡ Lines ¡ Flat ¡regions ¡

slide-28
SLIDE 28

28

slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31

The ¡aperture ¡problem ¡resolved ¡

Actual motion

slide-32
SLIDE 32

The ¡aperture ¡problem ¡resolved ¡

Perceived motion

slide-33
SLIDE 33

Dealing ¡with ¡larger ¡movements: ¡ Itera#ve ¡refinement ¡

  • 1. Ini#alize ¡(x’,y’) ¡= ¡(x,y) ¡
  • 2. Compute ¡(u,v) ¡by ¡
  • 3. Shim ¡window ¡by ¡(u, ¡v): ¡x’=x’+u; y’=y’+v;
  • 4. Recalculate ¡It
  • 5. Repeat ¡steps ¡2-­‑4 ¡un#l ¡small ¡change ¡
  • Use ¡interpola#on ¡for ¡subpixel ¡values ¡

2nd moment matrix for feature patch in first image displacement It = I(x’, y’, t+1) - I(x, y, t) Original (x,y) position

slide-34
SLIDE 34

image I image J

Gaussian pyramid of image 1 (t) Gaussian pyramid of image 2 (t+1) image 2 image 1

Coarse-­‑to-­‑fine ¡op#cal ¡flow ¡es#ma#on ¡

run iterative L-K run iterative L-K warp & upsample

. . .

slide-35
SLIDE 35

image I image H

Gaussian pyramid of image 1 Gaussian pyramid of image 2 image 2 image 1

u=10 pixels u=5 pixels u=2.5 pixels u=1.25 pixels

Coarse-­‑to-­‑fine ¡op#cal ¡flow ¡es#ma#on ¡

slide-36
SLIDE 36

Example ¡

* ¡From ¡Khurram ¡Hassan-­‑Shafique ¡CAP5415 ¡Computer ¡Vision ¡2003 ¡

slide-37
SLIDE 37

Mul#-­‑resolu#on ¡registra#on ¡

* ¡From ¡Khurram ¡Hassan-­‑Shafique ¡CAP5415 ¡Computer ¡Vision ¡2003 ¡

slide-38
SLIDE 38

Op#cal ¡Flow ¡Results ¡

* ¡From ¡Khurram ¡Hassan-­‑Shafique ¡CAP5415 ¡Computer ¡Vision ¡2003 ¡

slide-39
SLIDE 39

Op#cal ¡Flow ¡Results ¡

* ¡From ¡Khurram ¡Hassan-­‑Shafique ¡CAP5415 ¡Computer ¡Vision ¡2003 ¡

slide-40
SLIDE 40

Errors ¡in ¡Lucas-­‑Kanade ¡

  • The ¡mo#on ¡is ¡large ¡

– Possible ¡Fix: ¡Keypoint ¡matching ¡

  • A ¡point ¡does ¡not ¡move ¡like ¡its ¡neighbors ¡

– Possible ¡Fix: ¡Region-­‑based ¡matching ¡

  • Brightness ¡constancy ¡does ¡not ¡hold ¡

– Possible ¡Fix: ¡Gradient ¡constancy ¡

slide-41
SLIDE 41

Flow quality evaluation

slide-42
SLIDE 42

Flow quality evaluation

slide-43
SLIDE 43
  • Middlebury flow page

– http://vision.middlebury.edu/flow/

Ground Truth

Flow quality evaluation

slide-44
SLIDE 44
  • Middlebury flow page

– http://vision.middlebury.edu/flow/

Ground Truth Lucas-Kanade flow

Flow quality evaluation

slide-45
SLIDE 45
  • Middlebury flow page

– http://vision.middlebury.edu/flow/

Ground Truth Best-in-class alg

Flow quality evaluation

slide-46
SLIDE 46

Video ¡stabiliza#on ¡

slide-47
SLIDE 47

Video ¡denoising ¡

slide-48
SLIDE 48

Video ¡super ¡resolu#on ¡

slide-49
SLIDE 49

Summary ¡

  • Major ¡contribu#ons ¡from ¡Lucas, ¡Tomasi, ¡Kanade ¡

– Tracking ¡feature ¡points ¡ – Op#cal ¡flow ¡ – Stereo ¡ – Structure ¡from ¡mo#on ¡

  • Key ¡ideas ¡

– By ¡assuming ¡brightness ¡constancy, ¡truncated ¡Taylor ¡ expansion ¡leads ¡to ¡simple ¡and ¡fast ¡patch ¡matching ¡ across ¡frames ¡ – Coarse-­‑to-­‑fine ¡registra#on ¡