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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
What is content-aware image resizing?3m 26s
-
(Locked)
Preprocessing: Defining the energy of an image2m 31s
-
(Locked)
Project: Calculating the energy of an image3m 41s
-
(Locked)
Solution: Calculating the energy of an image2m 20s
-
(Locked)
Using dynamic programming to find low-energy seams3m 31s
-
(Locked)
Project: Finding low-energy seams3m 26s
-
(Locked)
Solution: Finding low-energy seams2m 42s
-
(Locked)
Project: Using backpointers to reconstruct seams3m 50s
-
(Locked)
Solution: Using backpointers to reconstruct seams3m 9s
-
(Locked)
Project: Removing low-energy seams2m 12s
-
(Locked)
Solution: Removing low-energy seams2m 13s
-
-
-