1
Introduction
Analysis of images has been a growing field of science and application for several decades. As computers become more powerful, the ability to process and analyze images increases. Furthermore, the process of collecting digital data has become trivial as the proliferation of smart phones to almost every society provides individuals with the means to quickly gather gigabytes of digital image information.
While the ability to analyze images has been increasing, the ability to communicate these processes has been stagnate. Traditional sciences, such as physics and chemistry, have a standardized language. Physicists from one part of the world can quickly scan equations written by physicists in another part of the world and understand the message, often without requiring definitions. Independent of their institute of education, physicists understand that
represents time dilation in a relativistic system. Furthermore, the language is so universally standardized that they also understand that
The language of the field is known worldwide, and hence communication of the concept does not require the recipient to dig into a text to understand what each variable represents. Because they are knowledgeable of the field, the communication is compact and precise.
The field of image analysis does not enjoy this efficiency. Papers in the same journal will display different mathematics to describe similar phenomena. The reader is thus required to reset their understanding of the mathematics to read about similar concepts. Often, authors resort to textual descriptions of their protocols instead of equations, leading to imprecise descriptions of their methods. Replication of their published process may require some guesswork since the descriptions lack complete clarity.
Compounding this issue is the growing collection of scripting languages and tools. Several decades ago, researchers would have to write several lines of code to perform a certain process because libraries were scant. Today, freely available languages come with powerful toolkits. Programmers now need only a few lines to perform those same image analysis tasks. The issue that arises is that quite often, the amount of real estate required to write the program is much less than the amount of real estate used to describe the same process. In the 1990s, Wilson and Ritter developed a mathematical language for image processing that was coincident with a C++ set of tools. This culminated in an image algebra [34]. New languages and toolkits, though, have surfaced since then, and the need for a common language is even greater than it was before.
The main goal of this book is to introduce a mathematical language for image analysis processes that is precise, compact, and matches well with modern scripting languages. Of course, several protocols and examples will be used to describe the language. There are also two appendices that contain organized descriptions of the operators to use as references.
1.1 Scripting in Python
Multiple scripting and programming languages exist that are suitable for image processing. One of the most popular languages is Python, which is also freely available. So, it is the language used in this text. The rest of this chapter reviews elements of Python that are useful for the subsequent chapters; however, by no means is this chapter intended on being a comprehensive description of Python.
1.2 Installation
Python has evolved as several contributors provide useful libraries. Now distributions exist that contain suites of these useful packages and powerful editors. One such distribution is Anaconda [13], which contains multiple editors (Spyder, IDLE, and Jupyter). Anaconda provides all the tools used in this text except that are written by the author. Readers will not be required to install third-party software.
1.2.1 Example Codes
Examples will be provided for many topics throughout the chapters such as seen in Code 1.1. Line 1 begins with the comment character (#) and the name of the file that contains the following funct...