MIN-Faculty
Department of Informatics
Scene analysis and visualization (SAV)

Digital image processing using ittvis IDL and VIGRA = VIGRAIDL

Description of the interface

In IDL it is quite easy to called external C-Code, that is program code that is not written with IDL itself. That is why we have chosen the CALL_EXTERNAL interface for the VIGRAIDL. With this interface you can add the algorithms of C-conform dynamic libraries (e.g. under Windows: DLLs, under MacOSX: dylibs) to your IDL program at runtime and use them right out-of-the-box. Obviously we connect IDL to the VIGRA_C library as the VIGRA itself does not offer a dynamic C-library containing all algorithms. We also hide the low-level calls from the user in that way, that the user can only see the tiny IDL functions and does not have to care about conversion to pointers or memory allocation.

Datastructures

Another important question is the representation of an image inside the IDL environment. We have chosen the built-in type array (of course the two-dimensional one), where the first dimension is of [0...width-1] and the second dimension isof [0...height-1] and the value of a pixel is of type "float". Right now, there is no representation for multi-channel-images.
The following table lists all functions, that are offered by the VIGRAIDL:

vigraidl_logo

vigraidl.impex

vigraidl.imgproc

vigraidl.filters

vigraidl.segmentation

vigraidl.morphology

loadimage

saveimage

resizeimage

rotateimage

affinewarpimage

reflectimage

fouriertransform

gsmooth

ggradient

laplacianofgaussian

gsharpening

sharpening

nonlineardiffusion

distancetransform

labelimage

watersheds

cannyedgeimage

differenceofexponentialedgeimage

regionimagetocrackedgeimage

erodeimage

dilateimage

openingimage = erodeimage + dilateimage

closingimage = dilateimage + erodeimage

Examples

Embedding of the VIGRAIDL into IDL: Change into the directory and compile the VIGRAIDL (after that, IDL knows all necessary functions of the binding to th VIGRA)

IDL> CD, "/path/to/vigraidl",CURRENT=old_dir  
IDL> .COMPILE vigraidl

Afterwards you may want to load an image (here: "blox.gif"):

IDL> img = loadimage(vigraidl_path() + "blox.gif")

Smoothing the image with a Gaussian filter of sigma=3 save the result to img2:

IDL> img2 = gsmooth(img, 3.0)

Convert the smoothed image from image domain to frequency space using the FFT:

IDL> img3 = fouriertransform(img2)

As the image is just an IDL array, you can perform any IDL built-in procedure for array manipulation, if you want to!
You will find additional examples in the included "examples.pro" file.

Download & Installation

The current release (Version 0.1.0) can be downloaded here. It consists of the VIGRAIDL Component (in folder vigraidl) and of the necessary VIGRA_C files (in subfolder vigra_c) (see above for more informations).This release does not conatain the VIGRA itself.

Installation instructions for MacOS X:

Creating a dynamic library (vigra_c.dylib)
Just make the Makefile which is loacate at the subfolder "vigra_c". After successful make, there should be a file called "vigra_c.dylib" at the VIGRAIDL directory.

Installation instructions for Linux:

Creating a dynamic library (vigra_c.so)
There is currently no straightforward way for the compilation of a linux shared object. On the other hand, you should easily be able to make the necessary changes:

  1. Change the Makefile at folder "vigraidl/vigra_c" to create a C-compatible (-fPIC e.g.) shared object file at folder vigraidl.
  2. Change the vigraidl.pro file to search for the vigra_c.so file if the platform is Linux. Therefore look at line 2-4 .

Installation instructions for Windows:

Creating a dynamic library (vigra_c.dll)
You'll find a Visual Studio Projectfile in the subfolder "vigra_c\win32-msvc2005". Please make sure to set the right paths to the VIGRA (Lib & Include!) in the projects options and then compile the projectto create the DLL file. After the compilation, you should find a file called "vigra_c.dll" inside the Release folder. Please copy this DLL into the "vigraidl" folder.

Future Milestones:

  • Embedding of further VIGRA functions
  • Support of multi-channel images