lvhisto(3)

LIBRARY ROUTINE
lvhisto - Finds the histogram of the gray-levels of a real, single band, non-bit image.

LIBRARY CALL
#include "vinclude.h"
int
lvhisto(image,hist,lrange,urange,nbins,mflag,mimage,logflg,perflg)
struct xvimage *image,*mimage;
float *hist;
float lrange,urange;
int nbins,mflag,logflg,perflg;

INPUT

    1. image -- xvimage structure
    2. hist -- pointer to float array.
    3. lrange -- lower range bound
    4. urange -- upper range bound
    5. nbins -- number of bins
    6. mflag -- non-zero means use mask image
    7. mimage -- xvimage structure to use as mask image, must
                 be structurally the same as *image.
    8. logflg -- if nonzero, takes the log of the data before
                 histogramming
    9. perflg -- if nonzero then output the percentage of total
                 count rather than the individual bin counts

OUTPUT

    1. hist -- histogram array with filled values

    lvhisto returns 1 on success and 0 on failure.

MODIFICATIONS
20-Feb-90 Added support for additional data types and
          bin specifications. Scott Wilson
20-Feb-90 Added mask image support. Scott Wilson
21-Feb-90 Added log space support. Scott Wilson
21-Feb-90 Added percentage output. Scott Wilson

DESCRIPTION
lvhisto computes the histogram of a gray-level image.

The float array pointed to by hist is loaded with the histogram of the image specified by the remaining parameters. The historamming window is that range of data values that the histogram is to span. The lower bound is set by lower, and the upper bound set by upper. The number of counting channels is set by bins. Each bin receives counts from the HIGH side and includes its own lower bound.

If mflag is non-zero, then the image pointed to by mimage is used as a operation mask. A non-zero value in this image enables the corresponding pixel in the input image to be histogrammed. This image, if used, must match the internal structure, size and data type of the input image.

The histogram array must have been allocated in the calling program and must contain at least enough space for the specified number of integer count channels.

SEE ALSO
vhisto(1), intro(3), vipl(3), verror(3), vutils(3) lvhistsee(3)

RESTRICTIONS
lvhisto will not operate on non-grayscale viff files.

AUTHOR
Ramiro Jordan, Marcelo Teran

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