Free Sample
+ Collection

OpenCV for Secret Agents

Joseph Howse

Use OpenCV in six secret projects to augment your home, car, phone, eyesight, and any photo or drawing
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781783287376
Paperback302 pages

About This Book

  • Build OpenCV apps for the desktop, the Raspberry Pi, Android, and the Unity game engine
  • Learn real-time techniques that can be used to classify images, detecting and recognizing any person or animal, and studying motion and distance with superhuman precision
  • Design hands-free interfaces that are practical in home automation, in cars, and in discrete surveillance

Who This Book Is For

This book is for programmers who want to expand their skills by building fun, smart, and useful systems with OpenCV. The projects are ideal in helping you to think creatively about the uses of computer vision, natural user interfaces, and ubiquitous computers (in your home, car, and hand).

Table of Contents

Chapter 1: Preparing for the Mission
Setting up a development machine
Setting up Raspberry Pi
Finding OpenCV documentation, help, and updates
Alternatives to Raspberry Pi
Chapter 2: Searching for Luxury Accommodations Worldwide
Planning the Luxocator app
Creating, comparing, and storing histograms
Training the classifier with reference images
Acquiring images from the Web
Acquiring images from Bing image search
Preparing images and resources for the app
Integrating everything into the GUI
Building Luxocator for distribution
Chapter 3: Training a Smart Alarm to Recognize the Villain and His Cat
Understanding machine learning in general
Planning the Interactive Recognizer app
Understanding Haar cascades and LBPH
Implementing the Interactive Recognizer app
Planning the cat detection model
Implementing the training script for the cat detection model
Planning the Angora Blue app
Implementing the Angora Blue app
Building Angora Blue for distribution
Further fun with finding felines
Chapter 4: Controlling a Phone App with Your Suave Gestures
Planning the Goldgesture app
Understanding optical flow
Setting up the Eclipse Workspace
Getting a cascade file and audio files
Specifying the app's requirements
Laying out a camera preview as the main view
Tracking back and forth gestures
Playing audio clips as questions and answers
Capturing images and tracking faces in an activity
Chapter 5: Equipping Your Car with a Rearview Camera and Hazard Detection
Planning The Living Headlights app
Detecting lights as blobs
Estimating distances (a cheap approach)
Implementing The Living Headlights app
Testing The Living Headlights app at home
Testing The Living Headlights app in a car
Chapter 6: Seeing a Heartbeat with a Motion Amplifying Camera
Planning the Lazy Eyes app
Understanding what Eulerian video magnification can do
Extracting repeating signals from video using the Fast Fourier Transform (FFT)
Compositing two images using image pyramids
Implementing the Lazy Eyes app
Configuring and testing the app for various motions
Seeing things in another light
Chapter 7: Creating a Physics Simulation Based on a Pen and Paper Sketch
Planning the Rollingball app
Detecting circles and lines
Setting up OpenCV for Unity
Configuring and building the Unity project
Creating the Rollingball scene in Unity
Creating Unity assets and adding them to the scene
Tidying up and testing

What You Will Learn

  • Install OpenCV, a Python development environment, and an Android development environment on Windows, Mac, or Linux and install a Unity development environment on Windows or Mac
  • Get to grips with motion detection and gesture recognition as a means of controlling a guessing game on a smartphone
  • Detect car headlights, estimate distances to them, and provide feedback to the driver
  • Spot and recognize human faces and cat faces as a means of controlling an alarm
  • Amplify motion in real-time video so that a person's heartbeat and breathing become clearly visible
  • Draw a ball-in-a-maze puzzle on paper and see it come to life as a physics simulation on a smartphone
  • Integrate OpenCV with other libraries, as well as popular frameworks for GUI apps and games

In Detail

OpenCV is a grand collection of image processing functions and computer vision algorithms. It is open source, it supports many programming languages and platforms, and it is fast enough for many real-time applications. What a lot of gadgets we can build with such a handy library!

Taking inspiration from the world of James Bond, this book adds a spark of adventure and computer vision to your daily routine. Protect your home and car with intelligent camera systems that analyze people, cats, and obstacles. Let your search engine praise or criticize the images that it finds. Hear a voice from your phone that responds to your body language. Attune yourself to another person's rhythm by glancing at a display that magnifies a heartbeat or a breath. Learn OpenCV and see your world as never before.


Read More