Page 27 -
P. 27
CHAPTER
1
Practical Aspects of a Vision
System—Image Display,
Input/Output, and Library Calls
When experimenting with vision- and image-analysis systems or implement-
ing one for a practical purpose, a basic software infrastructure is essential.
Images consist of pixels, and in a typical image from a digital camera there
will be 4–6 million pixels, each representing the color at a point in the
image. This large amount of data is stored as a file in a format (such as GIF
or JPEG) suitable for manipulation by commercial software packages, such
as Photoshop and Paint. Developing new image-analysis software means
first being able to read these files into an internal form that allows access to
the pixel values. There is nothing exciting about code that does this, and it
does not involve any actual image processing, but it is an essential first step.
Similarly, image-analysis software will need to display images on the screen
and save them in standard formats. It’s probably useful to have a facility for
image capture available, too. None of these operations modify an image but
simply move it about in useful ways.
These bookkeeping tasks can require most of the code involved in an
imaging program. The procedure for changing all red pixels to yellow, for
example, can contain as few as 10 lines of code; yet, the program needed to
read the image, display it, and output of the result may require an additional
2,000 lines of code, or even more.
Of course, this infrastructure code (which can be thought of as an application
programming interface,or API) can be used for all applications; so, once it is
developed, the API can be used without change until updates are required.
Changes in the operating system, in underlying libraries, or in additional
functionalities can require new versions of the API. If properly done, these
1