threshold

[ XITE Reference Manual | XITE home ]

Name

threshold, thresholdSpOut - threshold a band with specified threshold

Syntax

 #include <xite/threshold.h>

 int threshold( IBAND b1, IBAND b2, int t );

 int thresholdSpOut( IBAND b1, IBAND b2, int t,
    int lpv, int hpv );

Description

threshold and thresholdSpOut thresholds b1 into b2 with threshold t.

 if (b1[x,y] LE t) b2[x,y] = lpv; else b2[x,y] = hpv;

threshold uses 0 for low pixel value (lpv) and 255 for high pixel value (hpv), while thresholdSpOut uses the supplied arguments. Only largest common rectangle of b1 and b2 is thresholded. Accepts only UNS_BYTE pixles. Identical in- and out- parameters are legal. <lpv> and <hpv> should be in 1..255.

Return value

 0 => ok
 1 => Bad input pixel type
 2 => Bad output pixel type
 3 => Bad lpv value (only thresholdSpOut)
 4 => Bad hpv value (only thresholdSpOut)

Author

Tor L|nnestad, BLAB, IfI, UiO

Id

$Id: threshold.c,v 1.26 1996/11/08 14:06:13 svein Exp $