Bsoft function

img_linear_fit

Source:

src/img/img_combine.c

Description:

Linear least squares fit of two images.

Algorithm:

	The data blocks from two images are fit by a simple linear least squares

regression algorithm with exclusion of a percentage of outliers:
image2 = intercept + slope * image1
The first image is modified to return the difference:
difference = intercept + slope * image1 - image2
The residual returned is:
R = sqrt(sum(difference^2) / sum((image2-avg2)^2))
Note: A linear fit is not symmetric with respect to the two input
data sets - the order of the input images determine the output.
The two data blocks must have the same size and are converted to
floating point.

Arguments:

Bimage* p1first image (modified).
Bimage* p2second image.
Bimage* pmaskmask to limit calculation to a certain region.
float max_excludemaximum percentage of outlying points to exclude.

Returns:

float* array of R factors, NULL if not run.

Prototype:

float* img_linear_fit(Bimage* p1, Bimage* p2, Bimage* pmask, float max_exclude)

Functions used:

balloc
bfree
error_show
img_check_if_same_size
img_rescale_to_avg_std

Other objects included:

struct Bimage
struct Bmarker
struct Bsub_image


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


Back to the Bsoft home