matting
Download
Skip this Video
Download Presentation
Matting

Loading in 2 Seconds...

play fullscreen
1 / 86

Matting - PowerPoint PPT Presentation


  • 159 Views
  • Uploaded on

Matting. Roey Izkovsky Yuval Kaminka. Helping Superman fly since 1978. Outline. The matting problem Previous work New approaches: The iterative approach Jue Wang, Michael F.Cohen Closed form solution Anat Levin, Dani Lischinski,Yair Weiss Comparison and summary Bonus?. Outline.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Matting' - fairfax


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
matting

Matting

Roey Izkovsky

Yuval Kaminka

Helping Superman fly since 1978

outline
Outline
  • The matting problem
  • Previous work
  • New approaches:
    • The iterative approach Jue Wang,Michael F.Cohen
    • Closed form solutionAnat Levin, Dani Lischinski,Yair Weiss
  • Comparison and summary
  • Bonus?
outline1
Outline
  • The matting problem
  • Previous work
  • New approaches:
    • The iterative approach Jue Wang,Michael F.Cohen
    • Closed form solutionAnat Levin, Dani Lischinski,Yair Weiss
  • Comparison and summary
  • Bonus?
the matting problem motivation
The matting problem - Motivation

 Image and video editing

New background

Composite image

the matting problem motivation1
The matting problem - Motivation

 Image and video editing

Input image

New image

the matting problem
The matting problem
  • The separation of an image I into
    • Foreground object image F
    • Background image B
    • Alpha matte α – the opacity
  • Problem: extract F, B, α from image

hair

fur

why is matting challenging
Why is matting challenging?
  • Under constrained problem:One equation, 3 unknowns

 We need to constrain the problem!

outline2
Outline
  • The matting problem
  • Previous work
  • New approaches:
    • The iterative approach Jue Wang,Michael F.Cohen
    • Closed form solutionAnat Levin, Dani Lischinski,Yair Weiss
  • Comparison and summary
  • Bonus?
previous work
Previous work

Two types:

Known background Natural image

matting matting

known background
Known Background
  • Blue screen Matting
  • Still under-constrained
    • Solution: make more assumptions
      • “Foreground contains no blue”
      • Other foreground distribution assumption…
  • Use two different backgrounds
  • Main flaw: need to know the background…

Blue background

Composite image

natural image matting
Natural Image Matting
  • The assumptions:
    • Smoothness of the alpha matte
    • GMM for the Background and Foreground colors
  • Initial estimate:trimap provided by the user

Background

Foreground

Unknown

Input image

Trimap

natural image matting1
Natural Image Matting
  • The algorithms framework:
    • Estimate F, B distributions from close pixels
    • Find best α by some method
knockout
Knockout
  • Extrapolate F,B from close neighborhood
  • Estimate α from calculated F, B values
bayesian
Bayesian
  • Estimate F, B distributions in area
  • Find best α matching distributions
bayesian1
Bayesian
  • P(F), P(B) from image samples
  • P(C|F,B,α) using a distribution for C
natural image matting2
Natural Image Matting
  • Main flaw: Accurate trimap required
      • Tedious to provide manually
  • Hard to extract automatically

 In particular, not feasible to videos

Input image

Trimap

Binary segmentation

Adding unknown region

outline3
Outline
  • The matting problem
  • Previous work
  • New approaches:
    • The iterative approach Jue Wang,Michael F.Cohen
    • Closed form solutionAnat Levin, Dani Lischinski,Yair Weiss
  • Comparison and summary
  • Bonus?
new approach to matting
New Approach to Matting

Trimap reduces to scribbles

Two new methods

  • Iterative optimization approach
    • Heuristic algorithmic optimization
  • A closed form solution
    • Mathematical approach

Trimap

Scribbles

iterative optimization approach

Iterative optimization approach

Jue Wang

Michael F. Cohen

iterative approach1
Iterative approach
  • Score:

fit to image data +alpha matte smoothness

  • Iteratively propagating estimated results.
iterative optimization outline
Iterative optimization - outline
  • Initialize “work pixels” from scribbles
  • Repeatedly:
    • Expand work pixels
    • Find best alpha matte
  • Stop when finished
initialization

Uc = {user scribbles}

ui = 0

α = 0

ui = 0

α = 1

ui = 1

α = 0.5

Initialization
  • Introducing:
    • ui - uncertainty variable
    • Uc – work pixels
optimization
Optimization

Uc = {user scribbles + 15 pixel radius}

Our goal:

find α matte for Uc that minimizes the energy -

Smoothness

Data

slide26

N Possible values for F

N Possible values for B

Vd

Score for αp = α

