average

[ XITE Reference Manual | XITE home ]

Name

average - computes the average of several bands in an input image

Syntax

 #include <xite/arithmetic.h>

 int average( IMAGE inimg, ID_BAND outband,
    int Scale );

Description

Computes the average image of two or several bands of an image. Grey levels of the output average image will be multiplied by a Scale (default Scale is 1.0).

 (inimg[1] + inimg[2] +........+ inimg[n]) / n * Scale

The output image will be of pixeltype double.

Restrictions

Input image should not have pixels of type "complex".

Return value

 0 => OK
 1 => Unknown pixeltype of input band

Author

Yogesan, BLAB, Ifi, UiO

Id

$Id: average.c,v 1.31 1997/05/27 14:47:19 svein Exp $