OmniFastLookupTable.hh

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) Massimo Cora' 2005 <maxcvs@email.it>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 
00020 #ifndef __OMNI_FAST_LOOKUP_TABLE_H__
00021 #define __OMNI_FAST_LOOKUP_TABLE_H__
00022 
00023 
00024 #include "OmniConfig.hh"
00025 #include "OmniAngle.hh"
00026 
00027 // opencv
00028 #include <cv.h>
00029 #include <highgui.h>
00030 
00031 
00032 // some defines to clean the code and make it more readable
00033 #define OMNI_COORD(theta,radius) \
00034         omni_bounds.omni_data[theta][radius]
00035 
00036 #define PANO_COORD(theta,radius) \
00037         pano_bounds.pano_data[theta][radius]
00038 
00044 class OmniFastLookupTable {
00045 public: 
00060         OmniFastLookupTable( int min_radius,
00061                                                  int max_radius,
00062                                                  int omni_center_x_pixel,
00063                                                  int omni_center_y_pixel,
00064                                                  double theta_step = 0,         
00065                                                  bool flipped_mode = false );
00066         virtual ~OmniFastLookupTable();
00067 
00073         void angle_type_conversion( const OmniAngle<double> &in_double_interval, 
00074                                                                 OmniAngle<int> &out_int_interval );
00075 
00084         IplImage* omni2pano( IplImage *omni_frame, const OmniAngle<int> &IN_interval );
00085         
00086         // we shouldn't need this implementation right now
00087         //IplImage* omni2pano( IplImage *omni_frame, const OmniAngle<double> &IN_interval );
00088 
00099         void pano2omni_xy( CvPoint *pano_point, 
00100                                            int theta_start,
00101                                            CvPoint *omni_point );
00102 
00103         int get_min_radius();
00104         int get_max_radius();
00105         int get_omni_center_x();
00106         int get_omni_center_y();
00107         
00109         bool is_initialized ();
00110 
00111 private:                // functions
00115         bool omnipano_lookup_table_make();
00116 
00117 private:                // data
00118 
00123         typedef struct _image_coord_xy {
00124                 int x_rgb;              
00125                 int y_rgb;              
00126 
00127         } pano_coord_xy, *pano_coord_xy_ptr,
00128         omni_coord_xy, *omni_coord_xy_ptr;
00129 
00134         struct _omni_bounds {
00135                 omni_coord_xy **omni_data;              
00136 
00138                 int theta_length;                               
00139                 int radius_length;                              
00140         } omni_bounds;
00141         
00145         struct _pano_bounds {
00147                 pano_coord_xy **pano_data;              
00148 
00150                 int width;
00151                 int height;
00152         } pano_bounds;
00153 
00154 
00155         double _theta_step;
00156         int _theta_max;
00157         int _min_radius;
00158         int _max_radius;
00159         int _min_to_max_radius_range;
00160 
00162         bool _flipped_mode;
00163         
00168         int _omni_center_x_rgb;
00169         
00174         int _omni_center_y_rgb;
00175 
00176         int _omni_center_x;
00177         int _omni_center_y;
00178         
00180         bool _is_valid;
00181 };
00182 
00183 
00184 #endif
00185 
00186 

Generated on Tue Dec 26 10:32:38 2006 for Omnimeeting by  doxygen 1.4.7