1
00:00:01,340 --> 00:00:01,970
Hi guys.

2
00:00:02,270 --> 00:00:07,520
So we are ready to develop the installing algorithm and the very first date that we'll be developing

3
00:00:07,670 --> 00:00:11,000
will be the localization states now inside the state.

4
00:00:11,270 --> 00:00:14,870
The primary goal is to localize our robot inside the robot.

5
00:00:15,200 --> 00:00:21,110
For this we have the Salvador part where we have the missiles asylum function that will be used iteratively

6
00:00:21,200 --> 00:00:24,290
on all of those stages once they have been developed.

7
00:00:24,660 --> 00:00:28,670
Now, because we are working on the localization states and we haven't developed it yet.

8
00:00:28,910 --> 00:00:32,690
So first we need to develop it before calling the asylum asylum function.

9
00:00:33,230 --> 00:00:39,470
So let's go inside the maze port and create a new that we named as bot localization.

10
00:00:41,640 --> 00:00:44,520
But firefighters are inside it.

11
00:00:44,790 --> 00:00:49,890
The very first thing that we need to do is to simply import the two most important libraries that are

12
00:00:49,890 --> 00:00:51,600
civil to by library.

13
00:00:51,870 --> 00:00:58,010
Now CV two is to import the computer vision algorithms, and numpy is great for creating an empire.

14
00:00:58,770 --> 00:01:04,950
Then we create the class of mortal collider that will perform the actual task of localizing a robot.

15
00:01:05,670 --> 00:01:10,050
The very first function that we'll be writing inside this class will be the initialization function.

16
00:01:10,590 --> 00:01:16,200
So that can be done by simply writing definition in its first argument of self.

17
00:01:16,680 --> 00:01:18,810
And then we define is instance variable.

18
00:01:19,110 --> 00:01:24,460
The first instance variable is a boolean variable that simply tracks whether we have extracted the background

19
00:01:24,540 --> 00:01:24,810
or not.

20
00:01:25,240 --> 00:01:28,200
Because this is the Initialize and states, we haven't extracted it.

21
00:01:28,530 --> 00:01:34,290
So we set this to false and then we create a placeholder for keeping our background model.

22
00:01:34,500 --> 00:01:38,520
Once we have expected this, so we initialize this to an empty list.

23
00:01:39,060 --> 00:01:41,420
Once you've done this, you move on to the next function.

24
00:01:41,430 --> 00:01:43,650
That will be our main function for this.

25
00:01:43,650 --> 00:01:47,430
Localization states that will be known as localized board function.

26
00:01:47,820 --> 00:01:52,410
This takes in the input argument of self and the second argument of grand frame.

27
00:01:52,680 --> 00:01:54,510
The third argument of frame to display.

28
00:01:54,990 --> 00:02:00,000
Now frame display is be simply used to display the board that has been localized on the frame.

29
00:02:00,690 --> 00:02:06,120
Now we defined this part of a function that is that we check whether we have extracted or whether we

30
00:02:06,120 --> 00:02:08,840
have performed the full step of our location state.

31
00:02:09,060 --> 00:02:11,520
That is whether we have extracted the background or not.

32
00:02:11,940 --> 00:02:14,160
So that can be done by simply writing, if not.

33
00:02:15,380 --> 00:02:18,020
So now it is background obstructed or not.

34
00:02:18,350 --> 00:02:23,270
Now, if it has not been extracted, then we simply call the function that extracts the background.

35
00:02:24,590 --> 00:02:29,630
So there is no one to extract background in providing the current frame as an input.

36
00:02:30,050 --> 00:02:36,950
And then we simply after that we set the boolean to true because the background has been extracted successfully.

37
00:02:37,700 --> 00:02:42,170
Now this means the frame to implement this particular function of extract background.

38
00:02:42,710 --> 00:02:43,430
Now let's do that.

39
00:02:43,970 --> 00:02:45,950
So we go up right here.

40
00:02:45,960 --> 00:02:46,730
The definition.

41
00:02:47,210 --> 00:02:48,260
Extract background.

42
00:02:48,770 --> 00:02:52,100
Providing the first argument of self and the second argument of frame.

43
00:02:53,060 --> 00:02:58,760
Now inside it, the very first thing that you need to do is to simply extract the mass of all the region

44
00:02:58,760 --> 00:03:00,650
of interest that are present inside the frame.

