msu fall 20141 computing motion from images chapter 9 of s&s plus otherwork

68
MSU Fall 2014 1 Computing Motion from Images Chapter 9 of S&S plus otherwork.

Upload: elfrieda-watkins

Post on 23-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 1

Computing Motion from Images

Chapter 9 of S&S plus otherwork.

Page 2: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 2

General topics

Low level change detection Region tracking or matching over

time Interpretation of motion MPEG compression Interpretation of scene changes in

video Understanding human activites

Page 3: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 3

Motion important to human vision

Page 4: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 4

What’s moving: different cases

Page 5: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 5

Image subtraction

Simple method to remove unchanging background from

moving regions.

Page 6: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 6

Change detection for surveillance

Page 7: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 7

Change detection by image subtraction

Page 8: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Closing = dilation+erosion

MSU Fall 2014 8

http://homepages.inf.ed.ac.uk/rbf/HIPR2/close.htm

Page 9: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 9

What to do with regions of change?

Discard small regions Discard regions of non interesting

features Keep track of regions with

interesting features Track in future frames from motion

plus component features

Page 10: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 10

Some effects of camera motion that can cause problems

Page 11: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 11

Motion field

Page 12: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 12

FOE and FOC

Will return to use the FOE or FOC or detection of panning to determine what the camera is doing in video tapes.

Page 13: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 13

Gaming using a camera to recognize the player’s motion

Decathlete game

Page 14: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 14

Decathlete game

Cheap camera replaces usual mouse for input

Running speed and jumping of the avatar is controlled by detected motion of the player’s hands.

Page 15: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 15

Motion detection input device

Running (hands)Jumping (hands)

Page 16: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 16

Motion analysis controls hurdling event (console)

• Top left shows video frame of player

• Middle left shows motion vectors from multiple frames

• Center shows jumping patterns

Page 17: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 17

Related work

Motion sensed by crude cameras Person dances/gestures in space Kinect/Leap motion sensors System maps movement into

music Creative environment? Good exercise room?

Page 18: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 18

Computing motion vectors from corresponding “points”

High energy neighborhoods are used to define points for

matching

Page 19: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 19

Match points between frames

Such large motions are unusual. Most systems track small motions.

Page 20: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 20

Requirements for interest points

Match small neighborhood to small neighborhood. The previous “scene” contains several highly textured neighborhoods.

Page 21: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 21

Interest = minimum directional variance

Used by Hans Moravec in his robot stereo vision system.

Interest points were used for stereo matching.

Page 22: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 22

Detecting interest points in I1

Page 23: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 23

Match points from I1 in I2

Page 24: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 24

Search for best match of point P1 in nearby window of I2

For both motion and stereo, we have some constraints on where to search for a matching interest point.

Page 25: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 25

Motion vectors clustered to show 3 coherent regions

All motion vectors are clustered into 3 groups of similar vectors showing motion of 3 independent objects. (Dina Eldin)

Motion coherence: points of same object tend to move in the same way

Page 26: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 26

Two frames of aerial imagery

Video frame N and N+1 shows slight movement: most pixels are same, just in different locations.

Page 27: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 27

Can code frame N+d with displacments relative to frame N

for each 16 x 16 block in the 2nd image

find a closely matching block in the 1st image

replace the 16x16 intensities by the location in the 1st image (dX, dY)

256 bytes replaced by 2 bytes! (If blocks differ too much, encode

the differences to be added.)

Page 28: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 28

Frame approximation

Left is original video frame N+1. Right is set of best image blocks taken from frame N. (Work of Dina Eldin)

Page 29: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 29

Best matching blocks between video frames N+1 to N (motion vectors)

The bulk of the vectors show the true motion of the airplane taking the pictures. The long vectors are incorrect motion vectors, but they do work well for compression of image I2!

Best matches from 2nd to first image shown as vectors overlaid on the 2nd image. (Work by Dina Eldin.)

Page 30: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 30

Motion coherence provides redundancy for compression

MPEG “motion compensation” represents motion of 16x16 pixels blocks, NOT objects

Page 31: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 31

MPEG represents blocks that move by the motion vector

Page 32: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 32

MPEG has ‘I’, ‘P’, and ‘B’ frames

Page 33: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 33

Computing Image Flow

Page 34: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 34

Page 35: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Motion Field & Optical Flow Field

Motion Field = Real world 3D motion

Optical Flow Field = Projection of the motion field onto the 2d image

3D motion vector

2D optical flow vector

vu,u

CCD

Slides from Lihi Zelnik-Manor

Page 36: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 36

Assumptions

Page 37: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

