The notion of “site” provides an abstract description for any
kind of position within an image. For instance, a site might
be an n-uplet for an N-d image, a node within a graph, etc.
Climb also provides a way to represent the regions of an
image through the site-set object. This object is used in or-
der to browse a set of coordinates and becomes particularly
handy when dealing with neighborhoods. For instance, the
set of nearest neighbors, for a given site, would be a list of
coordinates around a point for an N-d image, or the con-
nected nodes in a graph.
4.3 Genericity on implementations
Both of the kinds of genericity described previously allow
algorithm implementers to produce a single program that
works with any data type. Some algorithms, however, may
be implemented in different ways when additional informa-
tion on the underlying image structure is available. For in-
stance, iterators may be implemented more efficiently when
we know image contents are stored in an array. We can also
distinguish the cases where a 2D image is stored as a matrix
or a 1D array of pixels etc.
Climb provides a property description and filtering system
that gives a finer control over the algorithm selection. This is
done by assigning properties such as :dimension = :1D, :2D,
etc. to images. When defining functions with the defalgo
macro, these properties are handled by the dispatch system.
The appropriate version of a function is selected at runtime,
depending on the properties implemented by the processed
image.
5. CONCLUSION
Climb is a generic Image Processing library written in Com-
mon Lisp. It is currently architected as two layers targeting
two different kinds of users.
• For an image processing practitioner, Climb provides
a set of built-in algorithms, composition tools such as
the chaining operator and morphers to simplify the
matching of processed data and algorithms IO.
• For an algorithm implementer, Climb provides a very
high-level domain model articulated around three lev-
els of abstraction. Genericity on values (RGB, Grayscale
etc.), genericity on structures (sites, site sets) and gener-
icity on implementations thanks to properties.
The level of abstraction provided by the library makes it
possible to implement algorithms without any prior knowl-
edge on the images to which they will be applied. Conversely
supporting a new image types should not have any impact
on the already implemented algorithms.
From our experience, it appears that Common Lisp is very
well suited to highly abstract designs. The level of generic-
ity attained in Climb is made considerably easier by Lisp’s
reflexivity and CLOS’ extensibility. Thanks to the macro
system, this level of abstraction can still be accessed in a rel-
atively simple way by providing domain-specific extensions
(e.g. the chaining operators).
Although the current implementation is considered to be
reasonably stable, Climb is still a very young project and
should be regarded as a prototype. In particular, nothing
has been done in terms of performance yet, as our main focus
was to design a very generic and expressive API. Future work
will focus on:
Genericity By providing new data types like graphs, and
enhancing the current property system.
Usability By extending the $ macro with support for au-
tomatic insertion of required morphers and offering a
GUI for visual programming of complex Image Pro-
cessing chains.
Performance By improving the state of the current im-
plementation, exploring property-based algorithm op-
timization and using the compile-time facilities offered
by the language.
Climb is primarily meant to be an experimental platform
for exploring various generic paradigms from the dynamic
languages perspective. In the future however, we also hope
to reach a level of usability that will trigger interest amongst
Image Processing practitioners.
6. REFERENCES
[1] Th. G´eraud and R. Levillain. Semantics-driven
genericity: A sequel to the static C++ object-oriented
programming paradigm (SCOOP 2). In Proceedings of
the 6th International Workshop on Multiparadigm
Programming with Object-Oriented Languages
(MPOOL), Paphos, Cyprus, July 2008.
[2] R. Levillain, Th. G´eraud, and L. Najman. Why and
how to design a generic and efficient image processing
framework: The case of the Milena library. In
Proceedings of the IEEE International Conference on
Image Processing (ICIP), pages 1941–1944, Hong Kong,
Sept. 2010.
[3] F. Meyer. Un algorithme optimal pour la ligne de
partage des eaux, pages 847–857. AFCET, 1991.
[4] N. Otsu. A threshold selection method from gray-level
histograms. IEEE Transactions on Systems, Man and
Cybernetics, 9(1):62–66, Jan. 1979.
[5] J. Sauvola and M. Pietik
¨
ainen. Adaptive document
image binarization. Pattern Recognition, 33(2):225–236,
2000.
[6] P. Soille. Morphological Image Analysis: Principles and
Applications. Springer-Verlag New York, Inc., Secaucus,
NJ, USA, 2 edition, 2003.