thresMlCentroid
[ XITE Reference Manual | XITE home ]
Name
thresMlCentroid - multi level thresholding by local centroid method
Syntax
#include <xite/thresMl.h>
int thresMlCentroid( histogram histo,
histogram thres, int m, int method,
int* nt );
Description
Finds multi level thresholds.
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 mapping from old to new histogram is analyzed,
corresponding thresholds are calculated, and returned.
histo is the input band histogram, thres is the output
histogram to receive thresholds. nt will return the number
of thresholds.
If m=0, the above process is repeated in a loop over the
m-values 5, 10, 15, 20, 25, 30, 35, 40, 45 and 50, exiting
if two consecutive runs give the same thresholding result.
At return, thres can be indexed on 0..nt-1.
Restrictions
Histogram is defined on 0..255.
See also
thresMl(1), thresMlAppScale(3), thresMlAppMean(3),
thresMlAppMedian(3), thresMlApply(3), histoCentroid(3),
thresMlCentroid(1), mkComCur(3), thresMlComCur(3),
thresMlComCur(1), thresMlReddi(3), thresMlReddi(1),
thresMlWaHa(3), thresMlWaHa(1)
Return value
0 => ok
2 => Bad m value
3 => Bad method value
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 $