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.

Project: Removing low-energy seams

Project: Removing low-energy seams - Python Tutorial

From the course: Fundamentals of Dynamic Programming

Project: Removing low-energy seams

- [instructor] The last piece of the seam carving process, is to actually remove the lowest energy seam we found. We'll do that in the file Carve.py. There are two functions that you need to implement. First step, is this remove seam from image function. You're given the original 2D grid of colors, and the X coordinates of each pixel in the seam to remove. The X coordinates are given from top to bottom. Your job is to copy over the input grid of colors, but in each row, remove the entries corresponding to the X coordinates in seam Xs. The resulting grid should be one entry, smaller in width. The second function you have to implement, is remove and lower seams from image. This is where you put everything together. You'll do the following step and times, where N is the number of seams to remove. Calculate the energy of the image, using the compute energy function you already implemented before. Then find the lowest energy…

Contents