Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
1
Hello and welcome to this new tutorial.
2
All right.
3
So we just detected our eyes thanks to the detect scale method that we applied from our eyes cascara
4
object.
5
We gathered the coordinates of the upper left corner the width and the height of the rectangles detecting
6
the eyes in eyes.
7
And now what we only need to do is to draw these rectangles.
8
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
new Fulop here inside the First Folio because we are drawing these rectangles in the referential of
10
the face.
11
So what we're simply going to do is take this full loop copy and paste it here.
12
There we go.
13
And now we just need to replace some things.
14
So So first we're going to introduce some new variable names for well the coordinates of the upper left
15
corner of the rectangle detecting the I's.
16
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
rectangles H.
18
And that's not in faces that's going to be in our eyes.
19
There we go.
20
So for my two eyes there are going to be two rectangles and we're getting the coordinates of these rectangles
21
to width and the heights.
22
Then what you want to do is draw these rectangles around my eyes your eyes when you look at your code
23
so saying we're taking the CB2 module from the open C library the rectangle function.
24
Here is the image on which we want to draw these rectangles.
25
So that's not a frame but air.
26
Oh I underscore color.
27
We want to print these rectangles in the colored frame and then here we need to input the coordinates
28
of the upper left corner of the rectangle detecting the eyes that x and y.
29
As we said here and here that's going to be the lower right corner of these rectangles and that's Therefore
30
X plus E W.
31
You don't use the width and e y plus H H is the height.
32
So that just basically gives us the coordinates of the lower right corner of the rectangles.
33
Then we're going to pick another color because we want to differentiate the rectangles for the face
34
and the rectangles for the eyes.
35
So now we're going to choose greens.
36
I'm putting a 0 here and 2 5 5 here that are to be code.
37
You can check in on 9 and here.
38
What was that about.
39
Well remember that was just the thickness of the edge of the rectangle.
40
We're going to choose two as well.
41
That's not very important.
42
We'll get some perfectly visible rectangles.
43
All right.
44
So I think we have everything.
45
Now we have all rectangles for the eyes.
46
So the second full loop is actually over.
47
So we can go back in the first full loop and the good news is that the first full loop is also over
48
because we just wanted to detect the faces and eyes and draw the rectangles so that over we can go back
49
here in the main section of the function and actually we only have one line left to type which is of
50
course to return what we want and what do we want to return.
51
Well we want to return the original frame with the rectangles detecting the face and the eyes.
52
So what do we need to return.
53
Well we simply need to return frame because on this frame we printed here with this line of code.
54
The rectangles surrounding the face and also with this line of code here.
55
The rectangles surrounding the eyes because our eye color is a sub zone of the frame.
56
That's what we specified here.
57
Our eye color is a subdomain of this from here.
58
And so by printing this rectangle in our eye color we're printing the rectangles in the frame so frame
59
now is the original image with the rectangles detecting the faces and the eyes.
60
So our function is over.
61
Congratulations.
62
We are ready to move on to the next step.
63
Now this will just be about you know turning on the web cam applying the detect function on the streaming
64
images coming from the webcam.
65
So remember this detect function is going to be applied on each image one by one but at a very high
66
rate and therefore even in real time we'll be able to see in the video coming from the webcam some rectangles
67
surrounding my face and my eyes.
68
And if you're executing at the same time your face and your eyes.
69
So we actually getting close to the final result.
70
I can't wait to show you this.
71
But first let's read the code to apply to detect function and we'll do that in the next until then.
72
And I can do revision.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.