thresMlCentroid

[ XITE Reference Manual | XITE home ]

Contents


Name

thresMlCentroid - multi level thresholding by local centroid method

Syntax

 thresMlCentroid [-m <m>] [-mean] [-median] [-eq] [-s <s>]
                 <inimage> [<output>]

Description

For every band, the histogram is calculated. Then the histogram is modified by moving histogram mass to the local centroid of a histogram window of size (2*m)+1. The mapping from old to new histogram is analyzed, corresponding thresholds are calculated, and if an output image is specified, the input image is thresholded. If no output image is specified, the obtained thresholds are written to standard output.

Options

-m m
Use histogram window of size (2*m)+1.

-mean
Move histogram mass to local mean (default).

-median
Move histogram mass to local median.

-eq
If outimage is given, distriibute output pixel values.

-s s
If outimage is given, scale pixel values with s.

Use either -mean or -median (or none), not both. If no m argument is given, a loop over the m-values 5, 10, 15, 20, 25, 30, 35, 40, 45 and 50 is performed, exiting if two consecutive runs give the same thresholding result.

See also

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

Diagnostics

 Warning: Bad pixel type in band ..
 Warning: Clustering never stable
 Error  : Bad m value: ..
 Error  : Bad number of arguments

Restrictions

inimage must have bands with pixel type unsigned byte. Bands are handled one at a time, not multi-dimensionally.

Reference

[1] R. Wilson. H Knutsson and G.H. Granlund
"The operational definition of the position of line and edge" Proc. ICPR-82, Munich 1982.

[2] 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

Examples

 thresMlCentroid -median mona.img
 thresMlCentroid -mean -eq mona.img res.img
 thresMlCentroid  -s 2 -m 25 mona.img res.img
 thresMlCentroid  -verbose mona.img

Id

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