Motion and Flow Computer Vision Fall 2018 Columbia University - - PowerPoint PPT Presentation

motion and flow
SMART_READER_LITE
LIVE PREVIEW

Motion and Flow Computer Vision Fall 2018 Columbia University - - PowerPoint PPT Presentation

Motion and Flow Computer Vision Fall 2018 Columbia University World of Motion Illusionary Motion Stepping Feet Illusion Sometimes motion is only cue What do you see? What do you see? Motivation: Separate visual pathways in nature


slide-1
SLIDE 1

Motion and Flow

Computer Vision Fall 2018 Columbia University

slide-2
SLIDE 2

World of Motion

slide-3
SLIDE 3

Illusionary Motion

slide-4
SLIDE 4

Stepping Feet Illusion

slide-5
SLIDE 5

Sometimes motion is only cue

slide-6
SLIDE 6

What do you see?

slide-7
SLIDE 7

What do you see?

slide-8
SLIDE 8

è Ventral (‘what’) stream performs object recognition è Dorsal stream (‘where/how’) recognizes motion and locates objects

OPTICAL FLOW STIMULI

Motivation: Separate visual pathways in nature

Sources: “Sensitivity of MST neurons to optic flow stimuli. I. A continuum of response selectivity to large-field stimuli." Journal of neurophysiology 65.6 (1991). “A cortical representation of the local visual environment”, Nature. 392 (6676): 598–601, 2009 https://en.wikipedia.org/wiki/Two-streams_hypothesis

è “Interconnection”

e.g. in STS area

slide-9
SLIDE 9

Sources of Motion

Static camera, moving scene Moving camera, static scene Static camera, moving scene & light Moving camera and scene

slide-10
SLIDE 10

Challenges

slide-11
SLIDE 11

Representing Video

Width Height T i m e

slide-12
SLIDE 12

Representing Video

Eadweard Muybridge’s stop motion for studying animal location

slide-13
SLIDE 13

Optical Flow

Will start by estimating motion of each pixel separately Then will consider motion of entire image

slide-14
SLIDE 14

Why estimate motion?

Lots of uses

  • Feature representation for DeepNets [coming up]
  • Track object behavior
  • Correct for camera jitter (stabilization)
  • Align images (mosaics)
  • 3D shape reconstruction
  • Special effects
slide-15
SLIDE 15

(Michal Irani, Weizmann)

Mosaicing

slide-16
SLIDE 16

Mosaicing

(Michal Irani, Weizmann)

slide-17
SLIDE 17

Mosaicing for Panoramas on Smartphones

Compare small

  • verlap for efficiency

Left to right sweep of video camera Frame t t+1 t+3 t+5

slide-18
SLIDE 18

Mosaicing for Panoramas

slide-19
SLIDE 19

Mosaicing for Panoramas

slide-20
SLIDE 20

Mosaicing for Panoramas

slide-21
SLIDE 21

Mosaicing for Panoramas

slide-22
SLIDE 22

Anyone have funny failures from HW4?

slide-23
SLIDE 23

Parametric Motion Models

Similarity Affine Translation Homography

The previous models we used are too restricted to describe arbitrary motion

slide-24
SLIDE 24

Optical Flow

  • Optical flow field: assign a flow vector to each pixel
  • Visualize: flow magnitude as saturation,

  • rientation as hue

Ground-truth flow field Visualization code [Baker et al. 2007] Input two frames

slide-25
SLIDE 25

Motion Fields

Zoom out Zoom in Pan right to left

slide-26
SLIDE 26

Optical Flow

How to estimate pixel motion from image H to image I?

slide-27
SLIDE 27

Optical Flow

How to estimate pixel motion from image H to image I? Given pixel in H, look for nearby pixels in I that have same color. This is called color/brightness constancy assumption

slide-28
SLIDE 28

Apparent Motion versus Optical Flow

slide-29
SLIDE 29

Optical Flow Constraints

Let’s look at these constraints more closely

  • brightness constancy: Q: what’s the equation?
  • small motion:

) , ( ) , ( v y u x I y x H + + =

slide-30
SLIDE 30

Optical Flow Constraints

Combining these two equations

slide-31
SLIDE 31

Optical Flow Constraints

Combining these two equations

slide-32
SLIDE 32

How does this make sense?

What do the static image gradients 
 have to do with motion estimation?

Brightness constancy constraint equation

x y t

I u I v I + + =

slide-33
SLIDE 33

Aperture Problem

Which way did the line move?

slide-34
SLIDE 34

Aperture Problem

Which way did the line move?

slide-35
SLIDE 35

The barber pole illusion

http://en.wikipedia.org/wiki/Barberpole_illusion

slide-36
SLIDE 36

Aperture Problem

=

  • Ñ

= + + U I I v I u I

t y x

!

The gradient constraint: Defines a line in the (u,v) space u v

I I I I u

t

Ñ Ñ Ñ

  • =

^

Normal Flow:

slide-37
SLIDE 37

Figure by Michael Black

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)

slide-38
SLIDE 38

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)

  • If we use a 5x5 window, that gives us 25 equations

