1
00:00:10,000 --> 00:00:11,000
Hello, friends.

2
00:00:12,000 --> 00:00:20,000
Today I will tell you about rotating a picture example in Libya.

3
00:00:20,000 --> 00:00:24,000
Basically, we will use image processing over here.

4
00:00:24,000 --> 00:00:28,000
Right now there is an image of a plane.

5
00:00:28,000 --> 00:00:34,000
When I hit on run button, as you see, the plane comes towards us.

6
00:00:35,000 --> 00:00:42,000
And if you want to rotate it, you can rotate this plane also.

7
00:00:43,000 --> 00:00:53,000
So basically, in this case, in the programming case, I just go to the block diagram window over here.

8
00:00:53,000 --> 00:00:57,000
The image of the plane is a 24 bit fixed map.

9
00:00:57,000 --> 00:01:05,000
Over here there is a to 60 close to 60 matrix in which the plane is drawn.

10
00:01:06,000 --> 00:01:14,000
The math and the inner core loop calculates the new picture array with each pixel in a new position

11
00:01:14,000 --> 00:01:17,000
based on specified rotation angle and scale angle.

12
00:01:18,000 --> 00:01:25,000
And the scale and rotation are maintained by or managed by these two scales.

13
00:01:25,000 --> 00:01:29,000
Over here, this is a reverse one on x.

14
00:01:29,000 --> 00:01:32,000
Let's say over here the value is X.

15
00:01:32,000 --> 00:01:41,000
Then I got one upon x and I find out it's this is real part and this is our entity.

16
00:01:41,000 --> 00:01:49,000
And according to this, I got a complex number and it goes to over here and it is multiplied with its

17
00:01:49,000 --> 00:02:00,000
real and imaginary part over here from the 2D area, as you see over here to 60 grows to 60, 32, they

18
00:02:00,000 --> 00:02:02,000
are not 3D or here.

19
00:02:02,000 --> 00:02:03,000
This is the size.

20
00:02:03,000 --> 00:02:05,000
If you want to check out the size.

21
00:02:05,000 --> 00:02:06,000
I just create.

22
00:02:11,000 --> 00:02:12,000
And

23
00:02:15,000 --> 00:02:19,000
so when I hit on the button, I just took it.

24
00:02:19,000 --> 00:02:26,000
And over here, you can find out who 60 close to 60 means to 60 columns to 60 rows.

25
00:02:27,000 --> 00:02:30,000
There is columns and over here is prose.

26
00:02:30,000 --> 00:02:34,000
So I just go back and play this.

27
00:02:35,000 --> 00:02:46,000
So over here I just use nested loops and this is my index function again, or here also this is index

28
00:02:46,000 --> 00:02:46,000
cigarette.

29
00:02:46,000 --> 00:02:52,000
And I just use this picture to do a picture image.

30
00:02:52,000 --> 00:02:55,000
You can check this label.

31
00:02:55,000 --> 00:02:58,000
Also row and flattened picks map.

32
00:02:59,000 --> 00:03:05,000
I'll just make a label visible so that it is easy to find out.

33
00:03:11,000 --> 00:03:13,000
This is for size.

34
00:03:15,000 --> 00:03:18,000
So I just control you.

35
00:03:19,000 --> 00:03:25,000
And this function is my friend.

36
00:03:25,000 --> 00:03:28,000
Problem weight for front panel activities.

37
00:03:29,000 --> 00:03:37,000
And this function you can find out in the dialog box or here page for front panel activity.

38
00:03:38,000 --> 00:03:41,000
Okay, so this is the picture.

39
00:03:42,000 --> 00:03:45,000
So I just again, go to my panel.

40
00:03:46,000 --> 00:03:54,000
So when I hit on run button, if you want to change the size of plane, you can change it like this.

41
00:03:54,000 --> 00:04:04,000
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

42
00:04:06,000 --> 00:04:09,000
what is in radius angles in radians.

43
00:04:09,000 --> 00:04:10,000
Okay.

44
00:04:10,000 --> 00:04:16,000
So this is now I just add on to this.

45
00:04:16,000 --> 00:04:22,000
I want to change this image from my own image.

46
00:04:22,000 --> 00:04:23,000
Okay.

47
00:04:23,000 --> 00:04:34,000
So I just go to image processing, which is an animation over here.

