surface

Outputs

 which are mapped to avs parameters, inputs, and outputs, are for the
khoros library routine.
*********************************************************************************
Documentation for avs module vcost

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.

Description

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

See also

     vcost(1), intro(3), vipl(3), verror(3), vutils(3)
RESTRICTIONS
     vcost works only on FLOAT images.

Author

     Scott Wilson
COPYRIGHT
     Copyright  1991,  University  of  New  Mexico.   All  rights
     reserved.
*********************************************************************************
Documentation for avs module vdetilt
INPUT
     img1           (struct xvimage) - input/output image  struc-
                    ture
     img2           (struct xvimage) - gating mask image
     mflg           (int) - a flag set (equal 1) if gating  image
                    mask available
                    The input images must be  of  the  same  data

Type

and size.
OUTPUT
     img1           (struct xvimage) - holds the  result  of  the
                    detilt  operation.   The  output data type is
                    the same as the input data type.
DESCRIPTION
     vdetilt computes the best-fit plane for an image, and  then
     subtracts  that  plane from the image to produce the output.
     This is very handy for correcting illumination gradients  in
     a  poorly  digitized  image.  The pflg also removes the mean
     from the image, giving it zero-mean statistics.
     The mask image must be of the same data type  as  the  input
     images,  and is used to gate the operation.  A non-zero mask
     pixel enables the  output  pixel  to  contain  the  adjusted
     value.  A  zero  mask  pixel just transfers the value of the
     corresponding pixel in the input image to the output pixel.
     img1 is the input image and img2  is  the  operation  gating
     image.   mflg should be set to one if the gating image is to
     be used.  img1 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  impor-
     tant data.
     The mask image must be the same size as  the  input  images.
     The  output  image  data type is the same as the input image
     data type.  vdetilt returns a value of one upon success and
     a zero on failure.
SEE ALSO
     vdetilt(1), intro(3), vipl(3),  verror(3),  vutils(3)  vget-
     tilt(1), lvgettilt(3), vtilt(1), lvtilt(3)
RESTRICTIONS
     vdetilt will not work on BIT,  transform  or  COMPLEX  data
     storage types.
AUTHOR
     Scott Wilson
COPYRIGHT
     Copyright  1991,  University  of  New  Mexico.   All  rights
     reserved.
*********************************************************************************
Documentation for avs module vgettilt
INPUT
     vgettilt:
     image          (struct xvimage) - input xvimage structure
     mimage         (struct xvimage) - input mask xvimage  struc-
                    ture
     mflg           (int) - flag set to 1  if  masking  image  is
                    specified
                    vfindtilt:
     image          (struct xvimage) - input xvimage structure
                    vmafdtilt:
     image          (struct xvimage) - input xvimage structure
     mimage         (struct xvimage) - input mask xvimage  struc-
                    ture
OUTPUT
     vgettilt, vfindtilt, & vmafdtilt:
     a              (double) - A coefficient of f(x,y)=Ax+By+C
     b              (double) - B coefficient of f(x,y)=Ax+By+C
     c              (double) - C coefficient of f(x,y)=Ax+By+C
     These library functions will return a zero if failure and  a
     one upon success.
DESCRIPTION
     vgettilt & vfindtilt compute the  least-squares  best  fit
     plane   for   an   image.    The  plane  will  be  given  by
     f(x,y)=Ax+By+C with  the tilt coefficients in  inverse  pix-
     els.
     vmafdtilt computes the least-squares best fit plane for  an
     image   with   a   mask.    The   plane  will  be  given  by
     f(x,y)=Ax+By+C with  the tilt coefficients in  inverse  pix-
     els.  The plane coefficients will be computed only for those
     pixels enabled by the mask image.  If a mask image  is  sup-
     plied,  it  MUST  be  of the same type and size as the input
     image.
SEE ALSO
     vgettilt(1),   intro(3),   vipl(3),   verror(3),   vutils(3)
     lvtilt(3), lvdetilt(3)
RESTRICTIONS
     If a mask image is supplied, it MUST be of the same type and
     size as the input image.
     The vfindtilt and vmafdtilt libraries will not work on BIT
     or   COMPLEX   data  storage  type  files.   vfindtilt  and
     vmafdtilt will only calculate the tilt of the first band in
     a multiband image.
AUTHOR
     Scott Wilson, Donna Koechner
COPYRIGHT
     Copyright  1991,  University  of  New  Mexico.   All  rights
     reserved.
