Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenCV 4 for Secret Agents

You're reading from   OpenCV 4 for Secret Agents Use OpenCV 4 in secret projects to classify cats, reveal the unseen, and react to rogue drivers

Arrow left icon
Product type Paperback
Published in Apr 2019
Publisher Packt
ISBN-13 9781789345360
Length 336 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Joseph Howse Joseph Howse
Author Profile Icon Joseph Howse
Joseph Howse
Arun Ponnusamy Arun Ponnusamy
Author Profile Icon Arun Ponnusamy
Arun Ponnusamy
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Section 1: The Briefing FREE CHAPTER
2. Preparing for the Mission 3. Searching for Luxury Accommodations Worldwide 4. Section 2: The Chase
5. Training a Smart Alarm to Recognize the Villain and His Cat 6. Controlling a Phone App with Your Suave Gestures 7. Equipping Your Car with a Rearview Camera and Hazard Detection 8. Creating a Physics Simulation Based on a Pen and Paper Sketch 9. Section 3: The Big Reveal
10. Seeing a Heartbeat with a Motion-Amplifying Camera 11. Stopping Time and Seeing like a Bee 12. Making WxUtils.py Compatible with Raspberry Pi
13. Learning More about Feature Detection in OpenCV
14. Running with Snakes (or, First Steps with Python)
15. Other Books You May Enjoy

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 y coordinate) has oscillated between a low threshold and a high threshold. A certain number of...

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 $19.99/month. Cancel anytime
Banner background image