Graphics Reference
In-Depth Information
(a)
(b)
(c)
(d)
Figure 3.15.
An example of graph-cut compositing. (a) Target image. (b) Source image, with user
strokes overlaid to indicate regions that must be included. (c) Graph-cut composite. (d) Region
labels used to form the composite (black pixels are from (a), white pixels are from (b)).
multi-image
photomontage
was suggested by Agarwala et al. [
7
], building off Kwatra
et al.'s framework.
The basic idea is to minimize a Gibbs energy of the form:
E
(
L
)
=
E
data
(
L
(
i
))
+
E
smoothness
(
L
(
i
)
,
L
(
j
))
(3.25)
i
∈
V
(
i
,
j
)
∈
E
is the set of all adjacent pixels
(for example, 4-neighbors), and
L
is a
labeling
; that is, an assignment in
Here,
V
is the set of pixels in the output image,
E
to
each pixel
i
. For the multi-image compositing problem, the user paints initial strokes
in each source image, signifying that pixels stroked in image
S
k
must have label
k
in
the final composite. Natural forms of the two energy terms are:
{
1,
...
,
K
}
0
if pixel
i
is stroked in
S
k
E
data
(
L
(
i
)
=
k
)
=
(3.26)
∞
if pixel
i
is stroked in some image
S
j
=
S
k
0
otherwise
E
smoothness
(
L
(
i
)
=
k
,
L
(
j
)
=
l
)
=
S
k
(
i
)
−
S
l
(
i
)
+
S
k
(
j
)
−
S
l
(
j
)
(3.27)