5. Face Processing in Image and Video
Activity 5.01: Eye Detection Using Multiple Cascades
Solution:
Perform the following steps to complete this activity:
- Open your Jupyter notebook and create a new file called
ctivity5.01.ipynb
. Write your code in this file. - Import the required libraries:
import cv2 import numpy as np
- Use the
detectionUsingCascades
function that we wrote in Exercise 5.02, Eye Detection Using Cascades, as the starting point and modify it to incorporate the second cascade classifier as well. - Revise the arguments of the function since we will be providing the paths of both cascade classifiers now:
def detectionUsingCascades(imageFile, cascadeFile1, \ cascadeFile2):
- Load the image and create a copy of it:
image = cv2.imread(imageFile) ...