re-cinematography: improving the camera dynamics of casual ... › talks › gleicher › 2007 ›...

73
Re-Cinematography: Improving the Camera Dynamics of Casual Video Michael Gleicher Feng Liu Department of Computer Sciences University of Wisconsin- Madison

Upload: others

Post on 29-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Re-Cinematography:Improving the Camera Dynamics of

Casual Video

Michael Gleicher

Feng LiuDepartment of Computer Sciences

University of Wisconsin- Madison

Page 2: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Motivation:

More video doesn’t mean better video

More Video!

• Cameras everywhere

• Players everywhere

• Sharing everywhere

Page 3: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Motivation:

More video doesn’t mean better video

Good video takes effort!

Page 4: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Problem: Bad Camera Motion

No planning

No tripod

Page 5: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Problem: Bad Camera Motion

Prior Work: Image Stabilization

One part of the

problem: jitter

Helped by

Image Stabilization

Page 6: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Problem: Bad Camera Motion

Solution: Re-Cinematography

Re-Cinematography:Post-process video clips so that the camera

motions better follow the rules of good video.

Page 7: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Rubber duck races

Vail, CO, USA, 19 August, 2007

Source Footage Re-Cinematography Result

Page 8: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow
Page 9: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

What the art of cinematography tells us

about camera motion

Camera motions should be intentional

– Avoid movement if not necessary

– Move in directed ways

Re-Cinematography:Post-process video clips so that the camera

motions appear to better follow the rules.

Page 10: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Re-Cinematography Pipeline

Source

Video

Motion

Estimation

Motion

Synthesis

Image

Transform

Result

Video

Page 11: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Re-Cinematography Pipeline (1)

Source

Video

Motion

Estimation

Motion

Synthesis

Image

Transform

Result

Video

How did the camera move?

Page 12: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Re-Cinematography Pipeline (2)

Source

Video

Motion

Estimation

Motion

Synthesis

Image

Transform

Result

Video

Figure out what motion we want in the

result

Page 13: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Re-Cinematography Pipeline (3)

Source

Video

Motion

Estimation

Motion

Synthesis

Image

Transform

Result

Video

Transform the source into the result

Page 14: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Re-Cinematography Pipeline

Scene

Analysis

Motion

Analysis

Motion

Synthesis

Source

Video

Motion

Estimation

Image

Transform

Result

Video

Page 15: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Motion Synthesis Steps

Source

Video

Motion

Estimation

Motion

Synthesis

Image

Transform

Result

Video

Create

Motions

Segment

Video

Optimize

Motions

Page 16: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

3 Key Ideas

• Analyze motion estimates to break video into segments

• Use local mosaics to keyframe new camera motions

• Consider both motion and image quality to automatically

keyframe cameras

Page 17: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Background: Camera Motion Estimation and

Projective Transformations

1,

1','

hygx

feydx

hygx

cbyaxyx

1hg

fed

cba

Page 18: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Mosaicing

Source Images Base Image

All images transformed to common base image

Page 19: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

3 Key Ideas

• Analyze motion estimates to break video into segments

• Use local mosaics to keyframe new camera motions

• Consider both motion and image quality to automatically

keyframe cameras

Page 20: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Local Mosaics

Limit error and motion in each segment

Page 21: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Break videos into segments with like

motions

Move in a direction

Small movement

Zoom in or out

Bad estimation

Page 22: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Break videos into segments with like

motions

MovingStatic Bad

Page 23: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Break videos into segments with like

motions

Page 24: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

3 Key Ideas

• Analyze motion estimates to break video into segments

• Use local mosaics to keyframe new camera motions

• Consider both motion and image quality to automatically

keyframe cameras

Page 25: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Photograph the Mosaic with a virtual camera

Page 26: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Virtual camera does not have to be where

the real camera was

Source frames

shown in yellow

Result frames

shown in magenta

Page 27: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

What paths do we want?

1. Preserve the intent of the source

2. Obey the rule of cinematography:

Camera motion should be intentional

Page 28: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

The key insight:

Translate cinematography to implementation

Motion should be intentional

• Static shots should be static

• Moving shots are goal directed

– Constant velocity with ease in/out

Page 29: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Directed Paths

Interpolate with direct constant* velocity paths

* Possibly with ease-in and out.

Page 30: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Moving the Camera

Interpolate transformations in projective space

mlerp(A,B,α) = exp( α log(A) + (1-α) log(B) )

A,B are matrices

Page 31: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Matrix logarithm interpolation of

