lvdyth(3)

LIBRARY ROUTINE
lvdyth - Perform dynamic thresholding on an image.

LIBRARY CALL
#include "vinclude.h"
int
lvdyth(img,wsize,hsize,type,value)
struct xvimage *img;
int wsize, hsize, type, value;

INPUT

    image -- xvimage structure
    wsize -- window width argument
    hsize -- window height argument
    type -- type of thresholding (0=median, 1=mean)
    value -- non zero output pixel value

OUTPUT

    image -- holds the result of the thresholded
           image

    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.

    lvdyth returns 1 on success and 0 on failure.

MODIFICATIONS
John Rasure on Fri Feb 28 18:41:18 MST 1992 fixed several indexing bugs and array bound problems.

DESCRIPTION
lvdyth performs dynamic thresholding on an image by either using the median value or mean value of a window as the threshold value. The window is specified by its width argument, w, and its height argument, h. Thresholding is computed by moving the window over the image, and at each new window location over the image a new threshold value is determined for the pixel currently at the center of the window.

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

RESTRICTIONS
lvdyth supports only BYTE data storage type images.

AUTHOR
Marcelo Teran, Ramiro Jordan

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