Docsity

Interactive Object Extraction using GrabCut and Iterative Graph Cuts, Study notes of Computer Science

Partial preview of the text

Download Interactive Object Extraction using GrabCut and Iterative Graph Cuts and more Study notes Computer Science in PDF only on Docsity!

ìGrabCutî ó InteractiveForeground Extraction using IteratedGraph Cuts

By Carsten Rother, Vladimir Kolmogorovand Andrew Blake at Microsoft Research

Cambridge, UKSIGGRAPH 2004

Slides by David Anthony TorresComputer Science and Engineering — University of California at San Diego

Object Extractionï^

Deal with efficient, interactive extraction of aforeground object from a complex background. ï^

Goal is to produce a ìgoodî automatic extractionwith as little user interaction as possible. ï^

Performance is measured by^!

Accurate segmentation of the object. !

Subjectively convincing extraction when faced with blur,transparency. !

Free of color bleeding in from the background.

GraphCut for a Monochrome Imageï^

User provides a trimap

T = { T

F^

, T

B^

, T

U

which

partitions the image into 3 regions: foreground,background, unknown.

T^ F

T^ U

T^ B

ï The image is an array

z

= (z

,Öz 1

N

)^

of grey

values indexed by the single index

n.

ï The segmentation of the image is an alpha-

channel, or, a series of opacity values α

,Ö, 1

N

) at each pixel with 0

n^

ï The parameter

describes the

foreground/background grey-leveldistributions. i.e. a pair of histogram of grayvalues:

h z

z

Segmentation by Energy Minimizationï An energy function

E

is defined so that its

minimum corresponds to a good segmentation.

ï This is captured by a ìGibbsî energy of the

form:

E(

, z

)^

= U

, z

)^

+ V(

, z

E(

α

, θ

, z

)^

= U

( α

, θ

, z

)^

+ V(

α

, z

)

ï^

U evaluates the fit of the opacity

α

to the data

z

!

i.e. it gives a good score (low score) if

α

looks like itís

consistent with the histogram.

ï^

V is a smoothness term which penalizes if there is toomuch disparity between neighboring pixel values.

(^

,^

,^

)^

log

(^

;^

)

n^

n

n

U

z^

h z

α θ

α

=

−

ïEdge weights are labeled with U( ) and V ( )

Min-Cut

How GrabCut adds to Graph Cutï The monochrome image model is replaced for

color by a Gaussian Mixture Model (GMM) inplace of histograms.

ï One shot min-cut solution is replaced by an

iterative procedure that alternates betweenestimation and parameter learning

ï Allow for incomplete labeling, i.e. the user

need only specify the background trimap

T

B

(and implicitly the unknown map

T

U

Adding the Color Modelï^

Each pixel

z

n^

is now in RGB color space

ï^

Color space histograms are impractical so we use aGaussian Mixture Model (GMM)^!

2 Full-covariance Gaussian mixtures with K components(K ~ 5). !

One for foreground, one for background.

ï^

Add to our model a vector

k

={ k

1

Ö k

},N^

with

k

in i^

{1 Ö K}

ï^

k^ i

assigns the pixel

z

to a unique GMM component i^

(Either from F.G. or B.G. as

α

dictates)

New Energy Modelï^

Must incorporate

k

into our model:

E

( α

, k

, θ

, z

)^

= U

( α

, k,

θ ,

z )

+ V(

α ,

z )

where

U

( α

, k,

θ ,

z ) =

∑

n

D

(α

,knn

,θ

,z

)n

ï^

D

(α

,knn

,θ

,zn

)= ñ logn

p

(z

|n^

α

,knn

,θ

) ñ log

π

(α

,knn

)

ï^

Where

π

(∑) is a set of mixture weights which satisfy the

constraint:

And now Ö the Algorithm:

Iterative Minimization ï find

k

n^

by iterating through all values 1ÖK. (K is small)

Iterative Minimizationï^

Now that

k

and

θ

are known, we can solve for the

opacity values using a minimum-cut algorithm, andreapply the min-cut until convergence. ï^

Each iteration eats away at the unknown region andcontinues to minimize the energy function.

iteration

User Editingï^

If the segmentation isimprecise, the user canconstrain pixels to theforeground/background ï^

Then we run min-cut (orthe entire procedure)again to produce a finalsegmentation.