Optical flow Many slides adapted from S. Seitz, R. Szeliski, M. - - PowerPoint PPT Presentation

optical flow
SMART_READER_LITE
LIVE PREVIEW

Optical flow Many slides adapted from S. Seitz, R. Szeliski, M. - - PowerPoint PPT Presentation

Optical flow Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys Slides from S. Lazebnik. Motion is a powerful perceptual cue Sometimes, it is the only cue Motion is a powerful perceptual cue Even impoverished motion


slide-1
SLIDE 1

Optical flow

Many slides adapted from S. Seitz, R. Szeliski, M. Pollefeys Slides from S. Lazebnik.

slide-2
SLIDE 2

Motion is a powerful perceptual cue

  • Sometimes, it is the only cue
slide-3
SLIDE 3

Motion is a powerful perceptual cue

  • Even “impoverished” motion data can evoke

a strong percept

  • G. Johansson, “Visual Perception of Biological Motion and a Model For Its Analysis",

Perception and Psychophysics 14, 201-211, 1973.

Source: L. Lazebnik

slide-4
SLIDE 4

Motion is a powerful perceptual cue

  • Even “impoverished” motion data can evoke

a strong percept

  • G. Johansson, “Visual Perception of Biological Motion and a Model For Its Analysis",

Perception and Psychophysics 14, 201-211, 1973.

Source: L. Lazebnik

slide-5
SLIDE 5

Uses of motion in computer vision

  • 3D shape reconstruction
  • Object segmentation
  • Learning and tracking of dynamical models
  • Event and activity recognition
  • Self-supervised and predictive learning

Source: L. Lazebnik

slide-6
SLIDE 6

Motion field

  • The motion field is the projection of the 3D

scene motion into the image

Source: L. Lazebnik

slide-7
SLIDE 7

Optical flow

  • Definition: optical flow is the apparent motion
  • f brightness patterns in the image
  • Ideally, optical flow would be the same as the

motion field

  • Have to be careful: apparent motion can be

caused by lighting changes without any actual motion

  • Think of a uniform rotating sphere under fixed lighting
  • vs. a stationary sphere under moving illumination

Source: L. Lazebnik

slide-8
SLIDE 8

Estimating optical flow

  • Given two subsequent frames, estimate the apparent

motion field u(x,y) and v(x,y) between them

  • Key assumptions
  • Brightness constancy: projection of the same point looks the

same in every frame

  • Small motion: points do not move very far
  • Spatial coherence: points move like their neighbors

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

Source: L. Lazebnik

slide-9
SLIDE 9

Brightness Constancy Equation:

) , ( ) 1 , , (

), , ( ) , ( t y x y x

v y u x I t y x I + + =

  • )

