
Graphs and Images 197
p
i-1,j+1
p
i-1,j
p
i-1,j-1
p
i,j+1
p
i,j
p
i,j-1
p
i-1,j
p
i-1,j-1
p
i,j+1
p
i,j-1
(a)
p
i-1,j+1
p
i-1,j
p
i-1,j-1
p
i,j+1
p
i,j
p
i,j-1
p
i-1,j
p
i-1,j-1
p
i,j+1
p
i,j-1
(b)
p
i-1,j+1
p
i-1,j
p
i-1,j-1
p
i,j+1
p
i,j
p
i,j-1
p
i-1,j
p
i-1,j-1
p
i,j+1
p
i,j-1
(c)
Figure 12.14: The three possible vertical seam steps for pixel p
i,j
= I(i, j)
(top). Calculating the step costs using forward energy (bottom). After
removing the seam, new neighbors (in gray) and new pixel edges (in red)
are created. In each case the cost is defined by the forward difference
in the newly created pixel edges. Note that the edge between the new
neighbors in row i − 1 is accounted for in ...