/* Fast image rectifier, applying calibration parameters
   from the "flatfish" radial distortion finder and rectifier
   for solid state cameras with wide angle lenses.
                              Created 4/96
                              Hans Moravec <hpm@cmu.edu>
                              Carnegie Mellon University
			      Pittsburgh, PA  15213
			      working at Daimler Benz research, Berlin */

/* Structure to hold raw calibration parameters and rectification tables */
typedef struct {Int32 Ph, Pw;		/* Height and Width of image */
		Float32 Yaim, Xaim, Distance, FOV;  /* Calibration setup */
		Float32 Pi, Pj, AS; /* pixel optical center and aspect ratio */
		Float32 Si, Sj;     /* optical image center in spot coords */
		Float32 AN;	     /* Roll angle of the grid image */
		Int32  PN;	    /* degree of radial distortion polynomials */
		Float32 *P;         /* Spot->Pixel radius polynomial */
		Float32 *S;         /* Pixel->Spot radius polynomial */
		signed Int8 *di, *dj; /* rectification offset tables */
		gray **pij;   /* rectification full pointer table */
	      }  Calib;

int getfish(char *CalFile, Calib *Cal, gray **picin);

void applyfish(gray **picin, Calib *Cal, gray **picout);