45
00:03:01,250 --> 00:03:06,860
So extract the most of all the region of interest.

46
00:03:07,250 --> 00:03:08,030
Now, what are those?

47
00:03:08,030 --> 00:03:08,780
Region of interest?

48
00:03:09,080 --> 00:03:10,880
There's the Miz and there's the car.

49
00:03:11,870 --> 00:03:17,060
So how do we extract from the video we are going to extract them is using as detection algorithm.

50
00:03:17,390 --> 00:03:22,970
Now edges are only present for those objects that have sharp features around them.

51
00:03:23,450 --> 00:03:24,650
So let's do that.

52
00:03:24,890 --> 00:03:30,800
So the way we do that is using the detecting algorithm and the cutting edge detection algorithm first

53
00:03:30,800 --> 00:03:32,090
requires a grayscale image.

54
00:03:32,210 --> 00:03:36,920
So we need to convert our RGV or BTR color frame to a grayscale image.

55
00:03:37,310 --> 00:03:42,650
And that can be done by simply writing simple to convert color, providing the frame as the input.

56
00:03:43,870 --> 00:03:45,820
And Stevie to color.

57
00:03:47,570 --> 00:03:48,250
BGR.

58
00:03:50,090 --> 00:03:52,550
To Ray as the court.

59
00:03:53,300 --> 00:04:01,430
This gives us the output of break and then for the next we simply need to pass this grayscale to the

60
00:04:01,430 --> 00:04:02,720
cancer detection algorithm.

61
00:04:03,890 --> 00:04:10,100
Now can you takes an image of grayscale, then we provided the range of 50 to 150.

62
00:04:10,940 --> 00:04:13,850
Now this range provides adequate edges if we want.

63
00:04:14,810 --> 00:04:17,630
Then for the next argument for edges, we provide none.

64
00:04:17,990 --> 00:04:20,180
And for upward your size, we provide three.

65
00:04:21,080 --> 00:04:26,660
Now, after applying the scanning detection algorithm to get edges as output, once we have the edges,

66
00:04:26,720 --> 00:04:31,970
we can now use the open CV function of fine contours to find the contours of all those regions of interest.

67
00:04:32,510 --> 00:04:40,520
So we use the function of fine controls that takes input, argument, image that is ideal for the mode

68
00:04:40,520 --> 00:04:48,230
we provide in CV to return external, to simply get the external contours of all those objects and for

69
00:04:48,230 --> 00:04:48,770
the method.

70
00:04:50,720 --> 00:04:58,910
We provide in Syria to saint approximation none now because this function of plus two or two gives to

71
00:04:58,910 --> 00:05:02,330
outputs and the only one, the first output that is the control.

72
00:05:02,540 --> 00:05:04,250
So we need to write here zero.

73
00:05:05,170 --> 00:05:08,800
So this will give us the output of controls.

74
00:05:10,540 --> 00:05:15,880
And once we have the controls, we can simply now loop over these controls and simply draw them on an

75
00:05:15,880 --> 00:05:16,990
empty placeholder.

76
00:05:17,410 --> 00:05:20,290
Now, at the moment, we have not defined that placeholder.

77
00:05:20,320 --> 00:05:24,660
So let's define a placeholder because we were expecting the region of interest for the most intimate

78
00:05:24,760 --> 00:05:25,450
region of interest.

79
00:05:25,450 --> 00:05:28,990
Must we use the function of number zero?

80
00:05:29,800 --> 00:05:33,580
We need to provide a ship that can be taken from the shape of the frame.

81
00:05:35,900 --> 00:05:44,180
So you provide the shape of the frame, except that you won't want the dare type of the frame because

82
00:05:44,180 --> 00:05:46,130
the airframe was of the dirty type.

83
00:05:47,570 --> 00:05:49,360
BGR and we want to get it out.

84
00:05:49,550 --> 00:05:50,480
There it is, Chris.

85
00:05:50,600 --> 00:05:52,610
That is off the mark.

86
00:05:53,180 --> 00:05:54,380
So we tried d-type.

87
00:05:56,500 --> 00:05:59,710
Of number know and it.

88
00:06:02,720 --> 00:06:06,350
So once you've done this, we have the region of interest miles from the place order created.

89
00:06:06,710 --> 00:06:10,520
Now we can simply go all in or simply call it a loop.