*********************************************************************************
Documentation for avs module vslope
INPUT
          1. img1  -  A pointer to the input viff structure.
          2. slope_flag  -  When set to 1, this flag  causes  the
          slope  image  to be created.  0 means no slope image is
          created.
          3. slope_option  -  Determines the form  of  the  slope
          output: 0=degrees, 1=radians, 2=percent.
          4. aspect_flag  -  When set to 1, this flag causes  the
          aspect image to be created.  0 means no aspect image is
          created.
          5. aspect_option  -  Determines the form of the  aspect
          output: 0=degrees, 1=radians, 2=quadrants.
          6. no_aspect  -  Value given for the aspect of  a  flat
          surface.   The  aspect gives the direction the slope is
          facing.  When there is no slope the,  aspect  is  given
          this value to denote that it is undefined.
OUTPUT
          1. img2  -  A double pointer to the slope  viff  struc-
          ture.  Only used if slope_flag is set.
          2. img3  -  A double pointer to the aspect viff  struc-
          ture.  Only used if aspect flag is set.
DESCRIPTION
     vslope computes the slope and aspect images from  an  input
     elevation data.
             The slope is always calculated as a positive  number
     and represents the slope in the direction of the gradient at
     that point.  The direction in which the slope is  calculated
     depends  only  on  the direction of the steepest gradient at
     the point.  The  slope  may  be  computed  in  three  forms:
     degrees, radians, and percent rise.  Degrees and radians are
     used to measure the angle between a tangent to  the  surface
     at  the point the slope is being calculated and a horizontal

Reference

plane.  Percent rise is a measure of how much  the
     tangent  rises with respect to the horizontal distance.  For
     instance, if the tangent at a  point  rises  50  meters  for
     every 100 meters horizontally, the slope is 50 percent.  The
     form used for the output slopes is selected using  the  com-
     mand line argument '-os'.
             The aspect of the elevation image tells which direc-
     tion  the  slope  is  facing.  The aspect is reported in the
     direction of the increasing slope.  The aspect may  also  be
     calculated  in three forms: degrees, radians, and quadrants.
     Degrees and radians give the  clockwise  angle  between  the
     positive x-axis (right to left on the image and east in geo-
     graphical terms) and the direction the slope is facing.  For
     instance,  if  the  slope  is  facing  the  top of the image
     (north) then the aspect will be 90 degrees or pi/2  radians.
     When reported in quadrants, the aspect is given a value that
     depends on the range the direction it faces.  The circle  is
     divided  into  24 regions of 15 degrees each, and the region
     that the aspect falls in determines the value that  will  be
     assigned to it.  North is always assumed to be at the top of
     the image, and East is always to the right.  A table of  the
     quadrant values is given below:
         Aspect Value  Range in Degrees  Description
              1           353 -   7     east facing
              2             8 -  22     15 degrees north of east
              3            23 -  37     degrees north of east
              4            38 -  52     northeast facing
              5            53 -  67     30 degrees east of north
              6            68 -  82     15 degrees east of north
              7            83 -  97     north facing
              8            98 - 112     15 degrees west of north
              9           113 - 127     30 degrees west of north
             10           128 - 142     northwest facing
             11           143 - 157     30 degrees north of west
             12           158 - 172     15 degrees north of west
             13           173 - 187     west facing
             14           188 - 202     15 degrees south of west
             15           203 - 217     30 degrees south of west
             16           218 - 232     southwest facing
             17           233 - 247     30 degrees west of south
             18           248 - 262     15 degrees west of south
             19           263 - 277     south facing
             20           278 - 292     15 degrees east of south
             21           293 - 307     30 degrees east of south
             22           308 - 322     southeast facing
             23           323 - 337     30 degrees south of east
             24           338 - 352     15 degrees south of east
             25        no aspect (flat)
     The form of the output aspect is selected  using  the  '-to'
     command line argument.
             The input elevation file must be in viff format, and
     may    be    of    type    byte    (VFF_TYP_1_BYTE),   short
     (VFF_TYP_2_BYTE),    int    (VFF_TYP_4_BYTE),    or    float
     (VFF_TYP_FLOAT).   The input data will automatically be con-
     verted to float, and both the slope and aspect output  files
     will always be type float regardless of the input data type.
     Any type of  map  that  is  not  forced  (VFF_MAP_FORCE)  is
     allowed on the input file, and the map will be transfered as
     is to the output.  Explicit location data is not allowed  in
     the  input file, and will result in an error.  The pixels in
     the input file are assumed to be evenly  sampled  where  the
     sampling  interval  is  given in the 'pixsizx' and 'pixsizy'
     fields in the viff header.  The units used for the  sampling
     interval  are  arbitrary but must be the same units that the
     elevations in the file use.  The sampling  interval  is  not
     allowed  to  be zero.  Finally, the input file is restricted
     to a single image.
