As we write it here. What is the divergence of this?

We saw that in the previous week. What's the divergence of the normalized

gradient? Let's think for a second.

That's the curvature. This term.

Is curvature. Of what?

Of the leg lines of my image, which are kind of edges.

So we're saying. Propagate the edges inside in such a way

that the curvature doesn't go crazy. If it, if the curvature basically goes

crazy, then we're going to be paying a lot of penalty for that.

P is a parameter that says, how much penalty do we want to pay for that?

So basically, we're doing a smooth propagation of edges in such a way that

the curvature is relatively mild inside, and at the same time, we're recovering an

image that is consistent with those edges that we're propagating.

This term is to make everything even smoother and more regular, and so it has

a mathematical justification. With this term, this compete formulation

you can prove a lot of beautiful math for it and without a term, the things become

a bit more difficult and are what is called ill-posed.

They're not very well defined. So it's a technical term that we add to

make this equation actually look okay. Now, how do we solve this?

Euler-Lagrange equations. And now we have two unknowns, theta and

the image. It's exactly the same, you compute the

Euler-Lagrange, like, I is constant, you compute all the Euler-Lagrange for theta,

that gives you one equation. And then you keep theta constant and you

compute Euler-Lagrange for I that gives you the second equation.

So instead of one equation as we have before when we knew theta, you get two

equations. One that is evolving eye, the other that

is evolving feet. And you are solving both of them at the

same time. So it's like fixing one for a short time,

solving for the other, fixing the other, solving for one of them.

then you iterate. And you get this.

Copy. Partial differential equation on both I

and theta, but it is very elegant, because we can think about what we want,

and with a sign of variation of formulation that, that achieves that for

us. We want the image to be consistent with

the edges. We've assigned that.

We want the edges to continue smoothly. We know smoothness is curvature.

We design for that. We put that into an energy that penalizes

for not achieving what we want and then we compute the Euler-Lagrange and we

solve that equation. Let us see some examples.

Again we start by artificial examples, so we block these line.

So basically, this is what we get. By blocking it, and by running this

equation we'll smoothly continue it. A very nice continuation.

Similar example as we had before, we block this and we get a smooth and nice

continuation of this. We do the same here.

We block this cross and we get a smooth continuation.

Now you may ask: why did we get a smooth continuation of the bright and not the

dark? Now this is a deterministic algorithm

when you implement it, basically it chose one over the other.

There's no way for the algorithm to know which one is the one that you might want.

Here we have the famous at symbol. We block it and look.

We get not the add symbol, we get this. Now, this is examples like the chair I

show in the very beginning of this week. The computer doesn't know the @ symbol.

The computer is just looking for the minimal energy to complete.

Now the completion, the feeling that painting is beautiful is perfectly fine.

Is not the add symbol we started. But remember imaging painting is trying

to give you back something that looks okay and there's no way for the computer

to know that what you wanted is to get back the @ symbol, not in this fashion.

So you get a perfectly fine, actually this has lower energy according to the

energy that we just defined that the @ symbol and that's why it went into that

one. So perfectly fine, but without this

higher level information of the @ symbol which cannot be achieved with these type

of local algorithms for inpainting. It works nice for artificial examples.

Let's see if he works for real ones. Here, there is a nice picture of Groucho

Marx. And then we have regions that we want to

in paint. Here, we kind of see an evolution.

And this is the result. A nice recover along filling in along

those regions. Another example as we have seen before,

we have letters and we get the letters removed.

So the basic image pictures are flowing in by solving this variational

formulation. Now, those are simple examples.

And I want to conclude these examples with going back to the very beginning

when I say. We are in painting, structure, and

colors. What about kind of, the noise, the

granularity of the image? This is one way of doing that, and even

going beyond that. So you start from an image.

And these are the regions that we want to in paint.

You first take this image and decompose in two parts.

One, and I'm going to say in second how we do that.

Let me just explain the diagram first. One, it's like this was smooth.

It has no granularity. No texture at all.

And the others were all the texture has done.

Okay? Now you in paint the structure part with

the techniques I just mentioned to you. You basically continue the boundaries and

continue these flat colors inside. And you get a very beautiful

continuation. The texture, the granularity, you use a

technique that is designed to impend granularity.

We're going to explain that technique actually in the next video.

So see for example how here the texture has been very nicely continued.

Here. And then you go and add those two again.

And you get that great reconstruction that has this structure continue.

Has the colors continue. Has also the texture and the granularity

continue. Here's the structure and the colors.

Here is the texture. How do we do this decomposition?

There are a few techniques out there that follow something developed by Yves Meyer.

Just to give one example and we get this decomposition into something which is

pitch-wise smooth, so it has not a lot of oscillations and variations and something

that has all the oscillations and variations.

You in paint here with the techniques that I just showed to you.

Either the partial differential equations base one.

Or the variational one, for example. You in painted texture.

Here, the granularity was something we are going to discuss next.

Which is kind of a cut and paste type of technique.

And then you add them back. And you get a beautiful reconstruction.

And you get everything in one image. So in the next video I'm going to talk a

bit more about this type of cut and paste technique.

You actually already know it. And I'm going to remind you what it is in

the next video. I'm looking forward to to that.

Thank you very much.