NAME

     lum_average - creates a grayscale from a multiband image

SYNOPSIS

      #include "CVIPimage.h"
      #include "CVIPcolor.h"

     Image * lum_average(Image * input_Image)

      <input_Image> - pointer to an Image structure

PATH

     $CVIPHOME/COLOR/lum_average.c

DESCRIPTION

     Performs a luminance transform according to the formula
                P = (band_1 + band_2 + ... + band_n)/n

TYPES AND CONSTANTS

     None

RETURN VALUES

     Pointer to a transformed image

HISTORY

     History information recorded: None

EXAMPLE

      #include <CVIPtoolkit.h>
      #include <CVIPimage.h>
      #include <CVIPdef.h>
      #include <CVIPview.h>
      #include <CVIPconvert.h>
      #include <CVIPcolor.h>
      #define VIEWER "picture"
      #define VIDEO_APP "SunVideo &"

      void main()
      {
      Image *cvipImage;
      IMAGE_FORMAT format;
      char *inputfile,*outputfile;

      setDisplay_Image(VIEWER, "Default");
      /* The input image should be a COLOR one */
      print_CVIP("\n\t\tEnter the  Input File Name:  ");
      inputfile =(char *) getString_CVIP();
      format = getFormat_CVIP(inputfile);
      cvipImage = read_Image(inputfile,1);
      view_Image(cvipImage, inputfile);
      free(inputfile);
      /* the following call creates a gray scale from a
      multiband image */
      cvipImage=lum_average(cvipImage);
      print_CVIP("\n\t\tEnter the Output File Name:  ");
      outputfile = getString_CVIP();
      view_Image(cvipImage,outputfile);
      write_Image(cvipImage,outputfile,CVIP_NO,CVIP_NO,VIP,1);
      free(outputfile);
      }

SEE ALSO

     libcolor

AUTHOR

     Copyright (C) 1996 SIUE - by Scott E.  Umbaugh  and  Wenxing
     Li.