~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/vision/calib/cal_util.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #ifdef TRANSPUTER
  4 #include <valuesdual.h>
  5 #else
  6 #include <values.h>
  7 #endif
  8 #include <math.h>
  9 #include <tina/sys.h>
 10 #include <tina/sysfuncs.h>
 11 #include <tina/math.h>
 12 #include <tina/mathfuncs.h>
 13 #include <tina/vision.h>
 14 #include <tina/visionfuncs.h>
 15 
 16 /* standard access funtion to get left image pixel position from the 3D
 17  * to image match structure */
 18 
 19 Vec2   *leftpix_get(List * l)
 20 {
 21     Match  *image_3d;
 22     Match  *left_right;
 23 
 24     if ((image_3d = (Match *) l->to)
 25         && (left_right = image_3d->to2))
 26         return (left_right->to1);
 27     else
 28         return (NULL);
 29 }
 30 
 31 /* standard access funtion to get right image pixel position from the
 32  * 3D to image match structure */
 33 
 34 Vec2   *rightpix_get(List * l)
 35 {
 36     Match  *image_3d;
 37     Match  *left_right;
 38 
 39     if ((image_3d = (Match *) l->to)
 40         && (left_right = image_3d->to2))
 41         return (left_right->to2);
 42     else
 43         return (NULL);
 44 }
 45 
 46 Vec3   *world_get(List * l)
 47 {
 48     Match  *image_3d;
 49 
 50     if ((image_3d = l->to))
 51         return (image_3d->to1);
 52     else
 53         return (NULL);
 54 }
 55 
 56 void    calib_update(Covar * tot_inv, Camera * leftc, Camera * rightc, int mask)
 57 {
 58     int     i, n_par = 0;
 59     double *a;
 60 
 61     if (tot_inv == NULL)
 62         return;
 63 
 64     for (i = 0; i < 16; i++)
 65         if (mask & (1 << i))
 66             n_par++;
 67     a = (double *) ralloc((unsigned) (2 * (n_par + 6) * sizeof(double)));
 68 
 69     (void) conv_camera_int(mask, leftc, &a[6]);
 70     (void) conv_camera_int(mask, rightc, &a[n_par + 6]);
 71     (void) conv_camera_ext(leftc, a);
 72     (void) conv_camera_rel(leftc, rightc, &a[n_par]);
 73     for (i = 0; i < 2 * n_par + 6; i++)
 74         VECTOR_GET(tot_inv->vec, i, a[i + 6]);
 75     (void) store_camera_int(mask, &a[6], leftc);
 76     (void) store_camera_int(mask, &a[n_par + 2 * 6], rightc);
 77     (void) store_camera_ext(a, leftc);
 78     (void) store_camera_rel(&a[n_par + 6], leftc, rightc);
 79     rfree((void *) a);
 80 }
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.