SEE ALSO
     vslope(1),   intro(3),   vipl(3),    verror(3),    vutils(3)
     vsurf(3), vconvert(3)
RESTRICTIONS
     vslope  works  on  input  images  with  data   types   byte
     (VFF_TYP_1_BYTE),      short      (VFF_TYP_2_BYTE),      int
     (VFF_TYP_4_BYTE), and float (VFF_TYP_FLOAT), but the type of
     the  output  image  will  always  be float regardless of the
     input type.  Maps on the  input  image  will  be  transfered
     directly    to   the   output   image,   but   forced   maps
     (VFF_MAP_FORCE) are not accepted.  Explicit location data is
     not  accepted.   The  input image is restricted to one image
     per file.
AUTHOR
     Per Lysne
COPYRIGHT
     Copyright  1991,  University  of  New  Mexico.   All  rights
     reserved.
*********************************************************************************
Documentation for avs module vsurf
INPUT
     img1           Pointer to FLOAT image used  to  represent  a
                    surface.
OUTPUT
     norm           Pointer to image pointer  that  will  receive
                    the  image  containing  the normal vectors to
                    each pixel on the surface.
     ang            Pointer to image pointer  that  will  receive
                    the  image  containing  the angle between the
                    surface normal and the reference  plane  nor-
                    mal.
DESCRIPTION
     vsurf will take a surface  image  and  produce  two  output
     images:  one  with the normals for each point on the surface
     and one with the angle between the surface  normal  and  the
     normal to the zero plane of the image.
     The angle output image is in degrees.
     The output images are allocated  inside  vsurf;  the  input
     image is not modified.
SEE ALSO
     vsurf(1), intro(3), vipl(3), verror(3), vutils(3)
RESTRICTIONS
     Works only on FLOAT images.
AUTHOR
     Scott Wilson
COPYRIGHT
     Copyright  1991,  University  of  New  Mexico.   All  rights
     reserved.
*********************************************************************************
Documentation for avs module vtilt
INPUT
     img1           (struct xvimage) - input/output image xvimage
                    structure
     img2           (struct xvimage) - input mask image
     mflg           (int) - set to one if img2 to is to  be  used
                    as a mask image
     xslope & yslope
                    (float) - specify the characteristics of  the
                    plane and must be given in units per pixel.
OUTPUT
     img1           (struct xvimage) - input/output image xvimage
                    structure
     vtilt will return a value of one upon success and a zero on
     failure.
DESCRIPTION
     vtilt adds a specified plane to the input image to  correct
     for a tilt in the image luminance.  Often an image will have
     a skew in the grey level values that represents a plane with
     a  certain  slope.  The tilt takes the form of a plane which
     has a X and Y zero crossing at the center of the input image
     with xslope and yslope as specified in the argument line.
     img1 is the input and output xvimage structure. This is done
     to  save  space,  but  you  must be careful not to overwrite
     important data.  img2 is the mask image, if mflg is set then
     the  mask  image  is used to gate the operation.  A non-zero
     mask pixel enables  the  ouput  pixel  to  contain  adjusted
     values.  A  zero  mask pixel just transfers the value of the
     corresponding pixel in the input image to the output  image.
     The input images must be of the same data type and size.
     xslope and yslope specify the characteristics of  the  plane
     and must be given in units per pixel.
     The output image data type is the same  as  the  input  data
     type.
     vtilt returns a value of one upon success  and  a  zero  on
     failure.
SEE ALSO
     vtilt(1),  intro(3),  vipl(3),  verror(3),  vutils(3)  vget-
     tilt(1), lvgettilt(3), vdetilt(1), vdetilt(3)
RESTRICTIONS
     vtilt will not operate on COMPLEX or BIT data storage  type
     images.
AUTHOR
     Scott Wilson, Donna Koechner
COPYRIGHT
     Copyright  1991,  University  of  New  Mexico.   All  rights
     reserved.
*********************************************************************************