NAME

     rms_error - computes the rms error between two images

SYNOPSIS

      #include <CVIPimage.h>
      #include "CVIPcompress.h"

     float *rms_error(Image *im1, Image *im2)

      <im1> - Pointer to Image
      <im2> - Pointer to Image

      RETURNS: Pointer to rms values (float)

PATH

     $CVIPHOME/COMPRESSION/rms_error.c

DESCRIPTION

     rms_error() calculates the Root-Mean_squared  error  between
     two images.

     The number of  values  contained  in  the  return  value  of
     rms_error()  is  equal  to bands+1.  Thus, for a color image
     (RGB),  rms_error()   will   return   float   *fptr;   where
     fptr[0]=error  in  Red  Band;  fptr[1]=error  in Green band;
     fptr[2]=error in Blue  band;  and  fptr[3]  is  overall  rms
     error.

EXAMPLE

      #include <CVIPimage.h>
      #include <CVIPhisto.h>

      void main()
      {
      Image *cvipImage, *heqimage;
      IMAGE_FORMAT format;
      char *inputfile;
      float *error;
      int i;

      print_CVIP("\n\t\tEnter the Input File Name:  ");
      inputfile =(char *) getString_CVIP();
      format = getFormat_CVIP(inputfile);
      cvipImage = read_Image(inputfile, 1);
      heqimage=histeq(cvipImage);
      error = rms_error(cvipImage, heqimage);
      for(i=0; i<getNoOfBands_Image(cvipImage); i++) {
         fprintf(stdout, "Error in band #%d: %f0, i, error[i]);
      }
      fprintf(stdout,        "Overall         Error:         %f0,
     error[getNoOfBands_Image(cvipImage)];

BUGS

     None at this time

SEE ALSO

     snr()

AUTHOR

     Copyright (C) 1993-1996 SIUE - by  Scott  Umbaugh  and  Arve
     Kjoelen