Book contents
- Frontmatter
- Dedication
- Contents
- Preface
- For the Instructor
- Part I Preliminaries
- 1 Computer Vision, Some Definitions, and Some History
- 2 Writing Programs to Process Images
- 3 Review of Mathematical Principles
- 4 Images: Representation and Creation
- Part II Preprocessing
- Part III Image Understanding
- Part IV The 2D Image in a 3D World
- A Support Vector Machines
- B How to Differentiate a Function Containing a Kernel Operator
- C The Image File System (IFS) Software
- Author Index
- Subject Index
- References
2 - Writing Programs to Process Images
from Part I - Preliminaries
Published online by Cambridge University Press: 25 October 2017
- Frontmatter
- Dedication
- Contents
- Preface
- For the Instructor
- Part I Preliminaries
- 1 Computer Vision, Some Definitions, and Some History
- 2 Writing Programs to Process Images
- 3 Review of Mathematical Principles
- 4 Images: Representation and Creation
- Part II Preprocessing
- Part III Image Understanding
- Part IV The 2D Image in a 3D World
- A Support Vector Machines
- B How to Differentiate a Function Containing a Kernel Operator
- C The Image File System (IFS) Software
- Author Index
- Subject Index
- References
Summary
Computer Science is not about computers any more than astronomy is about telescopes.
– E.W. DijkstraIntroduction
One may take two approaches to writing software for image analysis, depending on what one is required to optimize. One may write in a style that optimizes/minimizes programmer time, or one may write to minimize computer time. In this course, computer time will not be a concern (at least not usually), but your time will be far more valuable. For that reason, we want to follow a programming philosophy that produces correct, operational code in a minimal amount of programmer time. The programming assignments in this book are specified to be written in C or C++, rather than in MATLAB or JAVA. This is a conscious and deliberate decision. MATLAB in particular hides many of the details of data structures and data manipulation from the user. Most of the time, that's a good thing. However, in the course of teaching variations of this course for many years, the authors have found that many of those details are precisely the details that students need to grasp in order to effectively understand what image processing (particularly at the pixel level) is all about.
In this book, at least initially, we want the students to write code that works at the pixel level, so they come to understand what the computer is really doing. Later in the course, the student will slowly move up in levels of abstraction. We point the reader to [2.2, 2.1] for texts that emphasize the use of MATLAB.
Basic Programming Structure for Image Processing
Images may be thought of as two- or three-dimensional arrays. They are usually processed pixel-by-pixel in a raster scan. In order to manipulate an image, two- or three-nested for-loops is the most commonly used programming structure, as shown in Figures 2.1 and 2.2.
In these examples, we use two or three integers (row, col, and frame) as the indices to the row, column, and frame of the image. By increasing row, col, and frame with a step one, we are actually scanning the image pixel-wise from left to right, top to bottom, frame by frame.
- Type
- Chapter
- Information
- Fundamentals of Computer Vision , pp. 11 - 15Publisher: Cambridge University PressPrint publication year: 2017