There are two crucial, complementary, issues faced during design and implementation of practically any but a simple image processing library. First is an ability to represent a variety of image types, typically the discriminate feature being the pixel type, e.g. binary, short integer, long integer, or floating point. The second issue is implementation of image processing algorithms that will be able to operate on each of the supported image representations. In many traditional library designs this leads to reimplementation of the same algorithm many times, once for each possible image representation. Some attempts to alleviate this problem introduce elaborate schemes of dynamic pixel representation and registration. This results in single algorithm implementation, however, due to dynamic pixel registration, efficiency of these implementations is poor. In this paper, we investigate use of parameterized algorithms and design issues involved in implementing them in C++. We permit single expression of the algorithm to be used with any concrete representation of an image. Use of advanced features of C++ and object-oriented programming allow us to use static pixel representations, where pixel types are resolved during compile time instead of run time. This approach leads to very flexible and efficient implementations. We have both advantages: single algorithm implementation for numerous image representations, and best possible speed of execution.
|