Face detection
This scrips allows to detect faces on real time and remark it on a red square.
Enter into python virtual enviroment:
Execute the code :
Let's explain the code
In the first part we need to import the libraries that we are going to use:
Decleare variable to know where is the databases so we could create our face cascade algorithm and start capturing the frames of the default webcam.
Here we capture the video, The read() functions reads one frame from the video sources.
Then we create rectangles so we could put on the frame when a face is detected.
Finallly we need to realase the webcam and destroy the frame that we create.
Last updated
Was this helpful?