per pixel

Slide credit: Steve Seitz

slide-39
SLIDE 39

Solving the aperture problem

Problem: we have more equations than unknowns

  • The summations are over all pixels in the K x K window
  • This technique was first proposed by Lucas & Kanade (1981)

Solution: solve least squares problem

  • minimum least squares solution given by solution (in d) of:

Slide credit: Steve Seitz

slide-40
SLIDE 40

Solving the aperture problem

Problem: we have more equations than unknowns

  • The summations are over all pixels in the K x K window
  • This technique was first proposed by Lucas & Kanade (1981)

Solution: solve least squares problem

  • minimum least squares solution given by solution (in d) of:

Slide credit: Steve Seitz

slide-41
SLIDE 41

Conditions for solvability

When is this solvable?

  • ATA should be invertible
  • ATA should not be very small

– eigenvalues λ1 and λ2 of ATA should not be very small

  • ATA should be well-conditioned

– λ1/ λ2 should not be too large (λ1 = larger eigenvalue)

Slide by Steve Seitz, UW

Where have we seen this before?

slide-42
SLIDE 42

Motion and Optic Flow CS 4495 Computer Vision – A. Bobick

Low texture region

– gradients have small magnitude

– small λ1, small λ2

slide-43
SLIDE 43

Motion and Optic Flow CS 4495 Computer Vision – A. Bobick

Edge

– large gradients, all the same

– large λ1, small λ2

slide-44
SLIDE 44

Motion and Optic Flow CS 4495 Computer Vision – A. Bobick

High textured region

– gradients are different, large magnitudes

– large λ1, large λ2

slide-45
SLIDE 45

The aperture problem resolved

Actual motion

slide-46
SLIDE 46

The aperture problem resolved

Perceived motion

slide-47
SLIDE 47

Revisiting the small motion assumption

  • Is this motion small enough?
  • Probably not—it’s much larger than one pixel
  • How might we solve this problem?
slide-48
SLIDE 48

Optical Flow: Aliasing

Temporal aliasing causes ambiguities in optical flow because images can have many pixels with the same intensity.

nearest match is correct (no aliasing) nearest match is incorrect (aliasing)

actual shift estimated shift

slide-49
SLIDE 49

Reduce the resolution

slide-50
SLIDE 50

image 2 image 1

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 optical flow estimation

slide-51
SLIDE 51

image I image J

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

Coarse-to-fine optical flow estimation

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

. . .

slide-52
SLIDE 52

Optical Flow Results

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

slide-53
SLIDE 53

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Optical Flow Results

slide-54
SLIDE 54

Flow visualization Coarse-to-fine LK with median filtering Coarse-to-fine LK Input two frames

Optical Flow Results

slide-55
SLIDE 55

State-of-the-art optical flow, 2009

Start with something similar to Lucas-Kanade + gradient constancy + energy minimization with smoothing term + region matching + keypoint matching (long-range)

Large displacement optical flow, Brox et al., CVPR 2009

Region-based +Pixel-based +Keypoint-based

slide-56
SLIDE 56

Learning optic flow

Where do you get ground truth data?

slide-57
SLIDE 57

Learning optic flow

Synthetic Training data

Fischer et al. 2015. https://arxiv.org/abs/1504.06852

slide-58
SLIDE 58

Learning optic flow

Synthetic Training data

Fischer et al. 2015. https://arxiv.org/abs/1504.06852

slide-59
SLIDE 59

CNN: input is pair of input frames Upsample estimated flow back to input resolution Near state-of-the-art in terms of end-point-error

Fischer et al. 2015. https://arxiv.org/abs/1504.06852

Learning optic flow

slide-60
SLIDE 60

Results

Results on Sintel

Fischer et al. 2015. https://arxiv.org/abs/1504.06852

slide-61
SLIDE 61

Can we do more? Scene flow

Combine spatial stereo & temporal constraints Recover 3D vectors of world motion

Stereo view 1 Stereo view 2

t t-1

3D world motion vector per pixel z x y

slide-62
SLIDE 62

Scene flow example for human motion

Estimating 3D Scene Flow from Multiple 2D Optical Flows, Ruttle et al., 2009

slide-63
SLIDE 63

Scene Flow

[Estimation of Dense Depth Maps and 3D Scene Flow from Stereo Sequences, M. Jaimez et al., TU Munchen]

https://www.youtube.com/watch?v=RL_TK_Be6_4 https://vision.in.tum.de/research/sceneflow

slide-64
SLIDE 64

Layered model

slide-65
SLIDE 65

Mathematical formalism

Layer 0 (BG) Layer 1 Alpha composite Ii(x, y) = αi(x, y)Li(x, y) + (1 − αi(x, y))Ii−1(x, y)

slide-66
SLIDE 66
slide-67
SLIDE 67
slide-68
SLIDE 68

Motion Magnification

slide-69
SLIDE 69

Motion Magnification

slide-70
SLIDE 70

Motion Magnification

slide-71
SLIDE 71

Motion Magnification