When does it break?

The screen is stationary yet displays motion

Homogeneous objects generate zero optical flow.

Fixed sphere. Changing light source.

Non-rigid texture motion

Slides from Lihi Zelnik-Manor

Page 38: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 38

Image flow equation 1 of 2

Page 39: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 39

Image flow equation 2 of 2

Page 40: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Estimating Optical Flow Assume the image intensity is

constant

tyxI ,, dttdyydxxI ,,

ITime = t Time = t+dt

dyydxx ,

yx,

Slides from Lihi Zelnik-Manor

MSU Fall 2014 40

Page 41: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Brightness Constancy Equation dttdyydxxItyxI ,,,,

dttI

dyyI

dxxI

tyxI

,,

First order Taylor Expansion

0 dtIdyIdxI tyx

Simplify notations:

Divide by dt and denote:

dtdx

u dtdy

v

tyx IvIuI Problem I: One equation, two unknowns

Slides from Lihi Zelnik-Manor MSU Fall 2014 41

Page 42: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Time t+dt

Problem II: “The Aperture Problem”

Time t

?Time t+dt

Where did the yellow point move to?

We need additional constraints

For points on a line of fixed intensity we can only recover the normal flow

Slides from Lihi Zelnik-Manor

MSU Fall 2014 42

Page 43: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Use Local InformationSometimes enlarging the aperture can help

Slides from Lihi Zelnik-Manor

MSU Fall 2014 43

Page 44: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Local smoothnessLucas Kanade (1984)

Assume constant (u,v) in small neighborhood

tyx IvIuI tyx Iv

uII

2

1

22

11

t

t

yx

yx

I

I

v

uII

II

bA u

Slides from Lihi Zelnik-Manor

MSU Fall 2014 44

Page 45: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Lucas Kanade (1984)

bA u

bAAA TT 1u

Goal: Minimize2u bA

bAAA TT u

2x2 2x1 2x1

Method: Least-Squares

Slides from Lihi Zelnik-Manor

MSU Fall 2014 45

Page 46: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Lucas-Kanade Solution

2

2

yyx

yxxT

III

IIIAA

We want this matrix to be invertible.i.e., no zero eigenvalues

bAAA TT 1u

Slides from Lihi Zelnik-Manor

MSU Fall 2014 46

Page 47: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Break-downs Brightness constancy is not satisfied

A point does not move like its neighbors what is the ideal window size?

The motion is not small (Taylor expansion doesn’t hold)

Correlation based methods

Regularization based methods

Use multi-scale estimation

Slides from Lihi Zelnik-Manor

MSU Fall 2014 47

Page 48: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

Multi-Scale Flow Estimation

image It-1 image I

Gaussian pyramid of image It Gaussian pyramid of image It+1

image It+1image Itu=10 pixels

u=5 pixels

u=2.5 pixels

u=1.25 pixels

Slides from Lihi Zelnik-Manor

MSU Fall 2014 48

Page 49: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 49

Tracking several objects

Use assumptions of physics to compute multiple smooth

paths.(work of Sethi and R. Jain)

Page 50: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 50

Page 51: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 51

Tracking in images over time

Page 52: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 52

General constraints from physics

Page 53: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 53

Other possible constraints

Background statistics stable Object color/texture/shape might

change slowly over frames Might have knowledge of objects

under survielance Objects appear/disappear at

boundary of the frame

Page 54: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 54

Page 55: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 55

Sethi-Jain algorithm

Page 56: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 56

Page 57: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 57

Total smoothness of m paths

Page 58: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 58

Greedy exchange algorithm

Page 59: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 59

Example data structure

Total smoothness for trajectories of Figure 9.14

Page 60: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 60

Example of domain specific tracking (Vera Bakic)

Tracking eyes and nose of PC user. System presents menu (top). User moves face to position cursor to a particular box (choice). System tracks face movement and moves cursor accordingly: user gets into feedback-control loop.

Page 61: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 61

Segmentation of videos/movies

Segment into scenes, shots, specific actions, etc.

Page 62: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 62

Types of changes in videos

Page 63: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 63

Anchor person scene at left

Street scene for news story

Scene break

From Zhang et al 1993

How do we compute the scene change?

Page 64: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 64

Histograms of frames across the scene change

Histograms at left are from anchor person frames, while histogram at bottom right is from the street frame.

Page 65: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 66

American sign language example

Page 66: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 67

Example from Yang and Ahuja

Page 67: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 68

Page 68: MSU Fall 20141 Computing Motion from Images Chapter 9 of S&S plus otherwork

MSU Fall 2014 69