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

Linux Cross Reference
Tina6/tina-libs/tina/vision/visCalib_util.c

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

  1 /**********
  2  *
  3  * This file is part of the TINA Open Source Image Analysis Environment
  4  * henceforth known as TINA
  5  *
  6  * TINA is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU General Public License as
  8  * published by the Free Software Foundation.
  9  *
 10  * TINA is distributed in the hope that it will be useful,
 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  * GNU General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU General Public License
 16  * along with TINA; if not, write to the Free Software Foundation, Inc.,
 17  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18  *
 19  * ANY users of TINA who require exemption from the existing licence must
 20  * negotiate a new licence with Dr. Neil.A.Thacker, the sole agent for
 21  * the University of Manchester.
 22  *
 23  **********
 24  *
 25  * Program :    TINA
 26  * File    :  $Source: /home/tina/cvs/tina-libs/tina/vision/visCalib_util.c,v $
 27  * Date    :  $Date: 2003/10/06 12:29:47 $
 28  * Version :  $Revision: 1.3 $
 29  * CVS Id  :  $Id: visCalib_util.c,v 1.3 2003/10/06 12:29:47 neil Exp $
 30  *
 31  * Author  : Legacy TINA
 32  *
 33  * Notes :
 34  *
 35  *********
 36 */
 37 
 38 #include "visCalib_util.h"
 39 
 40 #if HAVE_CONFIG_H
 41   #include <config.h>
 42 #endif
 43 
 44 #include <math.h>
 45 #include <tina/sys/sysDef.h>
 46 #include <tina/sys/sysPro.h>
 47 #include <tina/math/mathDef.h>
 48 #include <tina/math/mathPro.h>
 49 #include <tina/geometry/geomDef.h>
 50 #include <tina/geometry/geomPro.h>
 51 #include <tina/vision/vis_CalibPro.h>
 52 
 53 /* standard access funtion to get left image pixel position from the 3D
 54  * to image match structure */
 55 
 56 Vec2   *leftpix_get(List * l)
 57 {
 58     Match  *image_3d;
 59     Match  *left_right;
 60 
 61     if ((image_3d = (Match *) l->to)
 62         && (left_right = image_3d->to2))
 63         return (left_right->to1);
 64     else
 65         return (NULL);
 66 }
 67 
 68 /* standard access funtion to get right image pixel position from the
 69  * 3D to image match structure */
 70 
 71 Vec2   *rightpix_get(List * l)
 72 {
 73     Match  *image_3d;
 74     Match  *left_right;
 75 
 76     if ((image_3d = (Match *) l->to)
 77         && (left_right = image_3d->to2))
 78         return (left_right->to2);
 79     else
 80         return (NULL);
 81 }
 82 
 83 Vec3   *world_get(List * l)
 84 {
 85     Match  *image_3d;
 86 
 87     if ((image_3d = l->to))
 88         return (image_3d->to1);
 89     else
 90         return (NULL);
 91 }
 92 
 93 void    calib_update(Covar * tot_inv, Camera * leftc, Camera * rightc, int mask)
 94 {
 95     int     i, n_par = 0;
 96     double *a;
 97 
 98     if (tot_inv == NULL)
 99         return;
100 
101     for (i = 0; i < 16; i++)
102         if (mask & (1 << i))
103             n_par++;
104     a = (double *) ralloc((unsigned) (2 * (n_par + 6) * sizeof(double)));
105 
106     (void) conv_camera_int(mask, leftc, &a[6]);
107     (void) conv_camera_int(mask, rightc, &a[n_par + 6]);
108     (void) conv_camera_ext(leftc, a);
109     (void) conv_camera_rel(leftc, rightc, &a[n_par]);
110     for (i = 0; i < 2 * n_par + 6; i++)
111         VECTOR_GET(tot_inv->vec, i, a[i + 6]);
112     (void) store_camera_int(mask, &a[6], leftc);
113     (void) store_camera_int(mask, &a[n_par + 2 * 6], rightc);
114     (void) store_camera_ext(a, leftc);
115     (void) store_camera_rel(&a[n_par + 6], leftc, rightc);
116     rfree((void *) a);
117 }
118 

~ [ 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.