90
00:06:11,000 --> 00:06:15,260
It loops over all those contours and gives us the ideas of these controls.

91
00:06:15,830 --> 00:06:16,970
And that can be done for.

92
00:06:16,970 --> 00:06:24,350
And by calling enumerate function, depositing the controls as the iterable, and then simply calling

93
00:06:24,350 --> 00:06:32,060
the function of CB to draw controls and draw controls takes in the input argument of the image, which

94
00:06:32,060 --> 00:06:34,340
is our placeholder that we have created just now.

95
00:06:34,790 --> 00:06:36,080
That is a region of interest, Miles.

96
00:06:36,960 --> 00:06:46,590
For the controls group Paulson controls and for an index forcing iterable that is idea and for the color

97
00:06:46,590 --> 00:06:53,250
three passing to 55 and for thickness we write negative one receives to fill all those controls.

98
00:06:53,760 --> 00:06:59,820
Now what this function will do was simply draw all of the mask of all those regional interests that

99
00:06:59,820 --> 00:07:00,950
we are just detected now.

100
00:07:01,710 --> 00:07:05,970
Once you've done this, you've completed the step of expecting the mask of all the region of interest

101
00:07:06,360 --> 00:07:07,110
for the next step.

102
00:07:07,350 --> 00:07:15,090
What we need to do is to simply remove the guard from this region of interest, because although it

103
00:07:15,090 --> 00:07:19,920
is a region of interest, but this is not part of the background, the guard is the part of a foreground.

104
00:07:20,190 --> 00:07:24,780
So to get the background or to extract the beginning, we need to remove the car from the background.

105
00:07:25,260 --> 00:07:30,180
And the way we can do this is simply leveraging the information that God is the smallest object on the

106
00:07:30,180 --> 00:07:30,480
scene.

107
00:07:30,960 --> 00:07:33,520
So we need to find the object this one has gone to.

108
00:07:34,110 --> 00:07:40,140
So for this, we need to use a function that we have created inside the utilities folder, the utilities

109
00:07:40,140 --> 00:07:41,820
file that we have created earlier.

110
00:07:42,510 --> 00:07:46,710
So let's import that file and use the function for the smallest object.

111
00:07:47,340 --> 00:07:49,560
So we need to import it right here.

112
00:07:50,640 --> 00:07:57,950
Import not you to or from from go to utilities to import the returns.

113
00:07:57,960 --> 00:07:58,860
Smallest object.

114
00:08:01,460 --> 00:08:06,440
So we go right here and simply call the function that we have just important files in the controls,

115
00:08:06,590 --> 00:08:09,500
which gives us the output of index of the smallest title.

116
00:08:09,920 --> 00:08:13,400
So we named that as minimum control index.

117
00:08:13,730 --> 00:08:19,490
And once we have this, we can now use this index and to eliminate the car from all those region of

118
00:08:19,490 --> 00:08:21,080
interest that we have extracted earlier.

119
00:08:21,620 --> 00:08:27,410
So we don't want to overwrite over the region of interest lost, but we need to create a new placeholder.

120
00:08:27,590 --> 00:08:31,850
So we name that placeholder as a region of interest with no card.

121
00:08:33,200 --> 00:08:38,600
So this is a region of interest, no card models, and this will be a copy of the Region of Interest

122
00:08:38,600 --> 00:08:39,050
Master.

123
00:08:40,520 --> 00:08:41,630
Just in a different place.

124
00:08:42,050 --> 00:08:46,400
Once we have this, we check whether the minimum control index was legit or not.

125
00:08:46,910 --> 00:08:51,320
So if it was legit, it will not be equal to negative one.

126
00:08:51,560 --> 00:08:53,240
Meaning we have found this one as control.

127
00:08:54,800 --> 00:08:55,910
Which is actually the car.

128
00:08:57,830 --> 00:08:58,160
So.

129
00:08:59,270 --> 00:09:03,890
If it is not equal to negative one, then what we do to you to see to draw control function.

130
00:09:05,940 --> 00:09:08,370
To draw over the image that is a region of interest.

131
00:09:08,460 --> 00:09:12,740
No car must provide in the controls as the controls for the index.

132
00:09:12,740 --> 00:09:20,220
They will not provide the minimum contour index because we have to do it on the models of our car and

133
00:09:20,220 --> 00:09:25,890
because we are removing the car from all the region of interest, we need to write here zero as the

