Preface

SimpleCV is a framework for use with Python. Python is a relatively easy language to learn. For individuals who have no programming experience, Python is a popular language for introductory computer and web programming classes. There are a wealth of books on programming in Python and even more free resources available online. For individuals with prior programming experience but with no background in Python, it is an easy language to pick up.

As the name SimpleCV implies, the framework was designed to be simple. Nonetheless, a few new vocabulary items come up frequently when designing vision systems using SimpleCV. Some of the key background concepts are described below:

Computer Vision

The analyzing and processing of images. These concepts can be applied to a wide array of applications, such as medical imaging, security, autonomous vehicles, and so on. It often tries to duplicate human vision by using computers and cameras.

Machine Vision

The application of computer vision concepts, typically in an industrial setting. These applications are used for quality control, process control, or robotics. These are also generally considered the “solved” problems. However, there is no simple dividing line between machine vision and computer vision. For example, some advanced machine vision applications, such as 3D scanning on a production line, may still be referred to as computer vision.

Tuple

A list with a pair of numbers. In Python, it is written enclosed in parentheses. It is often used when describing (x, y) coordinates, the width and height of an object, or other cases where there is a logical pairing of numbers. It has a slightly more technical definition in mathematics, but this definition covers its use in this book.

NumPy Array or Matrix

NumPy is a popular Python library used in many scientific computing applications, known for its fast and efficient algorithms. Since an image can also be thought of as an array of pixels, many bits of processing use NumPy’s array data type. When an array has two or more dimensions, it is sometimes called a Matrix. Although intimate knowledge of NumPy is not needed to understand this book, it is useful from time to time.

Blob

Blobs are contiguous regions of similar pixels. For example, in a picture detecting a black cat, the cat will be a blob of contiguous black pixels. They are so important in computer vision that they warrant their own chapter. They also pop up from time to time throughout the entire book. Although covered in detail later, it is good to at least know the basic concept now.

JPEG, PNG, GIF, or other image formats

Images are stored in different ways, and SimpleCV can work with most major image formats. This book primarily uses PNG’s, which are technically similar to GIF’s. Both formats can potentially use non-lossy compression, which essentially means that the image quality is not changed in the process of compressing it. This creates a smaller image file without reducing the quality of the image. Some examples also use JPEG’s. This is a form of lossy compress, which results in even smaller files, but at the cost of some loss of image quality.

PyGame

PyGame appears from time to time throughout the book. Like NumPy, PyGame is a handy library for Python. It handles a lot of window and screen management work. This will be covered in greater detail in the Drawing chapter. However, it will also pop up throughout the book when discussing drawing on the screen.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Tip

This icon signifies a tip, suggestion, or general note.

Caution

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Practical Computer Vision with SimpleCV by Kurt Demaagd, Anthony Oliver, Nathan Oostendorp, and Katherine Scott (O’Reilly). Copyright 2012 Ingenuitas, 978-1-449-32036-2.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari® Books Online

Note

Safari Books Online (www.safaribooksonline.com) is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.

Safari Books Online offers a range of product mixes and pricing programs for organizations, government agencies, and individuals. Subscribers have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and dozens more. For more information about Safari Books Online, please visit us online.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://oreil.ly/CompVision_SCV

To comment or ask technical questions about this book, send email to:

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Get Practical Computer Vision with SimpleCV now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.