Graphics Reference
In-Depth Information
This gradient is typically taken in the intensity channel of the image. If the foreground
and background are relatively smooth compared to
α
, then the first term dominates
the other two and we can make the approximation
1
α
B
I
(2.79)
F
That is, the matte gradient is proportional to the image gradient. Interpreted as
a continuous problem, this gives a differential equation for
α
inside the unknown
region
U
with boundary conditions on
∂U
given by the known values of
α
in the
foreground and background regions. That is, we want to minimize
α(
2
I
(
x , y
)
)
x , y
dx dy
(2.80)
F
(
x , y
)
B
(
x , y
)
) U
(
x , y
subject to the constraint
1
(
x , y
) F
α(
x , y
)
on
∂U =
(2.81)
0
(
x , y
) B
As we'll discuss in Section 3.2 , minimizing Equation ( 2.80 ) turns out to be the same
as solving the Poisson equation with the same boundary conditions, i.e.,
I
2
α =
div
(2.82)
F
B
B at
the pixel. In practice, this quantity is estimated using the nearest labeled foreground
and background pixels and smoothed before solving the equation. After
The Poisson equation can be solved quickly and uniquely, if we know F
α
has been
computed, F
B can be refined using pixels that have been estimated to have very
high and very low
, and the process iterated.
This process works reasonably well when the foreground and background are both
smooth, justifying the approximation in Equation ( 2.79 ). If the matte fails in a region
where the foreground and/or background image has locally strong gradients, then
the user can try to apply further constraints and relax Equation ( 2.79 ) in just this
subregion.
α
2.8
HARD-SEGMENTATION-BASED MATTING
It's important to understand the relationship between the matting problem and
image segmentation . The key difference is that the goal of segmentation is to decom-
pose an image into disjoint pieces that fit together to form a whole. In traditional
segmentation, the edges of the pieces are hard, not fuzzy, and a segmentation can be
defined by an integer label for every pixel in the image. In the case where only two
pieces are desired, that is, foreground and background, we can label the pieces by 1
and 0 respectively and think of a segmentation as a coarse matting problem with no
fractional
values. These hard-edgedpieces are unlikely to be acceptable for generat-
ing visual effects, but several researchers have proposed methods for turning a hard
segmentation into a “soft” segmentation or matte. The most well-known of these
methods, called GrabCut, is a highly competitive user-guided matting algorithm.
α
 
Search WWH ::




Custom Search