contrib/brl/bseg/segv/segv_segmentation_manager.h
Go to the documentation of this file.
00001 #ifndef segv_segmentation_manager_h_
00002 #define segv_segmentation_manager_h_
00003 //--------------------------------------------------------------------------------
00004 //:
00005 // \file
00006 // \brief Manager for segmentation algorithm execution and display
00007 // \author
00008 //   J.L. Mundy
00009 //
00010 // \verbatim
00011 //  Modifications:
00012 //   J.L. Mundy November 18, 2002    Initial version.
00013 // \endverbatim
00014 //---------------------------------------------------------------------------
00015 #include <vcl_vector.h>
00016 #include <vil1/vil1_image.h>
00017 #include <vsol/vsol_line_2d_sptr.h>
00018 #include <vsol/vsol_polyline_2d_sptr.h>
00019 #include <vtol/vtol_edge_2d_sptr.h>
00020 #include <vsol/vsol_point_2d_sptr.h>
00021 #include <vtol/vtol_intensity_face_sptr.h>
00022 #include <vtol/vtol_face_2d_sptr.h>
00023 #include <vgui/vgui_wrapper_tableau.h>
00024 #include <vgui/vgui_grid_tableau_sptr.h>
00025 #include <vgui/vgui_rubberband_tableau_sptr.h>
00026 #include <vgui/vgui_style_sptr.h>
00027 #include <bgui/bgui_picker_tableau_sptr.h>
00028 #include <bgui/bgui_vtol2D_tableau_sptr.h>
00029 #include <bgui/bgui_image_tableau_sptr.h>
00030 #include <bgui/bgui_bargraph_clipon_tableau_sptr.h>
00031 
00032 class vgui_window;
00033 
00034 class segv_segmentation_manager : public vgui_wrapper_tableau
00035 {
00036  public:
00037   segv_segmentation_manager();
00038   ~segv_segmentation_manager();
00039   static segv_segmentation_manager *instance();
00040   void quit();
00041   void load_image();
00042   void clear_display();
00043   void original_image();
00044   void roi();
00045   void gaussian();
00046   void convolution();
00047   void downsample();
00048   void harris_measure();
00049   void beaudet_measure();
00050   void vd_edges();
00051   void regions();
00052   void test_camera_parms();
00053   void fit_lines();
00054   void test_face();
00055   void test_digital_lines();
00056   void display_IHS();
00057   void rotate_image();
00058   void compute_mutual_info();
00059   void create_box();
00060   void create_polygon();
00061   void compute_background_info();
00062   void set_foreground_face();
00063   void set_background_face();
00064   void compute_watershed_regions();
00065   void display_histogram_track();
00066   void set_range_params();
00067 
00068 #if 0
00069 #ifdef HAS_XERCES
00070   void read_xml_edges();
00071 #endif
00072 #endif
00073 
00074   void init();
00075 
00076   //: access to the window
00077   vgui_window* get_window(){return win_;}
00078   void set_window(vgui_window* win){win_=win;}
00079 
00080  protected:
00081   void draw_edges(vcl_vector<vtol_edge_2d_sptr>& edges, bool verts=false);
00082   void draw_lines(vcl_vector<vsol_line_2d_sptr> const & line_segs,
00083                   const vgui_style_sptr& style = NULL);
00084   void draw_polylines(vcl_vector<vsol_polyline_2d_sptr> const & polys);
00085   void draw_regions(vcl_vector<vtol_intensity_face_sptr>& regions,
00086                     bool verts=false);
00087   void draw_points(vcl_vector<vsol_point_2d_sptr> const & points,
00088                    const vgui_style_sptr& style);
00089 
00090   void set_selected_grid_image(vil1_image& image);
00091   void add_image(vil1_image& image);
00092   void add_image_at(vil1_image& image, const unsigned col, const unsigned row);
00093   vil1_image selected_image();
00094   vil1_image image_at(const unsigned col, const unsigned row);
00095   bool
00096   set_image_at(const unsigned col, const unsigned row, vil1_image& image);
00097   bgui_image_tableau_sptr selected_image_tab();
00098   bgui_vtol2D_tableau_sptr selected_vtol2D_tab();
00099   bgui_picker_tableau_sptr selected_picker_tab();
00100   vgui_rubberband_tableau_sptr selected_rubber_tab();
00101   vtol_face_2d_sptr face_at(const int col, const int row);
00102 
00103  private:
00104   //flags
00105   bool first_; //first image load
00106   vgui_window* win_;
00107   vgui_grid_tableau_sptr grid_;
00108   vtol_face_2d_sptr foreground_face_;
00109   vtol_face_2d_sptr background_face_;
00110   bgui_bargraph_clipon_tableau_sptr bargraph_;
00111   static segv_segmentation_manager *instance_;
00112 };
00113 
00114 #endif // segv_segmentation_manager_h_