Automated Video Looping with Progressive Dynamism CS448V: Lecture 5 - - PDF document

automated video looping with progressive dynamism
SMART_READER_LITE
LIVE PREVIEW

Automated Video Looping with Progressive Dynamism CS448V: Lecture 5 - - PDF document

Automated Video Looping with Progressive Dynamism CS448V: Lecture 5 Background Kwatra et al. Schodl et al. Pixel-Based Looping Pixel-Based Looping 1. Per-Pixel Loops Overview 2. Finding a Video Loop 3. Progressive Video Loops Per-Pixel


slide-1
SLIDE 1

Automated Video Looping with Progressive Dynamism

CS448V: Lecture 5

Background

Schodl et al. Kwatra et al.

slide-2
SLIDE 2

Pixel-Based Looping Pixel-Based Looping

slide-3
SLIDE 3

Overview

  • 1. Per-Pixel Loops
  • 2. Finding a Video Loop
  • 3. Progressive Video Loops

Per-Pixel Loops

slide-4
SLIDE 4

Problem Statement Problem Statement

is defined by sx, px

slide-5
SLIDE 5

Problem Statement

= sx + (t - sx) mod px When t = 0, ɸ(x, t) = sx + (-sx) mod px = sx + (-sx) + px = px

Problem Statement

Loops for the entire video can be defined by: is defined by sx, px

slide-6
SLIDE 6

“Energy”: Cost of a Solution

A solution consists of: Want to minimize: Spatiotemporal consistency Penalty for choosing static loops

Spatiotemporal Consistency

slide-7
SLIDE 7

Spatial Consistency

Compatibility of adjacent pixels x, z

  • ver loop

Spatial Consistency

pixel z pixel x t

slide-8
SLIDE 8

Spatial Consistency

pixel z pixel x t sz sx p = 1

Spatial Consistency

pixel z pixel x t sz sx p = 1

slide-9
SLIDE 9

Spatial Consistency

pixel z pixel x t sz sx p = 2 sx + 1 sz + 1

Spatial Consistency

pixel z pixel x t sz sx pz = 2 px = 1 T = 2

slide-10
SLIDE 10

Spatial Consistency

pixel z pixel x t sz sx pz = 2 px = 1 T = 2

Spatial Consistency

pixel z pixel x t sz sx pz = 2 px = 1 T = 2

slide-11
SLIDE 11

Spatial Consistency

pixel z pixel x t sz sx pz = 2 px = 1 T = 2

Temporal Consistency

pixel x t sx px = 3

slide-12
SLIDE 12

A solution consists of: Spatiotemporal consistency Penalty for choosing static loops

Static Loop Penalty

Constant penalty for assigning a pixel as static 𝞭static Scale Factor

slide-13
SLIDE 13

Attenuating Static Cost

If original pixel had LOW variance, a static loop is more acceptable If original pixel had HIGH variance, a static loop is LESS natural

Attenuating Static Penalty

pixel x t

Gaussian weighted neighborhood

𝞭static Measure of temporal variation

Median Absolute Deviation

slide-14
SLIDE 14

Attenuating Spatiotemporal Consistency Cost

If original pixel had HIGH variance, a loop with high variance is LESS perceptible If original pixel had LOW variance, a loop with high variance is MORE perceptible

Attenuating Spatiotemporal Consistency Cost

If spatial variance is high, 𝞭s should be small. If temporal variance is high, 𝞭t should be small.

slide-15
SLIDE 15

Attenuating Spatial Consistency Cost

pixel x t pixel z Measure of spatial variance If spatial variance is high, 𝞭s should be small.

Attenuating Temporal Consistency Cost

Measure of temporal variance pixel x t If temporal variance is high, 𝞭t should be small.

slide-16
SLIDE 16

Optimization: Solving for s = { sx } and p = { px }

High-Level Goal

Each node is a pixel Want to assign each pixel a value (sx, px) where sx ∈ s , px ∈ p Such that the “total energy” is minimized: Can formulate as Multilabel graph cut problem

slide-17
SLIDE 17

Review: Binary Graph Cut

  • Each node: a pixel
  • Goal: Partition nodes into two

groups

  • Want to minimize:

○ Energy = cost of partition ○ Could be formulated as max flow, min cut problem

  • Global minima found in polynomial

time

Image credit: http://www.csd.uwo.ca/~yuri/Presentations/ECCV06_tutorial_partI_yuri.pdf

s t

Review: Binary Graph Cut

  • Each node: a pixel
  • Goal: Partition nodes into two

groups

  • Want to minimize:

○ Energy = cost of partition ○ Could be formulated as max flow, min cut problem

  • Global minima found in

