Install the following Open Computer Vision (Open CV) library by using the following commands, in the Pi terminal. Wait for one to complete installing before running the code.
sudo apt install python3-opencv
2. Install the data files:
After you download the folder, open the following example: face_detect_cv2.py
If you look inside the haar cascades data folder you can see what other features you can detect. You can see the likely path to this folder in the image to the right.Â
Here's an example for eyes: eye_detect.py
Challenge:
Try detecting other parts of the face or body using some of the other data sets.
Try detecting a cat face (from a photo)
Can you make something physical happen when a face is detected? Like lighting an LED?