lvthresh(3)

LIBRARY ROUTINE
lvthresh - Create a binary image by applying upper and lower thresholds to an input image.

LIBRARY CALL
#include "vinclude.h"
int
lvthresh(image,lflag,lthresh,uflag,uthresh,value)
struct xvimage *image;
int lflag,uflag;
float lthresh,uthresh;
float value;

INPUT

image
    points to the input xvimage structure

lflag
    a flag set (equal 1) if checking of the lower bound is desired.

uflag
    a flag set (equal 1) if checking of the upper bound is desired.

lthresh
    a lower bound level.

uthresh
    a upper bound level.

value
    a value to give to output pixels that are non-zero by thresholding.

OUTPUT

image
    points to the xvimage structure that contains the result of the operation.

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

DESCRIPTION
lvthresh senerates a binary image (value or 0) by thresholding the input image. The resulting image is of the same data type as the input image. The output pixel is given the value value if the input pixel has a value above the lower thres- hold, below the upper threshold, or between the two thres- hold levels.

The lflag and uflag arguments specify whether the lower and upper levels are to be checked or not. To enable checking against the corresponding level, these arguments should be set to 1.

The xvimage structure pointed to by image is used for both the input xvimage structure and the output result xvimage structure. This is done to save space, but you must be careful not to overwrite important data.

SEE ALSO
vthresh(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
lvthresh does not operate on BIT images.

AUTHOR
Scott Wilson

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.