, ( ) , ( ) , , ( ) 1 , , ( y x v I y x u I t y x I t y x I

y x

+ + »

  • Linearizing the right side using Taylor expansion:

The brightness constancy constraint

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

» + +

t y x

I v I u I

Hence,

Source: L. Lazebnik

slide-10
SLIDE 10

The brightness constancy constraint

  • How many equations and unknowns per pixel?
  • One equation, two unknowns
  • What does this constraint mean?
  • The component of the flow perpendicular to the

gradient (i.e., parallel to the edge) is unknown!

= + +

t y x

I v I u I

) , ( = + × Ñ

t

I v u I

Source: L. Lazebnik

slide-11
SLIDE 11

The brightness constancy constraint

  • How many equations and unknowns per pixel?
  • One equation, two unknowns
  • What does this constraint mean?
  • The component of the flow perpendicular to the

gradient (i.e., parallel to the edge) is unknown!

= + +

t y x

I v I u I

) ' , ' ( = × Ñ v u I

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

If (u, v) satisfies the equation, so does (u+u’, v+v’) if

) , ( = + × Ñ

t

I v u I

Source: L. Lazebnik

slide-12
SLIDE 12

The aperture problem

Perceived motion

Source: L. Lazebnik

slide-13
SLIDE 13

The aperture problem

Actual motion

Source: L. Lazebnik

slide-14
SLIDE 14

The barber pole illusion

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

Source: L. Lazebnik

slide-15
SLIDE 15

The barber pole illusion

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

Source: L. Lazebnik

slide-16
SLIDE 16

Solving the aperture problem

  • How to get more equations for a pixel?
  • Spatial coherence constraint: assume the pixel’s

neighbors have the same (u,v)

  • E.g., if we use a 5x5 window, that gives us 25 equations per pixel
  • B. Lucas and T. Kanade. An iterative image registration technique with an application to

stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence, pp. 674–679, 1981.

) ( ] , [ ) ( = + × Ñ

i t i

I v u I x x

ú ú ú ú û ù ê ê ê ê ë é

  • =

ú û ù ê ë é ú ú ú ú ú û ù ê ê ê ê ê ë é ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (

2 1 2 2 1 1 n t t t n y n x y x y x

I I I v u I I I I I I x x x x x x x x x ! ! !

Source: L. Lazebnik

slide-17
SLIDE 17

Lucas-Kanade flow

  • Linear least squares problem:
  • B. Lucas and T. Kanade. An iterative image registration technique with an application to

stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence, pp. 674–679, 1981.

  • When is this system solvable?

ú ú ú ú û ù ê ê ê ê ë é

  • =

ú û ù ê ë é ú ú ú ú ú û ù ê ê ê ê ê ë é ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (

2 1 2 2 1 1 n t t t n y n x y x y x

I I I v u I I I I I I x x x x x x x x x ! ! !

Source: L. Lazebnik

slide-18
SLIDE 18

Lucas-Kanade flow

  • Linear least squares problem:
  • B. Lucas and T. Kanade. An iterative image registration technique with an application to

stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence, pp. 674–679, 1981. (summations are over all pixels in the window)

  • Solution given by

ú ú ú ú û ù ê ê ê ê ë é

  • =

ú û ù ê ë é ú ú ú ú ú û ù ê ê ê ê ê ë é ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) (

2 1 2 2 1 1 n t t t n y n x y x y x

I I I v u I I I I I I x x x x x x x x x ! ! !

1 1 2 2 ´ ´ ´

=

n n

b d A

b A A)d A

T T

= (

ú ú û ù ê ê ë é

  • =

ú û ù ê ë é ú ú û ù ê ê ë é

å å å å å å

t y t x y y y x y x x x

I I I I v u I I I I I I I I

M = ATA is the second moment matrix!

Source: L. Lazebnik

slide-19
SLIDE 19

Recall: second moment matrix

l1 l2 “Corner” l1 and l2 are large, l1 ~ l2 l1 and l2 are small “Edge” l1 >> l2 “Edge” l2 >> l1 “Flat” region

  • Estimation of optical flow is well-conditioned

precisely for regions with high “cornerness”:

Source: L. Lazebnik

slide-20
SLIDE 20

Conditions for solvability

  • “Bad” case: single straight edge

Source: L. Lazebnik

slide-21
SLIDE 21

Conditions for solvability

  • “Good” case

Source: L. Lazebnik

slide-22
SLIDE 22

Lucas-Kanade flow example

Input frames Output

Source: MATLAB Central File Exchange

Source: L. Lazebnik

slide-23
SLIDE 23

Errors in Lucas-Kanade

  • The motion is large (larger than a pixel)
  • A point does not move like its neighbors
  • Brightness constancy does not hold

Source: L. Lazebnik

slide-24
SLIDE 24

“Flower garden” example

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Source: L. Lazebnik

slide-25
SLIDE 25

“Flower garden” example

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Lucas-Kanade fails in areas of large motion

Source: L. Lazebnik

slide-26
SLIDE 26

Multi-resolution estimation

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

Source: L. Lazebnik

slide-27
SLIDE 27

Multi-resolution estimation

* From Khurram Hassan-Shafique CAP5415 Computer Vision 2003

With multi-resolution estimation

Source: L. Lazebnik

slide-28
SLIDE 28

Fixing the errors in Lucas-Kanade

  • The motion is large (larger than a pixel)
  • Multi-resolution estimation, iterative refinement
  • Feature matching
  • A point does not move like its neighbors
  • Motion segmentation
  • J. Wang and E. Adelson, Representing Moving Images with Layers, IEEE Transactions
  • n Image Processing, 1994

Source: L. Lazebnik

slide-29
SLIDE 29

Fixing the errors in Lucas-Kanade

  • The motion is large (larger than a pixel)
  • Multi-resolution estimation, iterative refinement
  • Feature matching
  • A point does not move like its neighbors
  • Motion segmentation
  • Brightness constancy does not hold
  • Feature matching

Source: L. Lazebnik