histoCentroid

[ XITE Reference Manual | XITE home ]

Name

histoCentroid - move histogram mass to local centroid iteratively

Syntax

 #include <xite/thresMl.h>

 int histoCentroid( histogram hin,
    histogram hout, int m, int method );

Description

Iteratively, histogram mass is moved to local centroid. The centroid is the MEAN inside a histogram window if method=0, the MEDIAN inside the window if method=1. The size of the histogram window is (2*m)+1. This procedure is repeated until no changes, or at most 100 iterations. The "clustered" histogram result is returned in hout.

Restrictions

 1 <= m <= 127
 method = 0 OR method = 1

See also

thresMl(1), thresMlAppScale(3), thresMlAppMean(3), thresMlAppMedian(3), thresMlApply(3), thresMlCentroid(3), thresMlCentroid(1), mkComCur(3), thresMlComCur(3), thresMlComCur(1), thresMlReddi(3), thresMlReddi(1), thresMlWaHa(3), thresMlWaHa(1)

Return value

 0 => ok
 1 => Warning: The procedure didn't converge in
               100 iterations
 2 => Error:   Bad m argument
 3 => Error:   Bad method argument

Reference

R. Wilson
"A Class of local centroid algorithms for classification and quantization in spaces of arbitrary dimension"Linkoping Univ, Internal Report LiTH-ISY-I-0610 (1983).

Author

Tor Lønnestad, BLAB, Ifi, UiO

Id

$Id: thresMlCentroid.c,v 1.25 1997/01/14 13:06:21 svein Exp $