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: Finding low-energy seams - Python Tutorial
From the course: Fundamentals of Dynamic Programming
Project: Finding low-energy seams
- [Instructor] Find the energy of the lowest energy scene ending at pixel x y. We need to look at the current pixels energy and the lowest energy seams ending in the grow above. This is the recurrence relation we'll have to implement. Because our function takes two inputs, we can rearrange the sub-problems in a grid. In fact, for this problem, the sub problems correspond exactly to the pixels and the input image. After all, there's a seam ending at every pixel. First, there's the base cases. Which correspond to all the sub problems for the top row. We can calculate these in any order. Because they don't depend on each other. A reasonable approach would be to calculate them from left to right. In the second row, our first sub problem depends on the two sub problems above it. There are only two sub problems above because we're at the left edge of the image. Each sub problem after this one depends on the two or three sub…
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
-
-
-