Bsoft function

img_correlate

Source:

src/img/img_combine.c

Description:

Calculates a correlation image and a correlation coefficient between
two images.

Algorithm:

	The correlation between two images is calculated and normalized as:

sum((image1 - basis1)*(image2 - basis2))
CC = -------------------------------------------------
sqrt(sum(image1 - avg1)^2 * sum(image2 - avg2)^2)
The basis values can be anything, but is typically either the
average or the background in an image.
Both images are converted to floating point.

Arguments:

Bimage* p1first image (modified).
Bimage* p2second image.
float bas1basis value for first image.
float bas2basis value for second image.

Returns:

double correlation coefficient, -1 if error.

Prototype:

double img_correlate(Bimage* p1, Bimage* p2, float bas1, float bas2)

Functions used:

bfree
error_show
img_check_if_same_size
img_rescale_to_avg_std

Other objects included:

struct Bimage
struct Bmarker


Generated by bdoc.pl on Mon Jun 15 11:47:34 2009


Back to the Bsoft home