Graphics Reference
In-Depth Information
Alternately, we can write
k
A
(
i
,
k
)
if
i
=
j
L
(
i
,
j
)
=
(2.37)
−
A
(
i
,
j
)
if
i
=
j
where
1
−
µ
k
)
W
I
3
×
3
−
1
1
W
A
(
i
,
j
)
=
+
(
I
i
k
+
(
I
j
−
µ
k
)
(2.38)
k
|
(
i
,
j
)
∈
w
k
The matrix
A
specified by Equation (
2.38
) is sometimes called the
matting affinity
.
From Equation (
2.35
) we can see that minimizing
J
(
α
)
corresponds to solving the
linear system
L
α
=
0. That is, we must simply find a vector in the nullspace of
L
.
2.4.3
Constraining the Matte
However, so far we haven't taken into account any user-supplied knowledge of where
the matte values are known; without this knowledge, the solution is ambiguous; for
example, it turns out that any constant
α
matte is in the nullspace of
L
. In fact,
the dimension of the nullspace is large (e.g., each of the matrices in the sum of
Equation (
2.34
) has nullspace of dimension four [
454
]). Therefore, we rely on user
scribbles to denote known foreground and background pixels and constrain the
solution. That is, the problem becomes:
α
L
min
α
α
i
=
∈
F
(2.39)
s
.
t
.
1
i
α
i
=
∈
B
0
i
Another way to phrase this is:
α
L
α
+
λ(
α
−
α
K
)
D
min
(
α
−
α
K
)
(2.40)
where
1 vector equal to 1 at known foreground pixels and 0 everywhere
else, and
D
is a diagonal matrix whose diagonal elements are equal to 1 when a user
has specified a
α
K
is an
N
×
is set to be a very
large number (e.g., 100) so that the solution is forced to agree closely with the user's
scribbles. Setting the derivative of Equation (
2.40
) to 0 results in the sparse linear
system:
F
or
B
scribble at that pixel and 0 elsewhere.
λ
(
L
+
λ
D
)
α
=
λ
α
(2.41)
K
Levin et al. showed that if:
•
the color line model was satisfied exactly in every pixel window,
•
the image was formed by exactly applying the matting equation to some
foreground and background images,
•
the user scribbles were consistent with the ground-truth matte, and
•
ε
=
0 in Equation (
2.26
),
then the ground-truth matte will solve Equation (
2.41
). However, it's important to
realize that the user might need to experiment with scribble quantity and placement
to ensure that the solution of Equation (
2.41
) is acceptable, since the nullspace of the
left-hand sidemay be non-trivial (seemore in Section
2.4.5
). Figure
2.13
illustrates an
example of using closed-formmatting using only a few scribbles on a natural image.