134
00:09:25,890 --> 00:09:26,230
color.

135
00:09:26,430 --> 00:09:29,700
So zero will simply remove the car as a region of interest.

136
00:09:30,240 --> 00:09:34,500
And because we want to complete the complete car, not just as we need to.

137
00:09:34,510 --> 00:09:34,740
Right.

138
00:09:34,740 --> 00:09:35,490
Has negative one.

139
00:09:36,030 --> 00:09:38,970
Once you've done this, we have removed the car from our region of interest.

140
00:09:39,540 --> 00:09:45,060
Now, we also require the models of the car separately from me to create a new placeholder.

141
00:09:45,090 --> 00:09:50,010
So we create a new class folder that we name as car models and then draw that over the car models.

142
00:09:50,280 --> 00:09:56,520
The mean control index by providing the color of 25 and then diluting it by drawing with a thickness

143
00:09:56,520 --> 00:09:56,940
of three.

144
00:09:57,390 --> 00:09:59,640
Once we have done that, we can move on to the next step.

145
00:10:00,030 --> 00:10:06,150
Now, because we have the car models will be required area that does not include the car or does not

146
00:10:06,150 --> 00:10:07,260
include the car region.

147
00:10:07,680 --> 00:10:14,190
So that can be done by simply using the function bitwise not not bitwise not simply inverse what ever

148
00:10:14,200 --> 00:10:16,560
was one zero and 0 to 1.

149
00:10:16,980 --> 00:10:21,060
So we provide in the car models to get the opposite of the car models for the region.

150
00:10:21,060 --> 00:10:22,260
That does not include the car.

151
00:10:23,880 --> 00:10:28,860
So that can be done by simply writing a car list or not.

152
00:10:28,860 --> 00:10:29,610
Car must.

153
00:10:33,460 --> 00:10:36,670
This means that we have the region that does not include the car.

154
00:10:36,970 --> 00:10:38,320
So we can use this mosque.

155
00:10:38,500 --> 00:10:41,580
It does not include the car to extract the frame.

156
00:10:41,650 --> 00:10:42,940
That does not include the car.

157
00:10:43,420 --> 00:10:49,720
So we can now extract the frame where the car is removed by simply using the bitwise in.

158
00:10:54,950 --> 00:10:58,970
Which wasn't providing the frame a source one and source two.

159
00:10:59,540 --> 00:11:03,650
And then for the mask and now providing the not guard mask.

160
00:11:05,440 --> 00:11:08,450
Now this simply says only get those region of the frame.

161
00:11:08,470 --> 00:11:09,910
That does not include the car.

162
00:11:10,510 --> 00:11:16,450
And this becomes the frame the car remote now because we have the frame with the car removed, we have

163
00:11:16,450 --> 00:11:18,460
an empty region inside the frame.

164
00:11:18,640 --> 00:11:21,130
So we cannot say that this is the background as of yet.

165
00:11:21,400 --> 00:11:24,670
We have to fill that empty region with the ground replica.

166
00:11:25,210 --> 00:11:31,010
So for the replica we simply take the color of the frame or the top left corner of the frame removed.

167
00:11:31,720 --> 00:11:33,070
So let's do that.

168
00:11:35,110 --> 00:11:38,290
So again, the frame removed and it's top left corner.

169
00:11:40,050 --> 00:11:40,380
First.

170
00:11:42,740 --> 00:11:46,340
And named that as the best color on this fiscal.

171
00:11:46,340 --> 00:11:51,740
It would be used to create the brown replica that would fill in the empty space inside the area where

172
00:11:51,740 --> 00:11:52,790
the car was removed from.

173
00:11:53,540 --> 00:11:55,070
So this cleared the ground replica

174
00:11:58,280 --> 00:12:02,390
and that can be created by simply using the number function of ones like.

175
00:12:04,780 --> 00:12:11,620
This takes an input argument of frame because we want a colour image the same size of the frame.

176
00:12:12,160 --> 00:12:16,510
But we want to multiply this with a base color to get the ground replica.

177
00:12:16,840 --> 00:12:23,020
Now that we have the ground replica, we can use this information to get only the ground region where

178
00:12:23,020 --> 00:12:25,630
the car was present and then fill it with the frame car.

179
00:12:26,200 --> 00:12:32,470
And that can be done by simply using a few of the bitwise and where we get the ground replica only in

