Graphics Reference
In-Depth Information
I
1
,
,
I
j
W
}
j
1
,
j
W
where
W
is the number of pixels in the window and
{
...
and
{
α
...
,
α
}
rep-
resent the ordered list of image colors and
α
values inside window
j
. More compactly,
we can write Equation (
2.27
)as
G
j
a
j
b
j
2
N
J
(
α
,
a
,
b
)
=
−
α
(2.28)
j
j
=
1
where
's in window
j
followed by three
0's. If we suppose that the matte is known, then this vector is constant and we can
minimize Equation (
2.27
) for the individual
α
j
is a
(
W
+
3
)
×
1 vector containing the
α
{
a
j
,
b
j
}
as a standard linear system:
a
j
b
j
G
j
G
j
)
−
1
G
j
=
(
α
j
(2.29)
α
That is, the optimal
a
and
b
in eachwindow for a givenmatte
are linear functions
α
of the
values. This means we can substitute Equation (
2.29
) into Equation (
2.26
)
to get
J
(
α
)
=
min
a
,
b
J
(
α
,
a
,
b
)
(2.30)
G
j
a
j
b
j
2
N
=
min
a
,
b
−
α
(2.31)
j
j
=
1
G
j
a
j
b
j
−
α
j
2
N
=
(2.32)
j
=
1
j
N
2
G
j
G
j
)
−
1
G
j
=
G
j
(
α
−
α
(2.33)
j
j
=
1
I
(
W
+
3
)
×
(
W
+
3
)
−
N
1
α
j
G
j
G
j
)
−
1
G
j
=
G
j
(
α
j
(2.34)
j
=
=
α
L
α
(2.35)
In the last equation, we've collected all of the equations for the windows into a
singlematrix equation for the
N
N
matrix
L
is called the
matting
Laplacian
. It is symmetric, positive semidefinite, and quite sparse if the window size
is small. This matrix plays a key role in the rest of the chapter.
Working out the algebra in Equation (
2.34
), one can compute the elements of the
matting Laplacian as:
×
1 vector
α
. The
N
×
1
I
i
−
µ
k
)
W
I
3
×
3
−
1
1
W
L
(
i
,
j
)
=
δ
ij
−
+
(
k
+
(
I
j
−
µ
k
)
(2.36)
k
|
(
i
,
j
)
∈
w
k
where
k
are the mean and covariance matrix of the colors in window
k
and
δ
ij
is the Kronecker delta. Frequently, the windows are taken to be 3
µ
k
and
×
3, so
W
=
9. The
notation
k
w
k
in Equation (
2.36
) means that we only sum over the windows
k
that contain both pixels
i
and
j
; depending on the configuration of the pixels, there
could be from 0 to 6 windows in the sum (see Problem
2.11
).
|
(
i
,
j
)
∈