Hello and welcome back. We're almost at the end of our Week 3 and

I want to conclude the technical content of this week with some brief comments

about gradients and about edges and about gradients in high dimensions basically

for color images. So, the topic of this relatively short

video is gradients. And we see here, age detection and

coloration detection because that's what they are related to for image processing.

So, the basic idea is very simple and you have learn about gradients probably in

your Calculus classes, maybe recently, maybe a long time ago.

And what I want to talk with you is about gradients.

The gradient of an image F is actually a vector.

An image is a scalar. At every point we have a value.

The gradient is actually a vector. It's the derivative of F in the x

direction, that's one coordinate of the vector and the derivative of F in the y

direction. That's the other coordinate of the

vector. We have already seen that derivatives are

very important. They actually led us to detect edges.

They led us to detect big changes in images.

We have seen that and we remember that as well from our early classes in Calculus.

If we have a step, basically, a sharp change that the derivative of that is the

delta function, so it helps you to detect those edges and with unsharp masking

[UNKNOWN] techniques will help us to enhance images that may be a blur or may

be which we just want to enhance their edges so we can observe them better.

Now, the gradient is one important derivative and one of the important

characteristics, in case you don't remember that from your earlier class,

classes, is that when you see at the certain pixel

in the image and you ask yourself, in which direction is my image changing the

most?" So, in which direction should I make a walk, a step, and I get a big jump

in the pixel values of my image? It turns out that that direction is the

gradient. So, when you're saying, for example, this

is an object., And you say, which way should I go" to

have the maximal change in my pixel value?

That is the gradient direction. This gives you the direction of the

maximal change in your image. So, it's a very, very interesting object.

How much are you changing? That's what's called the absolute value

of the gradient. So, the absolute value of the gradient of

F, that's basically the definition of the absolute value or the magnitude of a

vector. Just a square root of the square of the

derivative in the x direction and the square of the derivative in the y

direction. That's how much you're actually jumping,

how much you are changing the gray value when you advance in the gradient

direction. In any other direction, you're going to

be changing equal or less than that value.

In particular, there is one direction that you're not going to be changing at

all, and that's the direction perpendicular to the gradient.

If your moving the gradient direction, you have the highest jump.

If you move perpendicular to it, you have the lowest jump, actually zero.

That's called the lever's edge and we're going to talk much more about that in a

few weeks. So, this is the concept of gradient.

You compute the derivatives, you compute the magnitude, and you're going to get

basically, the amount of jump when you go from one pixel to just the neighbor

pixels. Now, this whole concept also exists for

vector images. So, instead of having just one image, I

have an RGB image, a polar image. Now, at every point, I have three values

and I can ask the same question, in which direction do I have the maximal change of

these three values at the same time? You could actually ask for each value

independently. You could say, in which direction does

the red changed the most, in which direction the green, in which direction

the blue, and that's very simple, very simply three gradient directions.

You're going to get three different directions sometimes, or you could say, I

want them to change at the same time. In which one of the directions I have the

biggest change as a vector? At the same time, red, green, and blue,

when I basically accumulate the change is the maximal possible change.

And that concept also exist is the concept of the gradient of factorial

images is not very hard to compute, but we're going to skip that for now, but

you're also going to get that direction and there's going to be a close formula,

like we have here, that tells you in which direction you have the maximal

change in the vector, in the whole colors.

You're going to have, once again, a direction, and once again, a maximal

value. That basically is an extension of the

concept of gradient for vector images like RGB images.

So, I wanted you to know about that concept.

I wanted you to know about the concept of gradients and the concept of vector

gradients. And what we are going to do, is in the

next video, we're going to conclude this very, very useful week that we had.

Thank you.