lvbilinco(3)

LIBRARY ROUTINE
lvbilinco - Compute bilinear geometric warp coefficients

LIBRARY CALL
#include "vinclude.h"
int
lvbilinco(x,y,xp,yp,xc,yc,nobs)
float *x,*y,*xp,*yp,*xc,*yc;
int nobs;

INPUT

x   array of x coordinates of source tiepoints

y   array of y coordinates of source tiepoints

xp  array of x coordinates of target tiepoints

yp  array of y coordinates of target tiepoints

nobs
    number of observation coordinates

OUTPUT

xc  array of coefficients for the x coordinate bilinear transform

yc  array of coefficients for the y coordinate bilinear transform

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

5-Jan-91 Scott Wilson - Added support for least squares fit (more observations than coefficients).

5-Jan-91 Scott Wilson - Added tiepoint error output image

DESCRIPTION
lvbilinco is used to compute the coefficients for the two bilinear equations that are commonly used to perform image registration for simple spatial distortion functions. The input arrays are tiepoint coordinates. Each input array should be of length N, of type FLOAT. There should be at least 4 tiepoints. If more than 4 tiepoints are supplied then a least squares fit is done. The coordinates are stored as N pairs of numbers. For example (x0,y0) (x1,y1) (x2,y2) (x3,y3) is stored as an array of floats as follows:
     x y
     __ __
     x0 y0
     x1 y1
     x2 y2
     x3 y3 The first array is the x coordinate of the source tiepoints(x), the second array is the y coordinate of the source tiepoints(y). The third array is the x coordinate of the target tiepoints(xp), and the fourth is the y coordinate of the target tiepoint(yp).

The output arrays contain the coefficients for the two bilinear transforms:
     x' = a + b*x + c*x*y + d*y
     y' = e + f*x + g*x*y + h*y where the point (x,y) is mapped to (x',y') by the transform. The coefficients a,b,c, and d are returned in array xc, while coefficients e,f,g, and h are returned in array yc.

SEE ALSO
vbilinco(1), intro(3), vipl(3), verror(3), vutils(3) lvwarp(3)

RESTRICTIONS
vbilinco will only operate on VFF_TYP_FLOAT.

AUTHOR
Scott Wilson

COPYRIGHT
Copyright 1991, University of New Mexico. All rights reserved.