Hi and welcome back to the course.
So, listen, we're going to take a look at now is implementing tilt shift effects.
So many of you may not know it till till the shift affects us.
So this is to open the book here to download your images and important functions.
We actually don't.
Oh, this is probably still saw this before, but if you have too many notebooks, open call up tells
you that you can have.
You can't have more than five open.
So it tells you that you have to to me some.
So we're finished with all of these here.
So let's go ahead and terminate all the previous lessons that we were running before and close this.
So now we can run our code and load our stuff.
We don't need to live here anymore, so let's just get rid of it.
And there we go, so everything should be imported now.
There we go.
So tilt shift before I go to this good tilt shift is an effect that takes our normal standard image,
usually off like landscape of a city or top down something just that's pretty and actually makes it
look like it's a miniaturized model.
Now, how does it make it look like a miniaturized model?
It does that by sort of focusing on certain areas and then blurring certain areas, sort of like the
fake bulkier book, the photography term for lens blur.
So when you have a low aperture like an aperture of f 1.8 or 2.4, the the focal point.
Let's say you're focusing on an object or a fierce that's close.
That remains in focus because the narrow focal plane there, but everything else behind it is very blue,
Larry.
And that's a good effect as affected photographers want because it sort of looks like it looks nice,
looks high quality.
The fierce, super sharp background is blurry, so it brings a face into focus.
So that's what that's what blurring the subtle shift is the type of effect that implements this blur
in the foreground of the image and sort of lives.
Background a bit.
But it does it in a way where we kind of have basically miniaturized model look effects, which you
will see literally outputs instead of just talking about it.
Let's take a look.
The outputs, let's scroll down.
This good is fairly low because it's very well commented, but it's not that complicated.
So this is the original image here.
Whoops.
What did I do?
Sorry, but it's not sure why it's scroll all the way up to the top.
So this here this is the original image, and you can see now in the tilt tilt shift effect.
That image you can see here is much more blurred, whereas here is in focus.
So it sort of gives you the impression of that.
This is a miniature model that actually does look like that to me.
So this is a pretty cool implementation of it.
Next, we have these boats here.
This is the original image, and this is a tool shift image.
Less effective on this one because you can see this blue here and only here in focus, but nevertheless,
it's a cool effect.
So how does this work?
So let's take a look at the code.
So let's scroll up to the top.
So the court has many helper functions.
Has this generating canola?
Reducing the image has expanding.
I'm not going to go through all of these in detail.
It's very well commented.
So if you want, you can actually go through this code on your own and your one time.
It may take you about a half hour to fully understand every single thing, but it's a very good exercise
to do.
So there's this Gaussian pyramid, which takes the images and generates different levels of skilling
is to the +Y and pyramid this over here.
And then there's a blend function, which blends Le Plus Jeune pyramids by weaving them according to
the Gaussian mass.
So it's complicated, but it's actually not super complicated.
I am not going to go through this anecdote because it can get quite lengthy.
However, it's a good exercise.
The point of this lesson is to demonstrate how we can do it and not all of the background functions
that does it.
So apologies for that.
However, if you do want a more detailed explanation of this, just message me on Udemy or just of posted
in the student forum, and I'll try my best to explain it to you guys.
There's this run blend function here dysfunction administrators, the blending of the two images, according
to the mask.
And then we get the images here, which is basically contains images from the fall.
That's a pretty, pretty long function just to do something that's a bit simple.
And we have a main function which implements the outer rim basically here.
So we just give the images and the source will show the original image, play print, applying the lending.
Then we just convert the types, get the channels, run blend, which takes this here.
These inputs, the mask as well gets the outputs here.
Outliers sit here, then merges them together because we have multiple images.
Now we're moving to get the final effect and then we display the right image save.
So we save it and then we display of here.
So that's the end of this lesson, and I hope you enjoyed.
I hope you have fun implementing tools of wide open TV.
It's quite cool, and it's a very, very good exercise to read through this code in detail and understand
all of the nitty-gritty if you want to get a deeper understanding of classical computer vision techniques.
So that's it for this lesson.
Let's move on now to listen to DX, which is using the grab cuts algorithm for background removal.
Very cool.
Listen.
So I'll see you in that section.
Thank you.