Graphics Reference
In-Depth Information
I
I'
Figure 3.34. An original image I and a proposed retargeted image I . Most patches from I are
present in I , indicating a high degree of completeness. Conversely, I doesn't contain patches
that don't appear in I , indicating a high degree of coherence. The retargeted image can remain
complete and coherent while removing large chunks of repetitive texture, which is difficult to do
with seam carving.
On the other hand, the contribution of j to the first terminEquation ( 3.40 ) is harder
to determine, since we don't know howmany patches from I (if any) include j in their
best-match patches. If we assume that N j patches in I include j in their best-match
patch in I , and let the pixels in I corresponding to pixel j in each of these patches be
i 1 ,
, i N j , then the first term in Equation ( 3.40 ) corresponding to pixel j is:
...
N j
1
N
i k )
I (
2
1
I
(
j
)
(3.42)
k
=
Therefore, the overall contribution from pixel j to the cost function in
Equation ( 3.40 ) is the sum of Equation ( 3.41 ) and Equation ( 3.42 ). Since we want
to determine the best value of the color I (
j
)
, we take the derivative of this sum and
set it equal to zero, obtaining
N
N W 2
N j
k
1
i k ) +
1
1 I
(
1 I
(
i k )
k
=
I (
=
j
) =
(3.43)
N j
N +
W 2
N
This suggests a simple iterative algorithm, repeated until the retargeted image stops
changing:
in I , find the most similar patch in I to find the pixel colors
for Equation ( 3.41 ).
2. For each patch
1. For each patch
in I , find the most similar patch in I to find the pixel colors
for Equation ( 3.42 ).
3. Update the image I using Equation ( 3.43 ).
A scaled version of the original image is a good choice for initializing the process if
the retargeted dimensions are not too different than the original dimensions; other-
wise, the desired dimension can be reached using several steps in which the relative
 
Search WWH ::




Custom Search