int im_stdif(in, out, a, m0, b, s0, xw, yw)
IMAGE *in, *out;
double a, m0, b, s0;
int xw, yw;

int im_stdif_raw(in, out, a, m0, b, s0, xw, yw)
IMAGE *in, *out;
double a, m0, b, s0;
int xw, yw;

DESCRIPTION

im_stdif() preforms statistical differencing according to the formula
given in page 45 of the book "An Introduction to Digital Image Processing" by
Wayne Niblack. This transformation emphasises the way in which a pel differs
statistically from its neighbours. It is useful for enhancing low-contrast
images with lots of detail, such as X-ray plates.

Values a, m0, b and s0 are entered, while meanv and stdv are the values
calculated over a moving window of size xw, yw centred on pixel (i,j). m0 is the
new mean, a is the weight given to it. s0 is the new standard deviation, b is
the weight given to it. Try:

The opreation works on one-band UCHAR images only, and writes a one-band UCHAR
image as its result. The output image has the same size as the input - a black
border is added to mark uncomputable pixels.

im_stdif_raw() behaves exactly as im_stdif(), but does not add the border of
black pixels.

RETURN VALUE

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