Yes, my dear friends, in this lesson, we will learn how to resize an image.
So let's get started.
If you want to do this operation, we need to learn a new function here.
Our new function name is resource.
So let's learn about it now.
Let's move to the project folder and let's create a new Python file and let the Python file name be
resized and let press enter.
And then let's import our CV to module.
And let's move to a new line and let's create our image.
So for this, that's great and you were able here let the variable name be O-M-G and let's call or I
am read function panels, phone or I am git jpg file.
So now how can we resize our image using a new function?
So for this, what we have to do now is to create enumerable here.
Let the variable name before example resizing and let's put an equal sign.
And now let's learn our new function.
So our new function name is the size function.
And also we will open and close parentheses and then we will answer to different parameters of our resize
function.
So the first parameter will be our source metrics.
So our source matrix is IMJ.
So let's right here I am G.
And also the second parameter will be a typo.
And also, we will enter two different value in our top because the first value will be weight and also
the second volume will be hard.
For example, let the first of all you be 100.
Let the second value be, for example, three hundred ninety.
And also if your honor code here.
And as you can see here, we didn't get any error.
So no less display, I am Jim metrics and resizing metrics.
So how can we do that?
As you remember, we should use?
I am sure, function.
So now let's call or I am sure function.
And let the window name be original.
And firstly, let's display the original matrix or source matrix.
Name is I am G.
And also, let's move to a new line and let's call our financial function again, and this time let
the window name be, for example, resizing.
And also, let's display our resizing matrix.
All right.
We are done.
So, no, let's call our Waitaki function, and let's define the value zero.
And now if your honor code.
And as you can see here.
All right.
Yes, right now, I can't move it because the size is small.
Let's come and finish our quote and also let's change to right from here.
Let the weight value be, for example.
250.
And now let's run our code again.
And as you can see here, here is our original image, and here is the resizing image.
So this is the first one, and also this is the last one.
This way we can change the size of an image.
So now let's focus our resize function first.
Let's stop our records.
And as you can see here, we enter two different parameters here.
We assigns our image matrix.
So you see here as the first parameter because we change the size of this image and also the second
parameter you see here.
We create trouble here because it's a default parameter, and therefore we need to change the size of
the image to topple.
All right, my dear friends, in this lesson, we learned how to resize our images.
So now let's move on to our next lesson and learn the basics of image processing better.