lvqmed(3)

LIBRARY ROUTINE
lvqmed - Perform a median filter on an image using quicksort to find the median value.

LIBRARY CALL
#include "vinclude.h"
int
lvqmed(img1,w,h)
struct xvimage *img1;
int w,h;

INPUT

    1. img1 -- first input xvimage structure
    2. w -- the width of the median filter
    3. h -- the height of the median filter

OUTPUT

    1. img1 -- output xvimage structure

    The result data type depends on the inputs. The result image size is the same as img1.

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

    It is still possible to have overflow when using large images.

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

MODIFICATIONS
Rasure fixed bug on 2/21/92. Sort array was indexed incorreclty to get median value. See code for more details.

DESCRIPTION
vqmed 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 sorting the masked values. The value of the median filter is the (masksize+1)/2 th value in the sorted array.

The result is returned via the pointer *img. The returned image is of the same type and size as the given image.

vqmed will not operate on any of the complex or transformed type images.

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.

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

SEE ALSO
vqmed(1), intro(3), vipl(3), verror(3), vutils(3) lvhmed(3)

RESTRICTIONS
lvqmed will not operate on data storage type complex.

AUTHOR
Richard Krukar

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