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 Living Headlights app


For this app, we will return to the cross-platform wxPython framework. Optionally, we can develop and test our wxPython application on a Windows, Mac, or Linux desktop or laptop before deploying it to our Raspberry Pi computer in the car. With the Raspbian operating system, Raspberry Pi can run wxPython just as any Linux desktop could.

The GUI for The Living Headlights includes a live video feed, a set of controls where the user can enter the true distance to the currently imaged headlights, and a label that initially displays a set of instructions, as seen in the following screenshot:

When a pair of headlights is detected, the user must perform a one-time calibration step. This consists of entering the true distance between the camera and headlights (specifically, the midpoint between the headlights) and then clicking on the Calibrate button. Thereafter, the app continuously updates and displays an estimate of the headlights' distance and color, as seen...