48
00:04:35,000 --> 00:04:36,000
These are in motion.

49
00:04:37,000 --> 00:04:42,000
Let it go to vision utility and the image management.

50
00:04:42,000 --> 00:04:43,000
I just create an image.

51
00:04:45,000 --> 00:04:47,000
Let's say the name is

52
00:04:49,000 --> 00:04:50,000
one, two, three.

53
00:04:51,000 --> 00:04:52,000
The name of the image.

54
00:04:53,000 --> 00:04:57,000
And over here, this is the image type.

55
00:04:58,000 --> 00:05:03,000
So I just use greyscale and sign it.

56
00:05:04,000 --> 00:05:09,000
Then I just go to the save file.

57
00:05:10,000 --> 00:05:12,000
So just connect this.

58
00:05:13,000 --> 00:05:17,000
As you see over here, it is saved.

59
00:05:17,000 --> 00:05:22,000
Now I want to create a path for the image.

60
00:05:22,000 --> 00:05:29,000
So in my pictures, I have a plain image that is different from the given one.

61
00:05:30,000 --> 00:05:35,000
So browse for path over here in the pictures.

62
00:05:36,000 --> 00:05:46,000
So I just use this image images saved and I also want to check what type of image is this.

63
00:05:47,000 --> 00:05:52,000
So I just go to vision on the front panel.

64
00:05:52,000 --> 00:06:03,000
And over here I just use silver display, small size.

65
00:06:05,000 --> 00:06:06,000
Let's see.

66
00:06:12,000 --> 00:06:13,000
Okay.

67
00:06:13,000 --> 00:06:19,000
So I just connect this to my image.

68
00:06:22,000 --> 00:06:28,000
When I hit on run button, I got the image of a plane that is different.

69
00:06:29,000 --> 00:06:34,000
Okay, so I just decrease the size, let's say.

70
00:06:38,000 --> 00:06:44,000
So now over here, I got my image.

71
00:06:46,000 --> 00:06:52,000
Now, over here, this is value from the image.

72
00:06:52,000 --> 00:06:57,000
So right now, I just delete this before deleting.

73
00:06:57,000 --> 00:07:02,000
I just convert this image to pixels for that purpose.

74
00:07:02,000 --> 00:07:08,000
I again go to our reason end motion.

75
00:07:08,000 --> 00:07:09,000
The box

76
00:07:12,000 --> 00:07:15,000
in the vision and motion toolbox.

77
00:07:15,000 --> 00:07:18,000
Or here there is a pixel manipulation.

78
00:07:18,000 --> 00:07:19,000
Just lock it.

79
00:07:20,000 --> 00:07:25,000
So I want to just convert image to array.

80
00:07:26,000 --> 00:07:30,000
So I just use this function, connect this to this.

81
00:07:32,000 --> 00:07:39,000
So right now, just delete this by input image.

82
00:07:39,000 --> 00:07:41,000
And over here I got

83
00:07:45,000 --> 00:07:46,000
image pixels.

84
00:07:46,000 --> 00:07:54,000
So when I hit on run button and when I stop it, I got value inside it.

85
00:07:55,000 --> 00:08:01,000
So I just make it too old.

86
00:08:01,000 --> 00:08:03,000
So let's check.

87
00:08:05,000 --> 00:08:06,000
So

88
00:08:08,000 --> 00:08:09,000
make it false.

89
00:08:10,000 --> 00:08:11,000
You can check out.

90
00:08:11,000 --> 00:08:12,000
What is this?

91
00:08:12,000 --> 00:08:16,000
It is very made for a unified use file path.

92
00:08:17,000 --> 00:08:18,000
Use file path.

93
00:08:18,000 --> 00:08:19,000
Image type.

94
00:08:19,000 --> 00:08:23,000
Right now it is taking its own.

95
00:08:23,000 --> 00:08:25,000
So when it is false.

96
00:08:26,000 --> 00:08:29,000
So I just hit on button, as you see over here.

97
00:08:29,000 --> 00:08:35,000
I got the image in the form of 2D array.

98
00:08:35,000 --> 00:08:39,000
So right now I also want to check the size.

99
00:08:39,000 --> 00:08:44,000
So for that purpose, I go to edit operations.