180
00:12:32,470 --> 00:12:37,600
the region where the car was present and then simply or in that region with the frame removed.

181
00:12:37,780 --> 00:12:39,400
This gives us the background model.

182
00:12:39,610 --> 00:12:41,560
And now we have extracted the background model.

183
00:12:41,920 --> 00:12:44,230
The main task of this extracted background function.

184
00:12:44,500 --> 00:12:49,420
The main goal of this particular localized state was to localize the robot inside the mix.

185
00:12:49,900 --> 00:12:50,710
So we need.

186
00:12:50,980 --> 00:12:53,830
So we want to localize our robot relative to the Miz.

187
00:12:54,190 --> 00:12:57,820
So to get to the relative home is really quite a frame of reference.

188
00:12:58,120 --> 00:13:02,800
So we need to get that frame of reference or get that means cropped out from the whole frame.

189
00:13:03,310 --> 00:13:07,810
So we require some sort of boundary enclosing that means.

190
00:13:08,320 --> 00:13:09,520
So let's do that.

191
00:13:10,500 --> 00:13:10,690
Okay.

192
00:13:11,390 --> 00:13:17,300
So for that, we first need to create a function that encloses all the region of the means and the car

193
00:13:17,300 --> 00:13:18,050
inside of it.

194
00:13:18,590 --> 00:13:21,260
So we create a function that does exactly that.

195
00:13:21,950 --> 00:13:25,040
So that function would be known as return region of interest bounding.

196
00:13:25,520 --> 00:13:31,130
So we provide in the region of interest models and control, and this will give us the whole that encloses

197
00:13:31,130 --> 00:13:32,870
all of the mess inside of it.

198
00:13:34,270 --> 00:13:41,470
So we simply now call that particular function by simply writing self interest, bounding or providing

199
00:13:41,470 --> 00:13:43,330
the region of interest and the controls.

200
00:13:43,690 --> 00:13:48,130
This gives us the whole that encloses all of those region of interest and includes the means in the

201
00:13:48,130 --> 00:13:48,460
car.

202
00:13:49,150 --> 00:13:54,760
And once we have the whole, we simply use the bounding rect to get the rectangle that bounds, that

203
00:13:54,760 --> 00:13:55,090
hope.

204
00:13:55,480 --> 00:14:00,550
This gives us the starting rule, starting column width and the height of the bounding rectangle.

205
00:14:01,090 --> 00:14:05,470
Once we have that, we use that region to crop out the mes from the whole frame.

206
00:14:05,950 --> 00:14:12,280
So we get the region of interest with no corners and use a crop of the maize from that particular region

207
00:14:12,430 --> 00:14:13,510
or that particular mass.

208
00:14:13,930 --> 00:14:16,510
Once we have the mis cropped out, we can now.

209
00:14:17,540 --> 00:14:22,400
Get them is occupancy grade where the car contributes by simply inverting the is.

210
00:14:23,590 --> 00:14:28,480
And the reason you're inverting them is, is because that region with the males was present or the males

211
00:14:28,480 --> 00:14:32,740
boys were present is directly opposite to the region where the card controls from.

212
00:14:33,070 --> 00:14:37,840
So right now we have the was detected, but we want the opposite area to the wall.

213
00:14:38,020 --> 00:14:47,050
So we need to use CV to bitwise not so we use that which was not to get the occupancy group.

214
00:14:48,740 --> 00:14:50,720
This provides this to me documents secret.

215
00:14:51,140 --> 00:14:57,920
Now this gives us the maze occupancy, but we also want it to be a specific frame of reference.

216
00:14:58,280 --> 00:15:04,430
So to maintain the consistency in the frame of reference, we always point entry point of a maze on

217
00:15:04,430 --> 00:15:04,790
the top.

218
00:15:05,120 --> 00:15:08,630
So because the entry point of the maze of this maze is on the right.

219
00:15:08,630 --> 00:15:10,760
So we need to rotate it counterclockwise.

220
00:15:11,180 --> 00:15:14,450
So let's take it to get the final maze occupancy grid.

221
00:15:14,990 --> 00:15:19,940
And that can be done by switch to rotate, providing the maze occupancy rate.

222
00:15:25,810 --> 00:15:30,100
And for the code we provided Siri to rotate.

223
00:15:31,790 --> 00:15:33,680
Counterclockwise, 90 degrees.

224
00:15:34,040 --> 00:15:38,810
And this gives us so of May's occupancy.

