Preface

Computer vision systems are deployed in the Arctic Ocean to spot icebergs at night. They are flown over the Amazon rainforest to create aerial maps of fires, blights, and illegal logging. They are set up in ports and airports worldwide to scan for suspects and contraband. They are sent to the depths of the Marianas Trench to guide autonomous submarines. They are used in operating rooms to help surgeons visualize the planned procedure and the patient's current condition. They are launched from battlefields as the steering systems of heat-seeking, anti-aircraft rockets.

We might seldom—or never—visit these places. However, stories often encourage us to imagine extreme environments and a person's dependence on tools in these unforgiving conditions. Perhaps fittingly, one of contemporary fiction's most popular characters is an almost ordinary man (handsome but not too handsome, clever but not too clever) who wears a suit, works for the British Government, always chooses the same drink, the same kind of woman, the same tone for delivering a pun, and is sent to do dangerous jobs with a peculiar collection of gadgets.

Bond. James Bond.

This book teaches seriously useful technologies and techniques with a healthy dose of inspiration from spy fiction. The Bond franchise is rich in ideas about detection, disguise, smart devices, image capture, and sometimes even computer vision specifically. With imagination, plus dedication of learning new skills, we can become the next generation of gadget makers to rival Bond's engineer, Q!

Chapter 1, Preparing for the Mission helps us to install OpenCV, a Python development environment, and an Android development environment on Windows, Mac, or Linux systems. In this chapter, we also install a Unity development environment on Windows or Mac.

Chapter 2, Searching for Luxury Accommodations Worldwide helps us to classify images of real estate based on color schemes. Are we outside a luxury dwelling or inside a Stalinist apartment? In this chapter, we use the classifier in a search engine that labels its image results.

Chapter 3, Training a Smart Alarm to Recognize the Villain and His Cat helps us to detect and recognize human faces and cat faces as a means of controlling an alarm. Has Ernst Stavro Blofeld returned with his blue-eyed Angora cat?

Chapter 4, Controlling a Phone App with Your Suave Gestures helps us to detect motion and recognize gestures as a means of controlling a guessing game on a smartphone. The phone knows why Bond is nodding even if no one else does.

Chapter 5, Equipping Your Car with a Rearview Camera and Hazard Detection helps us to detect car headlights, classify their color, estimate distances to them, and provide feedback to a driver. Is that car tailing us?

Chapter 6, Seeing a Heartbeat with a Motion Amplifying Camera helps us to amplify motion in live video, in real time, so that a person's heartbeat and breathing become clearly visible. See the passion!

Chapter 7, Creating a Physics Simulation Based on a Pen and Paper Sketch helps us to draw a ball-in-a-maze puzzle on paper and see it come to life as a physics simulation on a smartphone. Physics and timing are everything!