TLIB documentation
 

tlCameraTSAI.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This file is part of the TLIB computer vision library.
00004 //  Copyright (C) 2003-2008 Sebastien Grange
00005 //  Copyright (C) 2003-2007 VRAI Group, EPFL
00006 //  All rights reserved.
00007 // 
00008 //  This library is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License("GPL") version 2
00010 //  as published by the Free Software Foundation.
00011 // 
00012 //  <http://www.tuyphon.com/tlib>
00013 //
00014 /////////////////////////////////////////////////////////////////////////////////
00015 
00016 
00017 #ifndef __TLCAMERATSAI_H__
00018 #define __TLCAMERATSAI_H__
00019 
00020 
00021 #include "tlVision.h"
00022 #include "tlCamera.h"
00023 
00024 
00025 #define TL_CAMERA_TSAI_FILENAME     "tsai.ini"
00026 #define TL_CAMERA_TSAI_MAX_POINTS   500
00027 
00028 // calibration data structure
00029 typedef struct {
00030   double  Ncx;              // [sel]     Number of sensor elements in camera's x direction
00031   double  Nfx;              // [pix]     Number of pixels in frame grabber's x direction   
00032   double  dx;                 // [mm/sel]  X dimension of camera's sensor element (in mm)    
00033   double  dy;                 // [mm/sel]  Y dimension of camera's sensor element (in mm)    
00034   double  dpx;              // [mm/pix]  Effective X dimension of pixel in frame grabber   
00035   double  dpy;              // [mm/pix]  Effective Y dimension of pixel in frame grabber   
00036   double  Cx;                 // [pix]     Z axis intercept of camera coordinate system      
00037   double  Cy;                 // [pix]     Z axis intercept of camera coordinate system      
00038   double  sx;                 // []        Scale factor to compensate for any error in dpx   
00039   int     coplanar;   // []        1 if all input points are coplanar, 0 otherwise
00040   int     numPoints;
00041   double  xw[TL_CAMERA_TSAI_MAX_POINTS];    // world X coord
00042   double  yw[TL_CAMERA_TSAI_MAX_POINTS];    // world Y coord
00043   double  zw[TL_CAMERA_TSAI_MAX_POINTS];    // world Z coord
00044   double  Xf[TL_CAMERA_TSAI_MAX_POINTS];    // image X coord
00045   double  Yf[TL_CAMERA_TSAI_MAX_POINTS];    // image Y coord
00046 } tlCameraTSAICalibData;
00047 
00048 
00049 
00050 // debug verbosity
00051 extern int tlVerbose;
00052 
00053 
00054 // interface
00055 class tlCameraTSAI : public tlCamera
00056 {
00057 private:
00058   tlSource *source;
00059 
00060 public:
00061   tlCameraTSAI            ();
00062   tlCameraTSAI            (tlSource *source);
00063   tlCameraTSAI            (char *filename);
00064   tlCameraTSAI            (char *filename, tlSource *source);
00065   virtual ~tlCameraTSAI           ();
00066 
00067   int         readConfig  (char *filename);
00068   int         writeConfig (char *filename);
00069   int         calibrate   (tlCameraTSAICalibData *data);
00070 
00071   int         setSource   (tlSource *source);
00072   tlSource    *getSource  () { return source; };
00073 
00074   int         toWorld     (tlPoint *point);
00075   int         toImage     (tlPoint *point);
00076 
00077   virtual int warp        (tlPoint *point);
00078   virtual int warp        (tlPoint *point, tlPoint *dest);
00079   virtual int dewarp      (tlPoint *point);
00080   virtual int dewarp      (tlPoint *point, tlPoint *dest);
00081   
00082   virtual int warp        (tlImage *image);
00083   virtual int warp        (tlImage *image, tlImage *dest);
00084   virtual int dewarp      (tlImage *image);
00085   virtual int dewarp      (tlImage *image, tlImage *dest);
00086 
00087   virtual int warp        (tlImage *image, tlRect *rect);
00088   virtual int warp        (tlImage *image, tlRect *rect, tlImage *dest);
00089   virtual int dewarp      (tlImage *image, tlRect *rect);
00090   virtual int dewarp      (tlImage *image, tlRect *rect, tlImage *dest);
00091 
00092   virtual int grab        (tlImage *image);
00093   virtual int grab        (tlImage *image, tlRect *rect);
00094   virtual int grabQueued  (tlImage *image);
00095   virtual int grabQueued  (tlImage *image, tlRect *rect);
00096 
00097 };
00098 
00099 #endif
00100 


TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.