lvspatial(3)

LIBRARY ROUTINE
lvspatial - Perform spatial feature extraction of an image via statistical analysis of window pixels.

LIBRARY CALL
#include "vinclude.h"
int
lvspatial(img, xsize, ysize, m, v, c, s, e, d)
struct xvimage *img;
int xsize, ysize, m, v, c, s, e, d;

INPUT

img xvimage structure

wsize
    window width argument

hsize
    window height argument

m   mean operator argument

v   variance operator argument

c   contrast operator argument

s   angular 2nd moment argument

e   entropy operator argument

d   dispersion operator argument

OUTPUT

img holds the resulting feature of the image. img is used for both the input xvimage structure and the output result xvimage structure.

MODIFICATIONS

DESCRIPTION
vspatial performs a spatial feature extraction on an image using a selected statistical operation. The statistical operation is computed, using overlapping windows, over the entire image. The center pixel is updated in each window based on the calculated statistics of that window.

The input image, which must be of data storage type BYTE, corresponds to the -i argument. The output image, which corresponds to the -o argument, is stored as data type FLOAT. The output image may be a multiband image depending on how many spatial operators were selected. The resulting image will have a border of pixels of value 0, since the window operation does not calculate values for border pixels.

The width and height of the window is specified by the -w and -h window width and height arguments. The width and height arguments cannot be an even number. The window dimensions must be odd (ie. 3x3, 5x5, 7x7, etc.), since the center pixel is replaced with the computed value of the window data. The default window size is 3x3.

Each pixel in the image is updated with a computed value except the border pixels. A 3x3 window will result in a border of one pixel, a 5x5 window will result in a border of two pixels, etc.

There are six statistical operations that may be selected. Any combination of the statistical operations may be selected by toggeling the desired argument on (ie. argument followed by a 1). The default for each argument is unselected (ie. argument followed by a 0). The six possible statistical operations and their arguments are:

  -m -- calculates the mean of the image.
  -v -- calculates the variance of the image.
  -c -- calculates the contrast of the image.
  -s -- calculates the angular second moment of the image.
  -e -- calculates the entropy of the image.
  -d -- calculates the dispersion of the image.

The resulting feature vector may contain from one to six bands of data, depending upon the number of arguments selected.

All input images must be of data storage type BYTE.

All output images are of data storage type FLOAT.

The spatial feature operations were based on the definitions presented in: "Fundamentals of Digital Image Processing" by A.K. Jain, Prentice-Hall, 1989.

•   img - pointer to input image and resulting output image.

•   xsize - (int): size of window in x-direction (ie. number of rows in window).

•   ysize - (int): size of window in y-direction (ie. number of cols in window).

•   m - (int): command line switch to include mean operation.

•   v - (int): command line switch to include variance operation.

•   c - (int): command line switch to include contrast operation.

•   s - (int): command line switch to include ang. 2nd moment operation.

•   e - (int): command line switch to include entropy operation.

•   d - (int): command line switch to include dispersion operation.

lvspatial returns a 1 upon success and a 0 upon failure.

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

RESTRICTIONS

All input images must be of data storage type BYTE.

All output images are of data storage type FLOAT.

AUTHOR
Charlie Gage

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