lvcost(3)

LIBRARY ROUTINE
lvcost - Compute cost (surface arc length) for an image

LIBRARY CALL
#include "vinclude.h"
int
lvcost(img,mask,x,y)
struct xvimage *img,*mask;
int x,y;

INPUT

img Pointer to FLOAT image used to represent a surface.

mask
    Pointer to FLOAT image used to gate the operation. If this is NULL, then no masking is done.

x   X coordinate of pixel to serve as the reference location (integer)

y   Y coordinate of pixel to serve as the reference location (integer)

OUTPUT

img is modified to be of type FLOAT, with the cost data assigned to the imagedata pointer. The original imagedata area is free()'d.

MODIFICATIONS

DESCRIPTION
lvcost computes the surface arc length from a given pixel location to every other pixel in the image. The surface distance from a particular pixel to the reference pixel location is stored in the corresponding location in the output image. Image pixels are resampled at 1/10 of thier spacing using bilinear interpolation for use in forming the surface profile between any two points. This provides an surface distance accurate to around 1% for relatively smooth images. An image with very sharp transitions or other high frequencyies will produce less accurate results.

If the mask image is used, then only those pixels that have a non-zero value at the corresponding pxiel in the mask will be evaluated for surface distance. All other output pixels are set to -1.

The output is of type float.

The input image data is overwritten by the distance data.

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

RESTRICTIONS
lvcost works only on FLOAT images.

AUTHOR
Scott Wilson

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