


lvcost(3)              C LIBRARY FUNCTIONS              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  refer-
                    ence location (integer)

     y              Y coordinate of pixel to serve as the  refer-
                    ence 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
     _l_v_c_o_s_t computes the surface arc length from  a  given  pixel
     location to every other pixel in the image. The surface dis-
     tance from a particular pixel to the reference  pixel  loca-
     tion  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  frequen-
     cyies 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.





University of New MexicoLast change: 03/28/91                     1






lvcost(3)              C LIBRARY FUNCTIONS              lvcost(3)



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


RESTRICTIONS
     _l_v_c_o_s_t works only on FLOAT images.

AUTHOR
     Scott Wilson


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









































University of New MexicoLast change: 03/28/91                     2



