Nelson Image Processing Libraries
Over the years I have accumulated a lot of image processing code using
an in-core image format.
Much of it is usable, and is organized into accessible libraries.
The best developed parts of it are the libraries libutility.a,
libimage.a libgraphics.a and libfeature.a in
/u/nelson/programs/lib/[SunOS | Solaris | DigitalUnix | PCLinux | PCLinux64].
What version you use depends on whether you are linking on an old SunOS
machine (few if any left), a Solaris Machine (only a few special purpose
machines around), an alpha machine (also defunct as of 2006)
a Linux PC box (running Fedora as of 2008), or a 64bit Linux PC box
(there are a few of these around, and likely we will see more of them soon).
There are also some programs that use these libraries to perform
some miscellaneous operations. The executables are in
/u/nelson/bin/[SunOS | Solaris | DigitalUnix | PCLinux | PCLinux64],
Source code is with the respective library sources, except in */bin instead
The utility library, libutility.a, contains routines for reading files in
and out of the core format, converting integer to floating-point images,
making masks, copying images, and managing the core storage.
The i/o routines will handle iff, pgm, tiff, jpg, and png (grayscale) images,
and modified iff, tiff, jpg, and png, color images.
jpg format uses 75% quality when writing.
I/O routines look at the file suffix, and if they see something
they recognize, use that format; otherwise they default to tiff.
There is also some support for io of (grayscale) image sequences,
represented as modified iff files, and more general image sequences
represented as a directory of sequentially named image files.
Source code for the utility library is in
For details on the library routines, and the basic data structures, see the
file in the corresponding lib directory which is a manual of sorts.
The image library, libimage.a, contains routines for various image
(convolution, scaling, local edge detection, morphology etc.)
A real grab bag.
What you need may not be there, but the routines might be
useful templates for creating your own operations.
Most of these functions operate on both grayscale and color
A few still do not; most of these silently operate on the first band of
a multiband image and produce a single-band output.
There are also some executable programs based on these routines.
Source code is in /u/nelson/programs/src/ipp/image/image_proc/[lib, bin].
For details on the library routines, see again the
file in the corresponding lib directory.
A program "image_calc" lets you play with many of the image processing
operations using a stack-based model of computation (so you can back up etc.)
You can play with some of the higher level segmentation routines
as well. It can perform a number of operations that xv cannot, and
is sometimes useful for experimenting with various image processing
Drawback is that it uses a keyboard command interface rather than
a menu-based GUI.
The graphics library, libgraphics.a uses the X11 C package to do simple
image display operations on your screen. This can be helpful for
debugging a program.
Display of gray-scale and color images, and of image sequences
on various sorts of displays, from 1 to 32 bits is currently supported.
There are a lot of possible ways of setting up a monitor. If
you run into a configuration where the basic image display doesn't work,
send me email and I may be able to fix it.
There are also some associated executables for displaying images, curve sets
Source is in /u/nelson/programs/src/ipp/graphics/*
There is a set of dummy graphics routines in here as well, which you can
probably ignore - they are there to allow higher-level code to be ported
to machines that don't have the X11 routines.
For details on the graphics library routines, see the
file in the corresponding lib directory
The feature library, libfeature.a, contains some fairly sophisticated
mid-level routines for finding curves and line segments,
regions (and some other stuff
that you probably won't have much use for) in an image.
There are associated executables for finding curves, line segments etc.
Source code is in /u/nelson/programs/src/ipp/feature/*
Finally, there are some useful programs for grabbing gray and color images
and image sequences, from the BT848 and ktv digitizers
The program bt_showlive can be used to display live video from the bt848
digitizers in the computational sensors, and to grab images and
The program bt_get_image allows you to get grayscale and color images
from the BT484-based digitizers.
Most of its original functionality has been subsumed by bt_showlive.
Should you run into a ktv digitizer (I think that all of ours are gone
as of 2008),
the programs ktv_get_image and ktv_get_color_image allows you to acquire
grayscale and color images from the ktv digitizer.
The program ktv_getiff_sequence will grab a sequence of (grayscale) images -
but not more than will fit in main memory, so it is somewhat limited.
The program ktv_showlive will display a live feed from the ktv digitizer
the camera on the monitor.
Both bt_showlive and ktv_showlive will work over the network if you set
your display appropriately.
The source code for these programs is in
Associated libraries contain, at the moment, only routines
for grabbing ipp-format core images from the digitizers.
In order to use these libraries and the image format, you have to
include the .h file corresponding to the library from the list
( utility.h image_proc.h graphics.h image_feature.h curve.h segment.h)
in your program, and link in the appropriate libraries, as well as the iff
You also need a bunch of system libraries, starting with the
X11 library, and libraries for various image formats.
Where these are depends on the operating system
For example the Xll library is in the following places for the specified
If you use the routines to read pgm format files, you need the
pgm libraries (/usr/lib/libnetpbm on Fedora).
For tiff, you need /usr/lib/[libtiff.a libjpeg.a and libz.a].
For jpg and png you need
/usr/lib/libjpeg.a and /usr/lib/libpng.a (on Fedora).
Note that I have specified static libraries. There are also dynamically
loaded versions of most of them, which you may get it you use the -l
compiler option, depending on how your defaults are set up.
One example of doing this, for a program called find_curves
(which uses everything mentioned) is the following Makefile fragment,
here set up for the Fedora Linux we use on most of the department machines.
INCDIRS = -I/usr/vision/include \\
CFLAGS = $(INCDIRS) -O
### Libraries. Order is important since functions
### in image.a depend on functions in utility.a
IPPLIBS = -L/u/nelson/programs/lib/SunOS -lfeature -lgraphics \
MISCLIB = -L/u/nelson/programs/lib/SunOS -lmisc.a
IFFLIB = -L/usr/vision/lib -liff
XLIB = -L/usr/staff/lib -lX11
PGM_LIBS = -L/usr/lib -lnetpbm
TIFF_LIBS = -L/usr/lib -ltiff -ljpeg -lz
PNG_LIBS = -L/usr/lib -lpng
JPG_LIBS = -L/usr/lib -ljpeg
LIBS = $(IPPLIBS) $(MISCLIB) $(IFFLIB) $(PGM_LIBS) \
$(TIFF_LIBS) $(PNG_LIBS) $(JPG_LIBS) $(XLIB) -lm
cc find_curves.o $(LIBS) -o find_curves
-lsunmath is needed on Solaris machines, since they dumped some of the
old -lm functions there for some reason.
There are other libraries with routines for motion extraction,
real-time tracking, and even object recognition which might be
useful for some applications.
They are also a little less well cooked, but feel free to
There is also a library of miscellaneous routines libmisc.a
(sorting, angular computations, etc).
These are needed in some of the feature-finding routines.
vision course main page