00001
00002 #ifndef bmvv_recon_manager_h_
00003 #define bmvv_recon_manager_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include <vcl_vector.h>
00017 #include <vcl_map.h>
00018 #include <vil1/vil1_image.h>
00019 #include <mvl/FMatrix.h>
00020 #include <vtol/vtol_intensity_face_sptr.h>
00021 #include <vgui/vgui_wrapper_tableau.h>
00022 #include <vgui/vgui_grid_tableau.h>
00023 #include <vgui/vgui_grid_tableau_sptr.h>
00024 #include <bgui/bgui_vtol2D_tableau_sptr.h>
00025 #include <bgui/bgui_picker_tableau_sptr.h>
00026 #include <brct/brct_plane_corr_sptr.h>
00027 #include <brct/brct_plane_calibrator.h>
00028 #include <brct/brct_plane_sweeper.h>
00029 #include <brct/brct_volume_processor.h>
00030
00031 class vgui_window;
00032 class vgui_soview;
00033
00034 class bmvv_recon_manager : public vgui_wrapper_tableau
00035 {
00036 public:
00037 bmvv_recon_manager();
00038 ~bmvv_recon_manager();
00039 static bmvv_recon_manager *instance();
00040
00041
00042 void quit();
00043 void load_image();
00044 void clear_display();
00045 void clear_selected();
00046 void read_3d_points();
00047 void initial_model_projection();
00048 void model_projection();
00049 void print_selected_corr();
00050 void pick_corr();
00051 void write_corrs();
00052 void read_corrs();
00053 void compute_homographies();
00054 void write_homographies();
00055 void read_homographies();
00056 void project_image();
00057 void map_image();
00058 void set_images();
00059 void compute_harris_corners();
00060 void overlapping_projections();
00061 void overlapping_projections_z();
00062 void overlapping_harris_proj_z();
00063 void cross_correlate_plane();
00064 void cross_correlate_z();
00065 void cross_correlate_harris_z();
00066 void depth_image();
00067 void harris_depth_match();
00068 void z_corr_image();
00069 void corr_plot();
00070 void map_point();
00071 void map_harris_corners();
00072 void match_harris_corners();
00073 void harris_sweep();
00074 void display_matched_corners();
00075 void display_harris_3d();
00076 void write_points_vrml();
00077 void read_points_vrml();
00078 void write_volumes_vrml();
00079 void read_change_data();
00080 void write_change_volumes_vrml();
00081 void compute_change();
00082 #if 0
00083 void display_dense_match();
00084 #endif
00085 void read_f_matrix();
00086 void show_epipolar_line();
00087 void show_world_homography();
00088
00089 vgui_window* get_window(){return win_;}
00090 void set_window(vgui_window* win){win_=win;}
00091 void init();
00092
00093 virtual bool handle(const vgui_event&);
00094 void load_image_file(vcl_string image_filename, bool greyscale, unsigned col, unsigned row);
00095
00096 protected:
00097
00098 void draw_regions(vcl_vector<vtol_intensity_face_sptr>& regions,
00099 bool verts=false);
00100 void create_point(int& cam, vsol_point_2d_sptr& p);
00101 int get_cam();
00102 brct_plane_corr_sptr get_selected_corr();
00103 void draw_corr_point(const float x, const float y);
00104 void draw_vsol_points(const int cam,
00105 vcl_vector<vsol_point_2d_sptr> const & points,
00106 bool clear = true,
00107 const float r = 0,
00108 const float g = 1,
00109 const float b = 0);
00110
00111 void draw_vsol_point(const int cam,
00112 vsol_point_2d_sptr const & point,
00113 bool clear = false,
00114 const float r = 0,
00115 const float g = 1,
00116 const float b = 0);
00117
00118 void draw_vsol_3d_points(const int cam,
00119 vcl_vector<vsol_point_3d_sptr> const& pts3d,
00120 bool clear = true);
00121
00122 bgui_vtol2D_tableau_sptr get_vtol2D_tableau_at(unsigned col, unsigned row);
00123 bgui_vtol2D_tableau_sptr get_selected_vtol2D_tableau();
00124 bgui_picker_tableau_sptr get_picker_tableau_at(unsigned col, unsigned row);
00125 bgui_picker_tableau_sptr get_selected_picker_tableau();
00126 vil1_image get_image_at(unsigned col, unsigned row);
00127
00128
00129 private:
00130 bool images_set_;
00131 bool harris_set_;
00132 vil1_image img_;
00133 vgui_window* win_;
00134 vcl_vector<bgui_vtol2D_tableau_sptr> vtol_tabs_;
00135 vgui_grid_tableau_sptr grid_;
00136 brct_plane_calibrator cal_;
00137 brct_plane_sweeper sweep_;
00138 brct_volume_processor vproc_;
00139 int plane_;
00140 vcl_map<int, int> point_3d_map_;
00141 static bmvv_recon_manager *instance_;
00142 FMatrix f_matrix_;
00143 };
00144
00145 #endif // bmvv_recon_manager_h_