Image color Ip

slide27
Vd
  • Fit measure of αp to Ip
  • Score for αp = α :

Fi , Bj – possible values for F, B in the pixel

wFi, wBj – corresponding weights

slide28

α = 0.4

u = 0.5

α = 0.8

u = 0.3

α = 0.4

u = 0.4

α = 0.2

u = 0.3

α = 0.9

u = 0.2

α = 0.3

u = 0.3

Vd

Fi , Bj – possible values for F, B in the pixel

wFi, wBj – corresponding weights

F Samples

B Samples

What happens when there are not enough F/B samples?

p

α = 0.5

u = 1.0

slide29
Vd
  • Score for αp = α :
  • Discretize
  • and normalize
slide30
Vs
  • Matte smoothness :
iterative optimization step 2
Iterative optimization – step 2

Uc = {user scribbles + 15 pixel radius}

Our goal: find α matte for Uc that minimizes the energy -

Uc Graph

Nodes = Pixels, Edges by 4-connectivity

iterative optimization step 21
Iterative optimization – step 2

GOAL: Minimize

BELIEF PROPAGATION

iterative optimization step 22
Iterative optimization – step 2

GOAL: Minimize

BELIEF PROPAGATION

t=0

y

mpq – message from p to q

q

p

Vector: p’s “opinion” for each

possible α for q

iterative optimization step 23
Iterative optimization – step 2

GOAL: Minimize

BELIEF PROPAGATION

t=1

y

mpq – new message pq

myp – previous message yp

q

p

iterative optimization step 24
Iterative optimization – step 2

GOAL: Minimize

BELIEF PROPAGATION

t=2,3,4…

y

q

p

iterative optimization step 25
Iterative optimization – step 2

GOAL: Minimize

BELIEF PROPAGATION

t=T (stopping time)

y

q

p

iterative optimization step 26
Iterative optimization – step 2

GOAL: Minimize

BELIEF PROPAGATION

t=T (stopping time)

y

q

p

Best state calculated for each node:

iterative optimization step 3
Iterative optimization – step 3

Found α matte for Uc that minimizes the energy -

Update F, B and uncertainty:

iterative optimization algorithm
Iterative optimization - algorithm
  • Initialize Uc, F, B, u and alpha matte from scribbles
  • Repeatedly:
    • Expand Uc by another 15 pixel radius
    • Find best alpha matte (BP)
    • Update F,B,u for new matte
  • Stop when total uncertainty is minimal

Initial matte

Propagation of α matte

Final matte

iterative optimization results
Iterative optimization - Results

Input image

Extracted matte

iterative optimization results1
Iterative optimization - Results

Input image

Composite image

Extracted matte

iterative optimization results3
Iterative optimization - Results

Scribbles result

Trimap result

Ambiguity bunny with trimap

Ambiguity bunny with scribbles

iterative optimization summary
Iterative optimization - Summary
  • Minimal user input
  • Applicable to video
  • Sensitive to ambiguity in F, B
  • Uses simple color-model
  • Performance:
    • 15-20 min. on a 640x480 image
    • Factor 50 reported by better implementation
outline4
Outline
  • The matting problem
  • Previous work
  • New approaches:
    • The iterative approach Jue Wang,Michael F.Cohen
    • Closed form solutionAnat Levin, Dani Lischinski,Yair Weiss
  • Comparison and summary
  • Bonus?
closed form solution

Closed form solution

Anat Levin

Dani Lischinski

Yair Weiss

closed form solution1
Closed form solution
  • Assumption: local smoothness in F, B

 cancel out unknowns from the matte equs.

  • Solve for F,B and alphausing algebraic tricks.
closed form solution2
Closed form solution

Assumptions:

  • F,B locally smooth.

 treat F,B as constant in a small window w

closed form solution3
Closed form solution

GOAL:

Minimize -

  • Numerical stability
  • Bias to smoother matte

wj

closed form solution4
Closed form solution
  • GOAL:
    • Minimize:
closed form solution5
Closed form solution
  • Minimize:

3N Variables (N = image size) We can rid a, b by algebraic manipulation

closed form solution6
Closed form solution
  • Minimize:

Theorem: for we have

Intuitively, L is some covariance matrix

closed form solution7
Closed form solution
  • Minimize:

Proof: Rewrite in matrix form:

closed form solution8
Closed form solution
  • Minimize:

Proof: Rewrite in matrix form:

By mean-least-squares, best a,b pair

for each window is:

closed form solution9
Closed form solution
  • Some more manipulation give the required result

EXCITED?

GET YOUR I LOVE MATH

T-SHIRT, NOW FOR ONLY $1999

closed form solution10

