Hello, friends.
Today I will tell you about rotating a picture example in Libya.
Basically, we will use image processing over here.
Right now there is an image of a plane.
When I hit on run button, as you see, the plane comes towards us.
And if you want to rotate it, you can rotate this plane also.
So basically, in this case, in the programming case, I just go to the block diagram window over here.
The image of the plane is a 24 bit fixed map.
Over here there is a to 60 close to 60 matrix in which the plane is drawn.
The math and the inner core loop calculates the new picture array with each pixel in a new position
based on specified rotation angle and scale angle.
And the scale and rotation are maintained by or managed by these two scales.
Over here, this is a reverse one on x.
Let's say over here the value is X.
Then I got one upon x and I find out it's this is real part and this is our entity.
And according to this, I got a complex number and it goes to over here and it is multiplied with its
real and imaginary part over here from the 2D area, as you see over here to 60 grows to 60, 32, they
are not 3D or here.
This is the size.
If you want to check out the size.
I just create.
And
so when I hit on the button, I just took it.
And over here, you can find out who 60 close to 60 means to 60 columns to 60 rows.
There is columns and over here is prose.
So I just go back and play this.
So over here I just use nested loops and this is my index function again, or here also this is index
cigarette.
And I just use this picture to do a picture image.
You can check this label.
Also row and flattened picks map.
I'll just make a label visible so that it is easy to find out.
This is for size.
So I just control you.
And this function is my friend.
Problem weight for front panel activities.
And this function you can find out in the dialog box or here page for front panel activity.
Okay, so this is the picture.
So I just again, go to my panel.
So when I hit on run button, if you want to change the size of plane, you can change it like this.
And if you want to rotate it, it will rotate from nine s by two by, as you say, minus by is 3.1 for
what is in radius angles in radians.
Okay.
So this is now I just add on to this.
I want to change this image from my own image.
Okay.
So I just go to image processing, which is an animation over here.
These are in motion.
Let it go to vision utility and the image management.
I just create an image.
Let's say the name is
one, two, three.
The name of the image.
And over here, this is the image type.
So I just use greyscale and sign it.
Then I just go to the save file.
So just connect this.
As you see over here, it is saved.
Now I want to create a path for the image.
So in my pictures, I have a plain image that is different from the given one.
So browse for path over here in the pictures.
So I just use this image images saved and I also want to check what type of image is this.
So I just go to vision on the front panel.
And over here I just use silver display, small size.
Let's see.
Okay.
So I just connect this to my image.
When I hit on run button, I got the image of a plane that is different.
Okay, so I just decrease the size, let's say.
So now over here, I got my image.
Now, over here, this is value from the image.
So right now, I just delete this before deleting.
I just convert this image to pixels for that purpose.
I again go to our reason end motion.
The box
in the vision and motion toolbox.
Or here there is a pixel manipulation.
Just lock it.
So I want to just convert image to array.
So I just use this function, connect this to this.
So right now, just delete this by input image.
And over here I got
image pixels.
So when I hit on run button and when I stop it, I got value inside it.
So I just make it too old.
So let's check.
So
make it false.
You can check out.
What is this?
It is very made for a unified use file path.
Use file path.
Image type.
Right now it is taking its own.
So when it is false.
So I just hit on button, as you see over here.
I got the image in the form of 2D array.
So right now I also want to check the size.
So for that purpose, I go to edit operations.
Over here, I got a size, the size of the air raid indicator.
So when I hit on run button, as you see, I got a 260, close to 60 matrix in my case.
So I just delete this.
Go back.
I just delete this also.
So right now over here, I go to the pixels.
So I just delete this part.
And right now this image goes to my image control B for removing.
So when I hit on the run button, as you see over here, I got this.
And it is just increasing the size.
And over here, there is a plane that is different for from initial one.
And if you want to also create image, if you want to see this in image processing toolbox or you can
say in this format.
So just copy this over here.
I'll just name it.
Let's say two, three, one.
The name of the image and this image goes to before this, I want to convert this 2D array to picture
or image.
So for that purpose, I again, it goes to my vision and motion toolbox and this pixel manipulation
over here image area array.
I make you image array to image.
So I just use this.
So over here this is U8 format and it will demand new image.
You have to save it before use and over here you get the image out.
So I just copy this.
And when you connect this in this part, you can find out the image, turning image.
So when you move this, as you see,
and if you want to increase, decrease the size.
Right now, plane goes away from me.
It comes back to me.
It goes away from me.
So if you want to also enhance this, like I'm just putting some delay inside it.
One second delay, let's say.
And in this case, there is no need of this.
And this scale, let's say, comes from this.
And the scaling is from 0.12.
So I just divide this because it starts from zero create constant, let's say ten.
And it goes to this.
And when this value is equal to ten, my loop automatically stop.
When this value
equal to ten, it will stop my loop.
So I just delete this.
And let's check the operation.
So I don't run button, as you see.
After one one second,
the plane comes to me.
And I also changing as you see this goes on on increasing.
So this is how you can use image processing and let you.
Thank you.