225
00:15:38,830 --> 00:15:39,080
Great.

226
00:15:41,100 --> 00:15:41,280
Now.

227
00:15:41,280 --> 00:15:42,540
We also need to create this.

228
00:15:44,430 --> 00:15:47,820
Inside the function for declared distance in function.

229
00:15:49,190 --> 00:15:53,090
By writing these documents include initializing it with an empty list.

230
00:15:53,540 --> 00:15:58,370
Now this will the second output that we required, and that also become crucial in the next stage for

231
00:15:58,370 --> 00:15:59,120
the mapping stage.

232
00:15:59,900 --> 00:16:05,210
Now, once we have done this, all that is left for us to do it will simply update the parameters that

233
00:16:05,210 --> 00:16:07,400
we used to get this frame of reference.

234
00:16:07,670 --> 00:16:09,410
That is our maze occupancy grid.

235
00:16:09,890 --> 00:16:13,010
That includes the cropping barometers and the rotation parameters.

236
00:16:13,520 --> 00:16:15,920
So let's update those parameters.

237
00:16:16,190 --> 00:16:19,700
So first we need to do is create a few more instance variables.

238
00:16:20,150 --> 00:16:26,180
This includes the growth parameters X, Y and row and column of the original frame and the rotation

239
00:16:26,840 --> 00:16:33,320
angle that that was used to rotate out of our frame to get the maze entry on the top.

240
00:16:34,130 --> 00:16:40,850
Now we need to create a new function that would be used to update the frame of reference parameters.

241
00:16:41,240 --> 00:16:45,350
So we use this particular function by calling it right below here.

242
00:16:45,380 --> 00:16:50,900
So we call that particular function of or update frame of reference provided stock roll start column

243
00:16:51,170 --> 00:16:57,710
width and height and angle to which on which we rotated our frame because we rotated to 90 degrees,

244
00:16:57,950 --> 00:16:59,000
we provided 90.

245
00:16:59,180 --> 00:17:04,790
And this simply updates the reference parameters that can be used later on when you want to reference

246
00:17:05,090 --> 00:17:08,900
on bear on the original frame B crop to get our frame of reference.

247
00:17:09,500 --> 00:17:16,250
Now finally, simply display all the intermediate stages and the final stage that we got by implementing

248
00:17:16,250 --> 00:17:17,810
the function of the extract background.

249
00:17:18,220 --> 00:17:24,710
This includes regional frame, Christmas frame column, ground replica burger model and main documents

250
00:17:24,710 --> 00:17:25,040
secret.

251
00:17:25,550 --> 00:17:30,770
This last two outputs are the final outputs of this particular function of extract background.

252
00:17:31,130 --> 00:17:37,580
So the background model will be used to use to get the foreground using the background subtraction and

253
00:17:37,580 --> 00:17:43,670
the mixed occupancy gear will simply be used for the next stage of mapping when we want to identify

254
00:17:43,670 --> 00:17:45,410
which region the caller controls.

255
00:17:46,010 --> 00:17:51,110
So now let's run this and see whether we were able to correctly implement the first step that is background

256
00:17:51,120 --> 00:17:55,640
extracted for the background subtraction task of local and state.

257
00:17:56,150 --> 00:17:59,690
So let's do this now before we can run this project.

258
00:17:59,780 --> 00:18:02,750
We still need to import it inside the main Salvador part.

259
00:18:03,170 --> 00:18:05,410
So let's go over the missile part.

260
00:18:06,380 --> 00:18:14,060
We're right at the start and import from our board localization import the class that is known as localizing.

261
00:18:14,750 --> 00:18:16,760
Then we simply create the object of this class.

262
00:18:18,110 --> 00:18:18,370
Four.

263
00:18:18,530 --> 00:18:25,190
And the object for the missile over and give it the same name as a class object that is bought.

264
00:18:25,190 --> 00:18:25,820
Localize it.

265
00:18:27,410 --> 00:18:30,920
We initialize this to the localize that object.

266
00:18:31,820 --> 00:18:38,090
So once we have the object created for this missile class, we can use this object inside the Mir solving

267
00:18:38,090 --> 00:18:38,570
function.

268
00:18:39,380 --> 00:18:40,040
We're writing.

269
00:18:41,270 --> 00:18:45,140
Silver that bought localized, localized sport.

