Graphics Reference
In-Depth Information
A
0.68
0.001
0.48
0.37
0.50
0.12
B
0.23
0.001
I(p)
0.001
0.56
0.56
0.35
n(p)
p
(a)
(b)
Figure 3.21. (a) The confidence term for patch-based inpainting. The term is high where is
convex (e.g., point A ), low where is concave (e.g., point B ), and near 0.5 where is straight.
(b) The data term for patch-based inpainting. The term is relatively high when a strong edge is
nearly perpendicular to , lower when a strong edge is nearly parallel to , and very small in
nearly-constant-intensity regions. Point p illustrates the vectors used to compute the data term.
front is computed as the average confidence of the pixels in
p :
1
W 2
(
) =
(
)
C
p
C
q
(3.33)
q
p
The data term incorporates similar reasoning as the PDE-based method; we want
to propagate intensities into the target region along isophote directions, starting
with strong edges that should continue into
. We prefer strong edges that hit the
boundary
head-on (i.e., at a right angle) as opposed to a strong edge tangent to the
boundary. Thus the data term for an image with intensities in
[
0, 1
]
is computed as:
I
D
(
p
) =∇
I
(
p
)
(
p
) ·
n
(
p
)
(3.34)
I
where n
is the unit vector per-
pendicular to the gradient defined in Equation ( 3.29 ). Thus, the data term at a pixel
increases with the strength of the image gradient and with its alignment to the tan-
gent of the fill front. Figure 3.21 b illustrates the vectors in Equation ( 3.34 ) and some
values of the data term for an example I and
(
p
)
is a unit vector orthogonal to
at p and
(
p
)
.
p on the fill front with the highest priority, we form
a patch around it and find its best match in the source region, defined simply as
the patch with the minimum Euclidean distance (measured in color space). The
distance is only computed over the region of the patch containing known pixels —
i.e.,
After we compute the pixel
ˆ
. The corresponding pixel colors from the resulting “exemplar” patch
are simply pasted into the target region
p (
I
)
.
Finally, the confidence values for the newly copied pixels are all assigned to be
p
( ˆ
C
, so that as we work toward the interior of the target region, the confidences get
lower and lower. The algorithm stops when all the target pixels have been filled in.
p
)
Search WWH ::




Custom Search