Graphics Reference
In-Depth Information
^
∂Ω
Ω
obj
Ω
^
∂Ω
Figure 3.12.
Contours for drag-and-drop pasting. The outer contour
∂
was roughly drawn by
the user. The inner region
obj
is produced by the GrabCut algorithm. The drag-and-drop pasting
algorithm estimates an intermediate contour
∂
ˆ
.
equation, Farbman et al. showed that the differences in typical compositing prob-
lems are imperceptible, and the fast formulation allows Poisson-type problems to be
solved in real time, allowing virtually instant compositing.
Jia et al. [
219
] proposed a variation to Poisson image editing called
drag-and-drop
pasting
, making the key observation that Poisson composites may have unappeal-
ing visual artifacts due to a user's poor choice of boundary
. Since the user is not
expected to provide a highly conformal outline for the source region, there is typically
some space between the user-provided boundary
∂
∂
and the actual object boundary,
∂
ˆ
so that an intermediate contour
can be found to produce a more visually pleas-
ing composite. The idea is to optimize
∂
ˆ
. Jia et al. observed that the less variation
along the boundary provided to the Laplace equation in Equations (
3.17
)-(
3.18
), the
smoother (lower-energy) the correcting membrane
E
would be. They proposed to
estimate
∂
ˆ
and the contour
∂
obj
produced by the GrabCut algorithm from Section
2.8.2
(Figure
3.12
). The opti-
mal contour
as a contour between the user-specified contour
∂
∂
ˆ
is estimated by alternating the following two steps, starting from the
∂
ˆ
initial estimate
=
∂
:
∂
ˆ
1. Compute
c
as the average color of
T
(
x
,
y
)
−
S
(
x
,
y
)
on
.
∂
ˆ
⊂
ˆ
2. Find the
satisfying
obj
⊂
that minimizes the average value
∂
ˆ
2
on
of
. This contour can be computed using a
shortest-closed-path algorithm based on dynamic programming.
T
(
x
,
y
)
−
S
(
x
,
y
)
−
c
Jia et al. also proposed to incorporate the object's alpha matte into the composit-
ing process by modifying the guidance vector field
(
S
x
(
x
,
y
)
,
S
y
(
x
,
y
))
, which further
mitigates visible differences between the source and target.
Lalonde et al. [
261
] observed that inmany visual effects compositing situations, the
user may not care about pasting a particular source image into a scene, but instead
wants to insert an object from a certain class (e.g., the job is to populate a clean
plate of a street with cars and pedestrians). In this case, they proposed to leverage a
library of thousands of “clip art” foreground objects, automatically providing the user
with choices that fit well with the target scene in terms of estimated lighting, camera