thresMlApply

[ XITE Reference Manual | XITE home ]

Name

thresMlApply, thresMlAppScale, thresMlAppMean, thresMlAppMedian - routines that applies ml-thresholds.

Syntax

 #include <xite/thresMl.h>

 int thresMlAppScale( IBAND inband,
    IBAND outband, int* thresholds, int nt,
    double scale );

 int thresMlAppMean( IBAND inband,
    IBAND outband, int* thresholds, int nt,
    histogram histo );

 int thresMlAppMedian( IBAND inband,
    IBAND outband, int* thresholds, int nt,
    histogram histo );

Description

The thresMlApply routines apply a vector of thresholds (Multi-Level threshold) to a band inband giving outband. inband and outband may be identical.

thresMlAppScale gives all pixels below the first threshold value 0, all pixels between the first and the second: scale, then 2*scale,... If scale is too large (scale>255*nt) it is adjusted down to fit.

thresMlAppMean sets all pixels between two thresholds to the mean of all these pixels in the input band.

thresMlAppMedian sets all pixels between two thresholds to the median of all these pixels in the input band.

ntis the number of thresholds. thresholds is the vector of thresholds, indexable on 0..nt-1. scale is the scale factor. histo is the histogram of inband.

Restrictions

inband and outband must have pixel type unsigned byte.

See also

thresMl(1), histoCentroid(3), thresMlCentroid(3), thresMlCentroid(1), mkComCur(3), thresMlComCur(3), thresMlComCur(1), thresMlReddi(3), thresMlReddi(1), thresMlWaHa(3), thresMlWaHa(1)

Return value

 0 : Ok
 1 : Bad input pixel type
 2 : Bad output pixel type
 3 : nt is smaller than 1
 4 : scale is negative

Author

Tor Lønnestad, BLAB, Ifi, UiO

Id

$Id: thresMlApply.c,v 1.18 1997/01/14 13:05:12 svein Exp $