Book Image

OpenCV for Secret Agents

By : Joseph Howse
Book Image

OpenCV for Secret Agents

By: Joseph Howse

Overview of this book

Table of Contents (15 chapters)
OpenCV for Secret Agents
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Planning the Goldgesture app


Goldgesture is a GUI app built with the Android SDK and OpenCV's Java bindings for Android. It has just a single view, as shown in the screenshot on the next page. The app has the following flow of execution:

  1. The app constantly displays a live video feed from the front-facing (self-portrait) camera.

  2. It performs human face detection using OpenCV's CascadeClassifier class.

  3. When a human face is detected:

    1. It draws a blue rectangle around the face.

    2. It detects features of the face (points that should be easy to track in subsequent frames despite movement) using OpenCV's goodFeaturesToTrack function. It then draws green circles around these features.

  4. As the face moves, the app tracks the features in every frame using OpenCV's calcOpticalFlowPyrLK function. This function can continuously track the features even though CascadeClassifier is unlikely to continuously detect a face.

  5. When the features' center point moves up and down by a certain amount and a certain number of times...