Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,480 --> 00:00:03,020
Hello and welcome to this new tutorial.
2
00:00:03,030 --> 00:00:03,350
All right.
3
00:00:03,360 --> 00:00:10,300
So we just detected our eyes thanks to the detect scale method that we applied from our eyes cascara
4
00:00:10,320 --> 00:00:11,020
object.
5
00:00:11,190 --> 00:00:16,680
We gathered the coordinates of the upper left corner the width and the height of the rectangles detecting
6
00:00:16,680 --> 00:00:18,160
the eyes in eyes.
7
00:00:18,300 --> 00:00:21,510
And now what we only need to do is to draw these rectangles.
8
00:00:21,660 --> 00:00:27,360
And we're going to do it exactly the same way as how we did it for the faces we're going to start a
9
00:00:27,360 --> 00:00:33,590
new Fulop here inside the First Folio because we are drawing these rectangles in the referential of
10
00:00:33,590 --> 00:00:34,520
the face.
11
00:00:34,530 --> 00:00:41,780
So what we're simply going to do is take this full loop copy and paste it here.
12
00:00:41,790 --> 00:00:42,600
There we go.
13
00:00:42,840 --> 00:00:46,470
And now we just need to replace some things.
14
00:00:46,470 --> 00:00:53,430
So So first we're going to introduce some new variable names for well the coordinates of the upper left
15
00:00:53,430 --> 00:00:55,820
corner of the rectangle detecting the I's.
16
00:00:55,980 --> 00:01:05,040
So we're going to call them X Y and then the width of the rectangles so E-W and the height of these
17
00:01:05,040 --> 00:01:06,630
rectangles H.
18
00:01:06,900 --> 00:01:11,630
And that's not in faces that's going to be in our eyes.
19
00:01:11,700 --> 00:01:12,490
There we go.
20
00:01:12,840 --> 00:01:20,010
So for my two eyes there are going to be two rectangles and we're getting the coordinates of these rectangles
21
00:01:20,010 --> 00:01:21,470
to width and the heights.
22
00:01:21,630 --> 00:01:27,840
Then what you want to do is draw these rectangles around my eyes your eyes when you look at your code
23
00:01:28,170 --> 00:01:33,840
so saying we're taking the CB2 module from the open C library the rectangle function.
24
00:01:33,840 --> 00:01:38,390
Here is the image on which we want to draw these rectangles.
25
00:01:38,490 --> 00:01:41,510
So that's not a frame but air.
26
00:01:41,540 --> 00:01:43,860
Oh I underscore color.
27
00:01:43,890 --> 00:01:50,550
We want to print these rectangles in the colored frame and then here we need to input the coordinates
28
00:01:50,550 --> 00:01:55,520
of the upper left corner of the rectangle detecting the eyes that x and y.
29
00:01:55,830 --> 00:02:04,800
As we said here and here that's going to be the lower right corner of these rectangles and that's Therefore
30
00:02:05,100 --> 00:02:07,390
X plus E W.
31
00:02:07,520 --> 00:02:13,300
You don't use the width and e y plus H H is the height.
32
00:02:13,380 --> 00:02:18,990
So that just basically gives us the coordinates of the lower right corner of the rectangles.
33
00:02:19,350 --> 00:02:24,900
Then we're going to pick another color because we want to differentiate the rectangles for the face
34
00:02:24,960 --> 00:02:26,480
and the rectangles for the eyes.
35
00:02:26,700 --> 00:02:29,160
So now we're going to choose greens.
36
00:02:29,180 --> 00:02:34,920
I'm putting a 0 here and 2 5 5 here that are to be code.
37
00:02:34,920 --> 00:02:37,680
You can check in on 9 and here.
38
00:02:37,680 --> 00:02:38,740
What was that about.
39
00:02:38,850 --> 00:02:42,540
Well remember that was just the thickness of the edge of the rectangle.
40
00:02:42,600 --> 00:02:44,070
We're going to choose two as well.
41
00:02:44,070 --> 00:02:45,510
That's not very important.
42
00:02:45,510 --> 00:02:48,840
We'll get some perfectly visible rectangles.
43
00:02:49,200 --> 00:02:50,190
All right.
44
00:02:50,190 --> 00:02:51,990
So I think we have everything.
45
00:02:52,080 --> 00:02:54,220
Now we have all rectangles for the eyes.
46
00:02:54,330 --> 00:02:56,630
So the second full loop is actually over.
47
00:02:56,760 --> 00:03:01,980
So we can go back in the first full loop and the good news is that the first full loop is also over
48
00:03:02,460 --> 00:03:09,720
because we just wanted to detect the faces and eyes and draw the rectangles so that over we can go back
49
00:03:09,870 --> 00:03:17,400
here in the main section of the function and actually we only have one line left to type which is of
50
00:03:17,400 --> 00:03:21,010
course to return what we want and what do we want to return.
51
00:03:21,090 --> 00:03:27,570
Well we want to return the original frame with the rectangles detecting the face and the eyes.
52
00:03:27,780 --> 00:03:29,620
So what do we need to return.
53
00:03:29,730 --> 00:03:37,590
Well we simply need to return frame because on this frame we printed here with this line of code.
54
00:03:37,590 --> 00:03:42,400
The rectangles surrounding the face and also with this line of code here.
55
00:03:42,600 --> 00:03:48,900
The rectangles surrounding the eyes because our eye color is a sub zone of the frame.
56
00:03:48,930 --> 00:03:50,310
That's what we specified here.
57
00:03:50,310 --> 00:03:53,400
Our eye color is a subdomain of this from here.
58
00:03:53,610 --> 00:04:00,480
And so by printing this rectangle in our eye color we're printing the rectangles in the frame so frame
59
00:04:00,480 --> 00:04:06,370
now is the original image with the rectangles detecting the faces and the eyes.
60
00:04:06,390 --> 00:04:08,460
So our function is over.
61
00:04:08,460 --> 00:04:09,800
Congratulations.
62
00:04:09,810 --> 00:04:11,850
We are ready to move on to the next step.
63
00:04:11,850 --> 00:04:18,030
Now this will just be about you know turning on the web cam applying the detect function on the streaming
64
00:04:18,090 --> 00:04:20,140
images coming from the webcam.
65
00:04:20,280 --> 00:04:26,430
So remember this detect function is going to be applied on each image one by one but at a very high
66
00:04:26,430 --> 00:04:34,380
rate and therefore even in real time we'll be able to see in the video coming from the webcam some rectangles
67
00:04:34,470 --> 00:04:36,810
surrounding my face and my eyes.
68
00:04:36,990 --> 00:04:40,810
And if you're executing at the same time your face and your eyes.
69
00:04:40,890 --> 00:04:43,820
So we actually getting close to the final result.
70
00:04:43,830 --> 00:04:45,330
I can't wait to show you this.
71
00:04:45,540 --> 00:04:51,200
But first let's read the code to apply to detect function and we'll do that in the next until then.
72
00:04:51,370 --> 00:04:52,760
And I can do revision.
7252
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.