From the course: Fundamentals of Dynamic Programming

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Project: Using backpointers to reconstruct seams

Project: Using backpointers to reconstruct seams - Python Tutorial

From the course: Fundamentals of Dynamic Programming

Project: Using backpointers to reconstruct seams

- [Narrator] We now know how to find the end of a low energy seam, but our algorithm tells us nothing about the rest of the seam. So let's use back pointers to reconstruct the entire seam. The dynamic programming table you construct it, tells you the optimal values you've computed. In each entry of the table, a back pointer represents what choice you made, to get that optimal value. Let's apply that to the seam finding algorithm. Let's say we have these pixel energies, and we're calculating the seam energies. The first row is just initialized with individual pixel energies. The first pixel in the second row comes out to be 11, and that's based on choosing to continue a seam, from the second pixel of the first row. The next three pixels in the second row, are all based on choosing to continue, the third pixel of the first row. And similarly, we fill out the third row of seam energies. While the seam energy values are…

Contents