lvgamth(3)

LIBRARY ROUTINE
lvgamth - Generate a binary image by thresholding a gamut image.

LIBRARY CALL
#include "vinclude.h"
int
lvgamth(image,rupper,rlower,gupper,glower,bupper,blower,
          lrflag, urflag, lgflag, ugflag, lbflag, ubflag,vflag,value)
struct xvimage *image;
int rupper, rlower, bupper, blower, gupper, glower;
int lrflag, urflag, lgflag, ugflag, lbflag, ubflag;
int vflag, value;

INPUT

    image -- input pseudo colored image in byte format
    rlower -- lower threshold value for map column #1 pixel value
    rupper -- upper threshold value for map column #1 pixel value
    lrflag -- flag that says map column #1 lower thresh value is valid

    urflag -- flag that says map column #1 upper thresh value is valid

    glower -- lower threshold value for map column #2 pixel value
    gupper -- upper threshold value for map column #2 pixel value
    lgflag -- flag says map column #2 lower thresh value is valid
    ugflag -- flag says map column #2 upper thresh value is valid
    blower -- lower threshold value for map column #3 pixel value
    bupper -- upper threshold value for map column #3 pixel value
    lbflag -- flag says map map column #3 lower thresh value is valid

    ubflag -- flag says map column #3 upper thresh value is valid
    value -- Value for the non-zero pixel.

OUTPUT

    image -- thresheld binary output image.

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

    lvgamth returns 1 upon success and 0 on failure.

MODIFICATIONS

DESCRIPTION
Generate a binary image (value or 0) by thresholding the input color image. A color image implies the Image is of data type BYTE, It contains 3 map columns of data type BYTE with Map enable set to FORCE. The resulting image is of data type BYTE.

The output pixel is given the value specified by the input variable value, if the input pixel has a value above the lower threshold, below the upper threshold, or between the two threshold levels.

If the lower threshold flag is set then any pixel with value larger than the lower threshold is set to true, otherwise false. If the upper threshold flag is set then any pixel with value larger than the upper threshold level is set to false, otherwise true. If both flags are set then it is possible to isolate a band of pixel values. If the lower and upper threshold flags are set and the lower and upper threshold values are equal, then the output is set to true if it is exactly equal to the threshold level. The region specified by the upper and lower threshold values must be true for colormap #1 , colormap #2 and colormap #3 pixel values for the above to work.

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

RESTRICTIONS
lvgamth will only operate on 1 band images of data type BYTE, with the map enable FORCE, and map data type BYTE.

AUTHOR
Tom Sauer

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