Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
OpenCV for Secret Agents

You're reading from  OpenCV for Secret Agents

Product type Book
Published in Jan 2015
Publisher Packt
ISBN-13 9781783287376
Pages 302 pages
Edition 1st Edition
Languages
Author (1):
Joseph Howse Joseph Howse
Profile icon Joseph Howse

Table of Contents (15) Chapters

OpenCV for Secret Agents
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Preparing for the Mission Searching for Luxury Accommodations Worldwide Training a Smart Alarm to Recognize the Villain and His Cat Controlling a Phone App with Your Suave Gestures Equipping Your Car with a Rearview Camera and Hazard Detection Seeing a Heartbeat with a Motion Amplifying Camera Creating a Physics Simulation Based on a Pen and Paper Sketch Index

Tracking back and forth gestures


Several common gestures consist of a repetitive, back and forth movement. Consider the following examples of this type of gesture:

  • Nodding (yes or I'm listening)

  • Shaking one's head (no or dismay)

  • Waving (a greeting)

  • Shaking hands (a greeting)

  • Shaking one's fist (a threat or a protest)

  • Wagging a finger (scolding)

  • Wiggling a finger or fingers (beckoning)

  • Tapping one's foot against the ground (impatience)

  • Tapping four fingers against a table (impatience)

  • Tapping two fingers against a table ("Thanks for the green tea")

  • Pacing (anxiety)

  • Jumping up and down (excitement, joy)

To help us recognize such gestures, let's write a class, BackAndForthGesture, which keeps track of the number of times that a value (such as an x coordinate or a y coordinate) has oscillated between a low threshold and a high threshold. A certain number of oscillations can be considered as a complete gesture.

Create a file, src/BackAndForthGesture.java. As a member variable, BackAndForthGesture will store...

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}