Universitaet Koblenz-Landau

Universitaet Koblenz-Landau Fachbereich Informatik
Image Recognition Laboratory
Image Recognition Laboratory Download Page
Ansprechpartner (Email, Telefon)
Dokumentenbestand dieses Servers durchsuchen
Informationein und Hilfe zu diesem Server

Manual: Split and Merge (+Group)

The Algorithm

The split and merge algorithm works in three steps:
1) Split the image into homogenious regions (based on quadtrees; it splits if following condition is true: if ((Vr + Vg + Vb)>=tv) then split, where V is the variance of region in one channel)
2) Merge regions (based on quadtrees; it merges regions if the following condition is true: if (|MRi-MRj|+|MGi-MGj|+|MGi-MGj|<=tm) then merge, where M is the mean color of region in one channel)
3) Group regions (region growing technique; it melts two regions if the following condition is true: if (|Mr-mr|+|Mg-mg|+|Mb-mb|<=tg) then group, where M and m is the mean color of the two regions in one channel)

For a detailed description how the algorithm works see:
Stabile, echtzeitfaehige Farbbildverarbeitung,
Volker Rehrmann, Foelbach 1994, page 42ff

Author: Dirk Balthasar, 2002, Universitšt Koblenz-Landau


The zip archives segmentation-linux-1-0.zip and segmentation-windows-1-0.zip contain each the binary version of the command line tool segmentation. With the command line tool segmentation you are able to make segmentations of color images with the recursive histogram splitting and split and merge algorithm. The 'segmentation' needs as input a color image in PPM-Format (Portable Pixmap in binary format with magic number 'P6'). It produces two images: a region image that stores for each pixel the average color of its region and a labeled image that stores for each pixel a label number of its region.


Syntax: segmentation [options] smg "name_of_input_image" "name_of_region_image" "name_of_labeled_image" \param \param tm threshhold for merging \param tg threshhold for grouping

Options Reference:

-tv >=0:Threshhold for split. Higher values for tv results less splitting of regions. (default = 25)
-tm >=0:Threshhold for merge. Higher values for tm means less merging of regions. (default = 25)
-tg >=0:Threshhold for group. Higher values for tg results more merged regions. (0 means disabled, default = 16)
-debug :The program creates a quadtree of splitted and merged regions which can be viewed with graphviz.


Suppose you want to make SMG segmentation of an color image with name example.ppm. First be sure that your color image is in PPM graphics format and the PPM file has the magic number P6. The command
segmentation -tv 25 -tm 25 -tg 16 smg example.ppm region.ppm region.pgm
will produce a region image with name region.ppm containing the mean color of each region in the ppm format and a label image with the name region.pgm.

Editor: Dirk Balthasar
Letzte Änderung: 15.07.2002