home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
CMU
/
cmu_files
/
cal
/
test.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-11
|
1KB
|
39 lines
/* Program to read FIDO calibration files and transform image coordinates
* to ideal coordinates. This was used to check the ideal coordinates
* in the "info.save1" and "info.save2" files that were generated with the
* wrong calibration data. I hope to recover by retransforming the image
* coordinates with the correct calibration data.
*/
#include <strings.h>
#include "test.h"
int maxrow = 479, maxcol = 511;
main ()
{
char calfile[100], datafile[100];
double x, y, z;
int lc, rc;
double lx, ly, rx, ry, baseline, getdouble();
if (!coordsetup (NUMDISTORTIONPOLYS))
quit (1, "Can't set up coord package\n");
getstr ("Calibration file? ", "aug2", calfile);
getcalibration (calfile);
baseline = getdouble ("Stereo baseline? ", 0.1, 5.0, 0.25);
printf ("baseline %f\n", baseline);
for (;;) {
lc = getint ("Left col? ", 0, maxcol, 0);
rc = getint ("Right col? ", 0, maxcol, 0);
RCI (240, lc, lx, ly, LEFT);
RCI (240, rc, rx, ry, RIGHT);
z = baseline / (lx - rx);
x = lx * z;
y = ly * z;
printf ("lx %f rx %f\n", lx, rx);
printf ("x %f y %f z %f\n", x, y, z);
}
}