Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Computer Vision Workshop

You're reading from  The Computer Vision Workshop

Product type Book
Published in Jul 2020
Publisher Packt
ISBN-13 9781800201774
Pages 568 pages
Edition 1st Edition
Languages
Authors (3):
Hafsa Asad Hafsa Asad
Profile icon Hafsa Asad
Vishwesh Ravi Shrimali Vishwesh Ravi Shrimali
Profile icon Vishwesh Ravi Shrimali
Nikhil Singh Nikhil Singh
Profile icon Nikhil Singh
View More author details
Toc

5. Face Processing in Image and Video

Activity 5.01: Eye Detection Using Multiple Cascades

Solution:

Perform the following steps to complete this activity:

  1. Open your Jupyter notebook and create a new file called 
ctivity5.01.ipynb. Write your code in this file.
  2. Import the required libraries:
    import cv2
    import numpy as np
  3. 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.
  4. Revise the arguments of the function since we will be providing the paths of both cascade classifiers now:
    def detectionUsingCascades(imageFile, cascadeFile1, \
                               cascadeFile2):
  5. Load the image and create a copy of it:
        image = cv2.imread(imageFile)
       ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}