Chapter 1. Setting Up Software and Hardware
Every year since 2007, the iPhone has spawned a new generation of hardware, and eager buyers have queued up outside their local Apple Store to get it. The iPhone and iPad have become centerpieces of consumer culture, promising instant gratification, timely information, and easy achievements. Apps are designed for retirees, working people, job hunters, vacationers, students, gamers, hospital patients, babies, and cats. Like a Swiss Army knife, an iPhone is a premium product that supposedly prepares the user for all kinds of contingencies. Moreover, the iPhone is a fashion item and sometimes inspires idiosyncratic behavior. For example, it enables the user to share large numbers of selfies and pictures of lunch.
As software developers and scholars of computer vision, we need to think a bit harder about the iPhone, the iPad, and their cameras. We need to make preparations before we can properly use these versatile tools in our work. We also need to demystify Apple's proprietary systems and appreciate the role of open source, cross-platform libraries such as OpenCV. Apple provides a fine mobile platform in iOS, but computer vision is not a fundamental part of this platform. OpenCV uses this platform efficiently but adds a layer of abstraction, providing high-level functionality for computer vision.
This chapter is the primer for the rest of the book. We assume that you already have a computer running Mac OS 10.10 (or a later version) as well as an iPhone, iPad, or iPod Touch running iOS 9 (or a later version). We will take the following steps to prepare a workspace and learn good habits for our future projects:
- Set up Apple's standard tools for iOS developers, which include Xcode, iOS SDK, and Xcode Command Line Tools.
- Set up OpenCV 3.1 (or a later version) for iOS. We have the option to use a standard, prebuilt version or a custom-built version with extra functionality.
- Develop a minimal application that uses the iOS SDK and OpenCV to display an image with a special effect.
- Join Apple's iOS Developer Program and obtaining permission to distribute an application to other users to test.
- Find documentation and support for the iOS SDK and OpenCV.
- Learn about the kinds of lights, tripods, and lens attachments that may enable us to capture specialized images with an iPhone or iPad.
By the end of this chapter, you will possess the necessary software and skills to build a basic OpenCV project for iOS. You will also have a new appreciation of your iPhone or iPad's camera as a tool for scientific photography and computer vision.