Table of Contents

## Name

im_avg, im_deviate, im_min, im_minpos, im_max, im_maxpos - find the mean, standard deviation, minimum and maximum of an image

## Synopsis

#include <vips/vips.h>

int im_avg(im, out)
IMAGE *im;
double *out;

int im_deviate(im, out)
IMAGE *im;
double *out;

int im_min(im, out)
IMAGE *im;
double *out;

int im_minpos(im, xpos, ypos, min)
IMAGE *im;
int *xpos, *ypos;
double *min;

int im_max(im, out)
IMAGE *im;
double *out;

int im_maxpos(im, xpos, ypos, max)
IMAGE *im;
int *xpos, *ypos;
double *max;

## Description

These functions find the mean, standard deviation, minimum, maximum of an image. They operate on all bands of the input image. All computations are carried out in double precision arithmetic. The standard deviation is calculated using the formula:

Var{E} = E{X^2} - (E{X})^2)
stdev{E} = sqrt(Var{E}).

im_avg(3) finds the average of an image pointed by im. Takes as input any non-complex image format and returns a double at the location pointed by out.

im_deviate(3) finds the standard deviation of an image pointed by im. Takes as input any non-complex image format and returns a double at the location pointed by out.

im_min(3) finds the the minimum value of the image pointed by im and returns it at the location pointed by out. Takes as input any image format and returns a double at the location pointed by out. If input is complex the min square amplitude (re*re+im*im) is returned.

im_minpos(3) finds the the minimum value of the image pointed by im and returns it at the location pointed by out. The coordinates of the last occurrence of min is returned at locations pointed by xpos, ypos. If input is complex the min square amplitude (re*re+im*im) is returned.

im_max(3) finds the the maximum value of the image pointed by im and returns it at the location pointed by out. If input is complex the min square amplitude (re*re+im*im) is returned.

im_maxpos(3) finds the the maximum value of the image pointed by im and returns it at the location pointed by max. The coordinates of the last occurrence of max is returned at locations pointed by xpos, ypos. If input is complex the max square amplitude (re*re+im*im) and its last occurrence is returned.

## Return Value

All functions return 0 on success and -1 on error.

## See Also

im_exptra(3) , im_lintra(3) , im_abs(3) , im_stats(3) .

## Copyright

N. Dessipris

## Author

N. Dessipris - 24/04/1991
J. Cupitt - 21/7/93

Table of Contents

- Name
- Synopsis
- Description
- Return Value
- See Also
- Copyright
- Author