polynomial time

Image credit: http://www.csd.uwo.ca/~yuri/Presentations/ECCV06_tutorial_partI_yuri.pdf

slide-18
SLIDE 18

Multilabel Graph Cut

  • Generalization of Binary Graph Cut

(2 labels)

  • NP-hard problem (3 or more labels)
  • Alpha-expansion approximation

algorithm ○ Within factor of 2 of global minima Example: 5 labels

Multilabel Graph Cut

  • Assign each pixel a label: (sx , px)
  • From a set of candidate loops: {s} x {p}

: (s = 0, p = 1) : (s = 5, p = 2) : (s = 3, p = 8) : (s = 3, p = 7) : (s = 2, p = 1)

slide-19
SLIDE 19

Multilabel Graph Cut on the whole search space doesn’t work

Search algorithm gets stuck in local minima (green = shorter periods):

Two-stage Approach

slide-20
SLIDE 20

Two-stage Approach

Stage 1: Fix a single loop period for the entire video, and solve for the best start frames Saves computation cost for spatial consistency Output: for each period p, each pixel has an optimal start frame s

: (s = 0, p=2) : (s = 1, p = 2) : (s = 2, p = 2) : (s = 3, p = 2) : (s = 4, p = 2)

: (s = 0, p=3) : (s = 1, p = 3) : (s = 2, p = 3) : (s = 3, p = 3) : (s = 4, p = 3)

S = {0, 1, … } P = {2} S = {0, 1, … } P = {3}

slide-21
SLIDE 21

Two-stage Approach

Stage 2: Take optimal start frames from stage 1, and solve for optimal start frame + loop period for each pixel Choices for each pixel: |{p}| start frames (stage one) |{s}| start frames (p=1)

{s} | p=1 {s} | p=1 From stage one: s1 X p1 = { (0, 2), (2, 3), (2, 4), … } Choices for stage two: S1 X P1 = s1 X p1 U { (0, 1), (1, 1), (2, 1), (3, 1), … } = { (0, 2), (2, 3), (2, 4), …, (0, 1), (1, 1), (2, 1), (3, 1), … }

: (s = 0, p=2) : (s = 2, p=3) : (s = 2, p=4)

: (s = 0, p=1) : (s = 1, p=1) : (s = 2, p=1)

...

slide-22
SLIDE 22

{s} | p=1 From stage one: s2 X p2 = { (3, 2), (5, 3), (2, 4), … } Choices for stage two: S2 X P2 = s2 X p2 U { (0, 1), (1, 1), (2, 1), (3, 1), … } = { (0, 2), (2, 3), (2, 4), …, (0, 1), (1, 1), (2, 1), (3, 1), … }

: (s = 3, p=2) : (s = 5, p=3) : (s = 2, p=4)

: (s = 0, p=1) : (s = 1, p=1) : (s = 2, p=1)

... {s} | p=1

: (s = 1, p=2) : (s = 2, p=1) : (s = 4, p=3) : (s = 0, p=1) : (s = 1, p=1) : (s = 4, p=2)

slide-23
SLIDE 23

Results Results

slide-24
SLIDE 24

Results Results

slide-25
SLIDE 25

Progressive Video Loops

Example

slide-26
SLIDE 26

Pixels: either static or looping Status: each pixel has an activation threshold a (if d > a, pixel is looping)

We Want to Control Dynamism Overview

Recall C static: 1) Solve for most dynamic loop (d = 1)

a) C static to large value: 10

2) Create static loop (d = 0)

a) For each pixel, if static in most dynamic loop, leave as-is b) For rest of the pixels, solve for best static frame

3) For each pixel, find activation energy a

a) Recursive binary partition over C static, re-computing d every time

slide-27
SLIDE 27

Definition of d

Temporal Variation of Video Loop Equation to compute d for a Video Loop L

C static = 0; penalize differences between static pixel and median color value

Construct Static loop

slide-28
SLIDE 28

Recursive binary partition Recursive binary partition

slide-29
SLIDE 29

Recursive binary partition Recursive binary partition

Binary graph cut problem!

slide-30
SLIDE 30

Recursive binary partition Recursive binary partition

Bounds activation energies: If static: a > d If looping: a < d

slide-31
SLIDE 31

Recursive binary partition Recursive binary partition

slide-32
SLIDE 32

Recursive binary partition

Continue until d or C static stop changing Set activation energies a to median of remaining bounds

Ordering of progressive dynamism

Re-order which pixels start looping first

slide-33
SLIDE 33

Result

Results: Limitations

slide-34
SLIDE 34

Original Looping

slide-35
SLIDE 35

Thank you for listening!