lvhmed(3)

LIBRARY ROUTINE
lvhmed - Perform median filtering on an image using a histogram to find the median.

LIBRARY CALL
#include "vinclude.h"
int
lvhmed(img,xsize,ysize)
struct xvimage *img;
int xsize, ysize;

INPUT

    img -- xvimage structure
    wsize -- window width argument
    hsize -- window height argument

    For odd windows (masks) the median value is replaced in the center pixel location of the window.

OUTPUT

    img -- holds the result of the median filtered
           image

    img 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.

    lvhmed returns 1 on success and 0 on failure.

MODIFICATIONS

DESCRIPTION
lvhmed computes a two dimensional median filter of width w and height h over the given image, img. The median is computed by moving a w by h pixel mask over the image and updating the masked histogram.

Images must be of type BYTE.

In rectangular odd windows (masks) the median value is replaced in the center pixel location of the window. The default window format is (3x3).

The resultant image will have a border of pixels of value 0 since the masking operation works in much the same way as a convolution.

lvhmed returns a one upon success and a zero on failure.

SEE ALSO
vhmed(1), intro(3), vipl(3), verror(3), vutils(3) lvqmed(3)

RESTRICTIONS
lvhmed does not support even window dimensions and only works on BYTE images.

AUTHOR
Marcelo Teran, Ramiro Jordan

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