100
00:08:44,000 --> 00:08:51,000
Over here, I got a size, the size of the air raid indicator.

101
00:08:51,000 --> 00:09:01,000
So when I hit on run button, as you see, I got a 260, close to 60 matrix in my case.

102
00:09:02,000 --> 00:09:03,000
So I just delete this.

103
00:09:04,000 --> 00:09:05,000
Go back.

104
00:09:06,000 --> 00:09:08,000
I just delete this also.

105
00:09:09,000 --> 00:09:12,000
So right now over here, I go to the pixels.

106
00:09:13,000 --> 00:09:15,000
So I just delete this part.

107
00:09:15,000 --> 00:09:23,000
And right now this image goes to my image control B for removing.

108
00:09:26,000 --> 00:09:31,000
So when I hit on the run button, as you see over here, I got this.

109
00:09:31,000 --> 00:09:36,000
And it is just increasing the size.

110
00:09:36,000 --> 00:09:43,000
And over here, there is a plane that is different for from initial one.

111
00:09:43,000 --> 00:09:55,000
And if you want to also create image, if you want to see this in image processing toolbox or you can

112
00:09:55,000 --> 00:09:57,000
say in this format.

113
00:09:57,000 --> 00:10:01,000
So just copy this over here.

114
00:10:01,000 --> 00:10:03,000
I'll just name it.

115
00:10:03,000 --> 00:10:05,000
Let's say two, three, one.

116
00:10:06,000 --> 00:10:17,000
The name of the image and this image goes to before this, I want to convert this 2D array to picture

117
00:10:18,000 --> 00:10:18,000
or image.

118
00:10:18,000 --> 00:10:28,000
So for that purpose, I again, it goes to my vision and motion toolbox and this pixel manipulation

119
00:10:28,000 --> 00:10:30,000
over here image area array.

120
00:10:31,000 --> 00:10:33,000
I make you image array to image.

121
00:10:34,000 --> 00:10:35,000
So I just use this.

122
00:10:35,000 --> 00:10:43,000
So over here this is U8 format and it will demand new image.

123
00:10:43,000 --> 00:10:50,000
You have to save it before use and over here you get the image out.

124
00:10:50,000 --> 00:10:51,000
So I just copy this.

125
00:10:54,000 --> 00:11:03,000
And when you connect this in this part, you can find out the image, turning image.

126
00:11:03,000 --> 00:11:07,000
So when you move this, as you see,

127
00:11:11,000 --> 00:11:13,000
and if you want to increase, decrease the size.

128
00:11:16,000 --> 00:11:18,000
Right now, plane goes away from me.

129
00:11:19,000 --> 00:11:20,000
It comes back to me.

130
00:11:21,000 --> 00:11:23,000
It goes away from me.

131
00:11:23,000 --> 00:11:34,000
So if you want to also enhance this, like I'm just putting some delay inside it.

132
00:11:36,000 --> 00:11:38,000
One second delay, let's say.

133
00:11:40,000 --> 00:11:44,000
And in this case, there is no need of this.

134
00:11:46,000 --> 00:11:54,000
And this scale, let's say, comes from this.

135
00:11:54,000 --> 00:11:57,000
And the scaling is from 0.12.

136
00:11:57,000 --> 00:12:08,000
So I just divide this because it starts from zero create constant, let's say ten.

137
00:12:09,000 --> 00:12:11,000
And it goes to this.

138
00:12:12,000 --> 00:12:17,000
And when this value is equal to ten, my loop automatically stop.

139
00:12:18,000 --> 00:12:19,000
When this value

140
00:12:24,000 --> 00:12:30,000
equal to ten, it will stop my loop.

141
00:12:30,000 --> 00:12:32,000
So I just delete this.

142
00:12:35,000 --> 00:12:37,000
And let's check the operation.

143
00:12:38,000 --> 00:12:43,000
So I don't run button, as you see.

144
00:12:53,000 --> 00:12:54,000
After one one second,

145
00:12:58,000 --> 00:13:00,000
the plane comes to me.

146
00:13:05,000 --> 00:13:14,000
And I also changing as you see this goes on on increasing.

147
00:13:15,000 --> 00:13:20,000
So this is how you can use image processing and let you.

148
00:13:21,000 --> 00:13:21,000
Thank you.

