Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are...

27
Image Matting – Review of Anat Levin et al.’s Algorithms Jan Kotera, 2013

Transcript of Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are...

Page 1: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Image Matting – Review of Anat Levin et al.’s Algorithms

Jan Kotera, 2013

Page 2: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Source

• A Closed-Form Solution to Natural Image Matting (Levin et al., PAMI 2008)

• Spectral Matting (Levin et al., PAMI 2008)

Page 3: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Image matting – model and objective

= soft background-foreground separation

Page 4: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Image matting – model and objective

User input

or

Page 5: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – model (grayscale)

Compositing equation:

Constant color assumption:

Cost function (model term):

Page 6: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – model (grayscale)

Simplification:

Page 7: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – model (grayscale)

Proof:

Page 8: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – model (color)

“Color line model”:

Then

In each neighborhood w.

Page 9: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – model (color)

Model term:

Simplification:

Page 10: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – full cost function

Including user input:

Solution:

Page 11: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – further user input

Two other “brush types”:

• Color-key brush

• Constant-color brush

Page 12: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – optimization

• Direct linear solver (small images)

• Multiscale (downsample, upsample α, solve only for “undecided” pixels)

• Multigrid solver (fast, worse quality)

Page 13: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – image separation

F and B are recovered by solving

Page 14: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – results

Page 15: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – results

Page 16: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 1 – results

Page 17: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 - introduction

(Normalized) graph cuts for segmentation:

Simple case – one connected component:

= 0-eigenvector of L=(D-A)

Page 18: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – introduction

Generalized compositing equation:

Matting Laplacian:

where

Page 19: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – Laplacian nullspace

General idea: matting components are 0-eigenvectors of L, if every image window w satisfies the following model (one of the conditions)

Page 20: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – computation

Matting components are linear combination of the smallest eigenvectors:

“Final” model:

= smallest eigenvectors of L

For some

min

- Solved using Newton’s method (series of second-order approximations)

- Initialized by , where are results of pixel k-means clustering

Page 21: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – smallest eigenvectors

Page 22: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – matting components

Page 23: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – combining components

Final matting = combination of “foreground” components:

Matting quality score:

Precomputed as:

Page 24: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – unsupervised matting

Page 25: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – user input

Matting energy expressed in pairwise terms:

If k-th component is marked is foreground

If k-th component is marked is background

Otherwise

where

and

- Solved using graph min-cut method - Constraints are specified as scribbles or component labeling

Page 26: Image Matting Review of Anat - CASzoi.utia.cas.cz/files/seminar_2013.pdf · Matting components are linear combination of the smallest eigenvectors: “Final” model: = smallest eigenvectors

Algorithm 2 – results