segmSpannWilson

[ XITE Reference Manual | XITE home ]

Contents


Name

segmSpannWilson - segmentation by the Spann and Wilson method

Syntax

 #include <xite/segmentation.h>

 BiffStatus segmSpannWilson( IBAND inband,
    IBAND outband, int n, int m, int method );

Description

Performs segmentation of the input band into the output band. The algorithm has three steps:

Quad-tree smoothing

A quad-tree is created, and pixels are averaged 4 by 4 up in the quad-tree. n quad-tree levels are created, including the bottom level, which is inband.

Local centroid clustering

The topmost quad-tree level is clustered by moving histogram mass to the centroid (mean or median) of a local window moved over the histogram. Applied iteratively, until stable. See thresMlCentroid.

Boundary estimation

The classification result is copied down the quad-tree, but at every level, all pixels close to a differently classified pixel are reclassified to determine the border more precisely.

Arguments

inband
Input band to be segmented.

outband
The result of the segmentation.

n
Levels in the quad-tree (must be at least two).

m
Size of histogram window, like 10-20.

method
Local centriod clustering: 0 -> mean, 1 -> median.

Note that if you specify histogram window size m=0, the algorithm will try to find an m-value where the clustering result is relatively stable over a range of m-values.

Restrictions

inband and outband must have pixel type unsigned byte. outband should have the same size as inband. Only the largest common rectangle of inband and outband is handled.

See also

segmSpannWilson(1), thresMlCentroid(3), segmRandom(3)

Reference

M. Spann and R. Wilson,
"A Quad-Tree Approach to Image Segmentation which Combines Statistical and Spatial Information" Patteren Recognition, Vol 18, Nos 3/4, pp 257-269, 1985

Return value

 0 => ok
 2 => error: bad inband pixel type
 3 => error: bad outband pixel type
 4 => error: bad n value
 5 => error: bad m value
 6 => error: bad method value

Author

Tor Lønnestad, BLAB, Ifi, UiO

Id

$Id: segmSpannWilson.c,v 1.25 1997/01/16 16:08:53 svein Exp $