From the course: Fundamentals of Dynamic Programming

Unlock this course with a free trial

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

Preprocessing: Defining the energy of an image

Preprocessing: Defining the energy of an image - Python Tutorial

From the course: Fundamentals of Dynamic Programming

Preprocessing: Defining the energy of an image

- [Instructor] The energy at a certain pixel in an image is a numerical value that captures how much the image is changing around that pixel. In this way, we can say areas of an image with high energy values are interesting and areas with low energy values are uninteresting. For example, let's take a pixel and the two surrounding pixels on the left and right. If the color changes significantly between these pixels, then the difference between these pixels is large. In contrast, if the surrounding pixels have a color similar to the middle one, the difference is small. To formally define the energy at a pixel we have to look around that pixel both horizontally and vertically. Let's start with the horizontal direction. We'll assume the pixel colors are represented using red, green and blue components. As is typical in computing, then we take the difference of the red values, square it. The difference of the green values…

Contents