Book Image

Mastering OpenCV Android Application Programming

Book Image

Mastering OpenCV Android Application Programming

Overview of this book

Table of Contents (16 chapters)
Mastering OpenCV Android Application Programming
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
6
Working with Image Alignment and Stitching
Index

Project – Happy Camera


Practice is better than theory. It's time to apply your learning from this chapter and build a cool camera application, which automatically clicks a picture when it detects smiling faces.

The trick is that we will use two different types of cascade classifiers. First, we will use Haar cascades to find faces on the image and store the positions of all the faces. Then we will use the Haar cascades to detect smiles in an image and store them. Now we try to match the face with a smile. For each smile, we find the corresponding face in the image. This is simple: if the smiling region is within any detected face region, we say that it's a match.

After locating all the smiling faces in the image, find the ratio of the smiling faces to all faces to nonsmiling faces, and if that ratio is greater than a certain threshold we say that it's a happy picture and click the image. Though one thing to note here is the ratio that we are using. We can use a different metric to tag an image...