From the course: Fundamentals of Dynamic Programming

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Using dynamic programming to find low-energy seams

Using dynamic programming to find low-energy seams - Python Tutorial

From the course: Fundamentals of Dynamic Programming

Using dynamic programming to find low-energy seams

- [Instructor] If we have the energy for every pixel in our image, we can find the lowest energy seam in the image. A seam is a connected string of pixels going from one edge of the image to the opposite edge. Here, connected means we can go to the left or right one pixel at a time but no more. Our goal is to find a seam so that the sum of the energies across all the pixels in that seam is minimized. So why is this a hard problem? Let's consider this group of pixels. The numbers in the boxes are the energy values at that pixel. Starting at the top center pixel, where would we go next? Take a moment to think what that lowest energy seam looks like here. Knowing nothing else, it seems we should go to the lowest energy pixel we have access to, the middle right one with energy two. But if we do that, we get stuck in a high energy region of the image right afterwards. No matter what we do, our seam will have a total…

Contents