mirror_calib.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __FIREVISION_TOOLS_FIRESTATION_MIRROR_CALIB_H_
00024 #define __FIREVISION_TOOLS_FIRESTATION_MIRROR_CALIB_H_
00025
00026 #include <geometry/hom_point.h>
00027
00028 #ifdef HAVE_BULB_CREATOR
00029 #include <models/mirror/bulb/bulb_generator.h>
00030 class Bulb;
00031 class BulbSampler;
00032
00033 class MirrorCalibTool : public BulbGeneratorProgressHandler
00034 #else
00035 class MirrorCalibTool
00036 #endif
00037 {
00038 public:
00039 MirrorCalibTool();
00040 MirrorCalibTool(unsigned int img_width, unsigned int img_height
00041 );
00042 ~MirrorCalibTool();
00043
00044 void start();
00045 void abort();
00046 void step(unsigned int x, unsigned int y);
00047 bool get_next(float* dist, float* ori);
00048
00049 void eval(unsigned int x, unsigned int y, float* x_ret, float* y_ret);
00050
00051 void load(const char* filename);
00052 void save(const char* filename);
00053
00054 void set_img_dimensions(unsigned int width, unsigned int height);
00055
00056 void set_dists(float dists[], unsigned int num_dists);
00057 void set_oris(float oris[], unsigned int num_oris);
00058
00059 void setTotalSteps(unsigned int total_steps);
00060 void setProgress(unsigned int progress);
00061 void finished();
00062
00063 private:
00064 unsigned int m_img_width;
00065 unsigned int m_img_height;
00066
00067 unsigned int m_center_x;
00068 unsigned int m_center_y;
00069
00070 unsigned int m_next_x;
00071 unsigned int m_next_y;
00072 unsigned int m_next_ori;
00073
00074 static float m_sample_dist[];
00075 static float m_sample_ori[];
00076
00077 unsigned int m_sample_step;
00078 unsigned int m_sample_dist_step;
00079 unsigned int m_sample_ori_step;
00080 unsigned int m_num_dists;
00081 unsigned int m_num_oris;
00082
00083 fawkes::HomPoint m_next_sample_point;
00084
00085 bool m_calib_done;
00086 bool m_step_two;
00087
00088 #ifdef HAVE_BULB_CREATOR
00089 Bulb* m_bulb;
00090 BulbSampler* m_sampler;
00091 BulbGenerator* m_generator;
00092 #endif
00093 };
00094
00095
00096 #endif