00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
00028 #include <cv.h>
00029 #include <highgui.h>
00030
00031
00032
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
00087
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:
00115 bool omnipano_lookup_table_make();
00116
00117 private:
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