transfomations

Page 32: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Smooth Paths Depart from Original

Source motion Result motion

Page 33: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Changing motion means transforming

frames

Source motion Result motion

Page 34: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Transforming frames might cause problems

Source frame Result frame

Page 35: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

3 Key Ideas

• Analyze motion estimates to break video into segments

• Use local mosaics to keyframe new camera motions

• Consider both motion and image quality to automatically

keyframe cameras

Page 36: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Penalties for each frane

Offscreen

Uncovered

Distortion

Page 37: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Offscreen

Page 38: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Uncovered

Page 39: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Distorted

Page 40: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Finding good motions

An optimization problem:

Or a constrained optimization problem:

Find motion M that minimizes: nonsmooth(M) +

sum image penalties

Find motion M that minimizes: nonsmooth(M)

Subject to: sum image penalties < thresh

Page 41: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Static Segments

• If initial video was nearly static

• Make it a static segment

– No camera motion

Page 42: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Keyframing Dynamic Segments

Start with direct path

Is the worst frame

penalty below

threshold?

Insert a key at worst

frame

No

Yes

Page 43: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

A contrived synthetic example to explain key

insertion

Page 44: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Try the smooth motion first

Page 45: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Insert a key at the worst point

Page 46: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Inserting keys creates velocity

discontinuities

Page 47: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Implementation

• Analyze video (slow-preprocess)– Motion estimation, salience detection

• Re-Cinematography (a few seconds for up to 2 minutes of video)– Break video into segments

– Keyframe segments

• Create result (30fps playback using graphics hardware)– Transform each frame

– In-Paint (draw frames +/- 2 seconds)

Page 48: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Examples

• Sanyo XACTI

camera

• Source footage with

image stabilization

Page 49: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Mini-Golf

Pico Mountain, VT, 2006

Source Footage Re-Cinematography Result

Page 50: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow
Page 51: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

2X Speed

Source Footage Re-Cinematography Result

Skip

Page 52: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow
Page 53: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

318 sourceLearning to run

Vail, CO, 19 August 2006

Source Video

318 2X

Page 54: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

318 source video

Page 55: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

318 resultLearning to run

Vail, CO, 19 August 2006

Re-Cinematography Result

Page 56: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

318 result video

Page 57: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

318 2X2X speed comparison

Source Footage Re-Cinematography Result

Page 58: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

318 2X video2X speed comparison

Source Footage Re-Cinematography Result

Page 59: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Sam’s First Steps, July 6th, 2006

Re-Cinematography

Result

Skip

Page 60: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

First Steps

Page 61: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Re-Cinematography “Works”

Velocity profiles meet goals

Frame number

Ma

gn

itu

de

of

ap

pa

rent velo

city Source video

Result video

Page 62: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Static segments are static

Page 63: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Moving segments have piecewise constant

velocity

Page 64: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Ease in and out

Page 65: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

But there are problems

Show source images when

motion estimation fails

Jitter from bad motion

estimation

Visual Artifacts from bad

inpainting

Page 66: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Problems

• Bad camera motion estimation

• Bad motion estimation assessment

• Bad important object detection

• Bad inpainting

• These are standard questions being explored in

Computer Vision!

Page 67: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Motion Blur• Hard for Estimation

• Wrong for Changed Motion

Page 68: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

A more interesting question:

To swing or not to swing

Source Footage Re-Cinematography Result

Page 69: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow
Page 70: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow
Page 71: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow
Page 72: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Summary

Re-cinematography changes the camera motions

in video to better follow the rules of good video

Key ideas to do this:

• Break video into local mosaics

• Animate a camera viewing the local mosaics

• Automatically keyframe the camera to optimize tradeoffs

Research supported in part by NSF grant IIS-0416284 and

the UW Graduate School Research Committee.

Page 73: Re-Cinematography: Improving the Camera Dynamics of Casual ... › Talks › Gleicher › 2007 › recin.pdf · Re-cinematography changes the camera motions in video to better follow

Because I thought you’d ask….

Answers to Common Questions

• I don’t know.

• No, we don’t introduce cuts.

• The details are in the paper, send me email if its not clear.

• Friends in industry say they can do the camera motion

estimation robustly, in real time.

• Yes, I would like to go to Oktoberfest Friday.

• Our in-painter builds a 4 second mosaic for each frame.

• 2

• Logarithms and exponenents of 3x3 matrices can be

computed robustly and efficiently with iterative methods.

• Yes, this slide is an old joke – but I haven’t used it in years.