Ii = αi*Fi + (1-αi)*Bi,

where Ii, αi, Fi, Bi, respectively represents to the the composite value, the matte value, the foreground value, the back ground value of pixel i.All variable on the right of the matting equation are unknown. Hence the problem is under-constrained. So a rough segmentation of foreground and background is required to extract a good matte. This segmentation can be in form of trimap or scribbles.The close form solution is a scribble based matting algorithm. It makes two assumptions:

(1) F and B are locally smooth over a small window.

(2) Each of F and B is a linear mixture of two colors in a small window.

αi = a*Ii + b ∀i∈w, where w is a small window

a = 1/F-B

b = -B/F-B

,where w is a small window. A 3X3 window is adopted to enable propagation of the information between neighbouring pixels. The cost function is quadratic in α, a and b, with 3N unknowns for an image with N pixels. However, a and b may be eliminated , leaving us with a quadratic cost in only N unknown alpha values of the pixels: J (α) = α’ L α, where a’ is the transpose of α where L is an N × N matrix, whose (i, j)-th entry is:

For color images we replace the linear model with a 4D linear model assuming that for a small window each of F and B is a linear combination of two colors. With 4D linear model the cost function is define as:

The equation for Matting Laplacian in color line model becomes:

The cost function can be optimized by solving a sparse linear system:

The algorithm is detailed below for solving Ax = b where A is a real, symmetric, positive-definite matrix. The input vector x0 can be an approximate initial solution or 0. In our project, A=(L+lambda*D) and B = lambda*D*beta

Second Result is a picture of a pineapple. Since it’s texture is similar to the back ground, we can find the scibbles in the first picture sets aren’t enough. The pixels in the upper left side cannot be distinguished properly. Then, we add some scibbles in the second picture sets to make the result better.

Third Result is a picture of a plant. The leaves of the plant have a lot of boundaries along with the background. Because that the color is so different between them, the result is still good.

[2] He, Kaiming, Jian Sun, and Xiaoou Tang. "Fast matting using large kernel matting laplacian matrices." Computer Vision and Pattern Recognition (CVPR), 2010 IEEE Conference on. IEEE, 2010.

[3] http://www.alphamatting.com

Members:

R01921055 王士銘

R01943092 林奕憲

R01921055 王士銘

R01943092 林奕憲