int im_fastcor(in, ref, out) IMAGE *in, *ref, *out;
int im_spcor(in, ref, out) IMAGE *in, *ref, *out;
These functions calculate spatial correlation between two
one-band images held
by the image descriptors
The sizes of
should be smaller than
the sizes of
The correlation is carried out by overlapping
on the top
left corner of
and moving it over
The output image is the same size as the input. The edge pixels are calculated
by expanding the input image using
in mode 1 (replicating edge pixels) just enough so that the output can match
calculates the spatial correlation between
correlation coefficient from Niblack "An Introduction to Digital Image
Processing,", Prentice/Hall, pp 138. The resultant coefficients are written
as float numbers in
The images must be char, short or ushort.
simply returns the sum of squares of differences between
This is much faster, but less useful. The resultant coefficients are written
as unsigned int numbers in out which has a size of in.
The functions do not check for integer overflow.
The function returns 0 on success and -1 on error.