R

F2

F1

G

Closed form solution
  • For color images:
    • Simple: Do each channel separately
    • Smart: Assume one alpha for R,G,B.Use redundancy to allow a “color-line” model per window

Color line model:

OUT: F, B Constant within a window

IN: F, B are on some line

closed form solution11
Closed form solution
  • For color images:
    • Simple: Do each channel separately
    • Smart: Assume one alpha for R,G,B.Use redundancy to allow a “color-line” model per window
closed form solution12
Closed form solution
  • For color images:
    • Simple: Do each channel separately
    • Smart: Assume one alpha for R,G,B.Use redundancy to allow a “color-line” model per window

Now, as before, cost is:

And a,b can be cancelled out.

closed form solution13
Closed form solution

Now problem reduced to finding best α for:

L is Huge size NxN (N = # image pixels)

But Sparse…

closed form solution14
Closed form solution
  • The algorithm:
    • Compute L
    • Solve for given the scribbles.
      • Solving a sparse set of bilinear equationswith constraints (Lagrange multipliers)
    • Find F, B given the matte
      • Adding smoothness assumptions on F, B
  • Improvements:
    • Use larger environment in low cost by “pyramids”
closed form solution results
Closed form solution - Results

Extracted matte

Input image

closed form solution results1
Closed form solution - Results

Input image with scribbles

Problematic matte

eigenvectors as guides
Eigenvectors as guides

Small eigenvectors of L are

correlated with minimal matte

L is positive definite.

Eigenbasis: v1,…,vN

Eigenvalues: λ1 > λ2 > … > λN > 0

eigenvectors as guides1
Eigenvectors as guides

Small eigenvectors of L are

correlated with minimal matte

eigenvectors as guides2
Eigenvectors as guides

Small eigenvectors of L are

correlated with minimal matte

 can guide user scribbles

Eigenvectors matching smallest eigenvalues

Resulting matte

Guided scribbles

closed form solution summary
Closed form solution - Summary
  • Minimal user input
  • Provable optimality (under assumptions)
  • Assumes only smooth F,B (no color model)
  • Applicable to video (as we speak…)
  • Problematic with textures
  • Performance:
    • 20-40 seconds for a 200x300 image
    • Expensive in memory
outline5
Outline
  • The matting problem
  • Previous work
  • New approaches:
    • The iterative approach Jue Wang,Michael F.Cohen
    • Closed form solutionAnat Levin, Dani Lischinski,Yair Weiss
  • Comparison and summary
  • Bonus?
comparison
Comparison

Input image

Matte ground truth

Closed form solution

Iterative approach

Poisson

comparison1
Comparison

Color ambiguity

Iterative approach Closed form

Sensitive Sensitive

Solvable by adding more scribbles

comparison2
Comparison

Improving results…

Ambiguity bunny

Iterative approach

Bayesian

Closed form solution

comparison3
Comparison

Optimality?

Iterative approach Closed form

Provably optimal

But for the specific

(simplified) cost

Uses heuristics

to optimize

comparison4
Comparison

Textures

Iterative approach Closed form

F,B must satisfy

color-line model

Assumes only

Alpha matte smooth

comparison5
Comparison

Rough edges

Iterative approach Closed form

Input image with scribbles

Can handle rough

edges

Assumes

Alpha matte smooth

 matte results 

comparison6
Comparison

Running time

Iterative approach Closed form

20/40 seconds

Costly in memory

~20 sec.

(For medium size image)

comparison7
Comparison

Tests

Iterative approach Closed form

Extensively tested

quantitative results

No quantitative

results reported

outline6
Outline
  • The matting problem
  • Previous work
  • New approaches:
    • The iterative approach Jue Wang,Michael F.Cohen
    • Closed form solutionAnat Levin, Dani Lischinski,Yair Weiss
  • Comparison and summary
  • Bonus?
slide80

Environment Matting and Compositing

Douglas E. Zongker ~ Dawn M. Werner ~ Brian Curless ~ David H. Salsin

environment matting
Environment Matting

C = F + (1- a)B + F

  • F ~ Contribution of light from Environment that travels through the object

R – reflectance image

T – Texture image

environment matting1
Environment Matting?

Alpha Matte Environment Matte Photograph

environment mattin
Environment Mattin

Alpha Matte Environment Matte Photograph

summary
Summary
  • The matting problem
  • Old methods: require trimap
  • Two new methods from scribbles:
    • Iterative optimization
      • Assume: matte smooth, F,B locally similar
      • Use heuristic optimization for alpha
    • Close form solution
      • Assume: F, B locally smooth (color-line model)
      • Solve linear equations for alpha
ad