270
00:18:45,650 --> 00:18:51,800
And that takes an argument of grand frame, which is basically sales or set view or the satellite view

271
00:18:51,800 --> 00:18:54,770
that was being provided to us from the top down camera.

272
00:18:54,800 --> 00:19:00,560
Looking on the means for the frame display, we need to create a new variable or placeholder that we

273
00:19:00,560 --> 00:19:01,640
name as frame display.

274
00:19:02,510 --> 00:19:05,240
And this is simply a copy of self thoughts that you.

275
00:19:09,180 --> 00:19:14,460
Now to provide this information, we can now simply build this project and see whether the full step

276
00:19:14,460 --> 00:19:17,160
of the localization states is working correctly or not.

277
00:19:18,030 --> 00:19:19,290
So we move inside the terminal.

278
00:19:21,400 --> 00:19:22,240
Will the project.

279
00:19:24,700 --> 00:19:25,900
Launch a simulation.

280
00:19:28,010 --> 00:19:32,510
So when this once the simulation starts up, we can now run the MIT solver.

281
00:19:33,800 --> 00:19:38,960
And as you can see, it has grown successfully and it has given me the five outputs.

282
00:19:39,140 --> 00:19:40,550
Let's see the original output.

283
00:19:40,640 --> 00:19:41,900
That was a satellite view.

284
00:19:42,110 --> 00:19:47,930
As you can see, we have the mess looked down upon from the satellite and we have the we have the board.

285
00:19:47,940 --> 00:19:48,350
Right.

286
00:19:48,350 --> 00:19:50,600
And this miss entry point of the miss.

287
00:19:51,290 --> 00:19:54,470
Then for the first output that we got was the region of interest lost.

288
00:19:54,950 --> 00:20:00,290
Now these models are all of the region of interest that represent inside the frame that included the

289
00:20:00,290 --> 00:20:01,820
Miss Walls and the car.

290
00:20:02,270 --> 00:20:06,950
Now, what we did was simply extracted the car mask and simply removed it.

291
00:20:07,980 --> 00:20:09,120
From our mainframe.

292
00:20:09,240 --> 00:20:14,880
And what we got as an output was this frame car removed, which included the frame, but the car was

293
00:20:14,890 --> 00:20:16,000
removed altogether.

294
00:20:16,290 --> 00:20:18,900
But this left an empty space right here.

295
00:20:18,990 --> 00:20:21,360
So we fill that space with a ground replica.

296
00:20:22,420 --> 00:20:27,850
So the ground replica was simply of the same color of the as of the bag known for the mace.

297
00:20:28,540 --> 00:20:31,210
So we simply filled the space that was left empty.

298
00:20:31,210 --> 00:20:36,820
And the final output, that record was the background model which included the mace inside the frame.

299
00:20:37,090 --> 00:20:39,940
But the foreground that was the car was simply removed.

300
00:20:41,090 --> 00:20:45,260
Once we have the background model, the first output, we can now move on to the second output that

301
00:20:45,300 --> 00:20:49,520
will see on this particular step of the block localization states.

302
00:20:49,970 --> 00:20:52,160
The second output was the occupancy grade.

303
00:20:52,430 --> 00:20:57,500
And as you can see, not only the maize has been dropped out to get the frame of reference, it has

304
00:20:57,500 --> 00:21:00,710
also been rotated to get the maize entry right on top.

305
00:21:01,070 --> 00:21:04,610
So this will be our frame of reference on which the board will be localised.

306
00:21:04,940 --> 00:21:08,000
So the port is on right here on the maize entry.

307
00:21:08,240 --> 00:21:13,580
It is basically on the top right position and can be interpreted as the frame.

308
00:21:13,970 --> 00:21:19,820
The columns of the frame are a few rows, a few columns before the next column of this particular frame.

309
00:21:20,120 --> 00:21:21,600
So this is our frame of reference.

310
00:21:21,620 --> 00:21:25,850
The second output of the extract background function for our local and state.

311
00:21:26,300 --> 00:21:32,450
Now let's implement the second step to use the to use this full background model that we have just expected

312
00:21:32,870 --> 00:21:35,010
to extract the foreground that is the crown.

313
00:21:35,030 --> 00:21:37,250
In the next few frames till then.

314
00:21:37,520 --> 00:21:38,120
Thank you.

315
00:21:38,180 --> 00:21:38,750
And by.
