Skip to Content
Hands-On Robotics Programming with C++
book

Hands-On Robotics Programming with C++

by Dinesh Tavasalkar
March 2019
Intermediate to advanced
312 pages
7h 37m
English
Packt Publishing
Content preview from Hands-On Robotics Programming with C++

Detecting the eyes

The SmilingFace.cpp program is basically an extension of the FaceDetection.cpp program, meaning that we will first find the region of interest, which is the face. Next, using the Haar CascadeClassifier for the eyes, we will detect the eyes and then draw circles around them.

Before writing the program, let's first understand the different eye CascadeClassifier that are available. OpenCV 4.0 has three main eye cascade classifiers:

  • haarcascade_eye.xml: This classifier will detect both of the eyes simultaneously
  • haarcascade_lefteye_2splits.xml: This classifier will detect only the left eye
  • haarcascade_righteye_2splits.xml: This classifier will detect only the right eye

Depending on your requirements, you can use the haarcascade_eye ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Robotics Programming

Learn Robotics Programming

Danny Staple
C++ Reactive Programming

C++ Reactive Programming

Praseed Pai, Peter Abraham

Publisher Resources

ISBN: 9781789139006Supplemental Content