23 #ifndef __FIREVISION_TOOLS_FIRESTATION_COLOR_TRAIN_WIDGET_H_ 24 #define __FIREVISION_TOOLS_FIRESTATION_COLOR_TRAIN_WIDGET_H_ 26 #include <fvutils/base/roi.h> 27 #include <fvutils/color/colorspaces.h> 33 class BayesColormapGenerator;
41 static const unsigned int MOUSE_BUTTON_LEFT = 1;
42 static const unsigned int MOUSE_BUTTON_RIGHT = 3;
47 void set_fg_object(firevision::hint_t fg_object);
49 void set_src_buffer(
unsigned char* buffer,
50 unsigned int img_width,
unsigned int img_height);
51 void set_draw_buffer(
unsigned char* buffer);
54 void click(
unsigned int x,
unsigned int y,
unsigned int button = MOUSE_BUTTON_LEFT);
55 void reset_selection();
57 void load_histograms();
58 void save_histograms();
60 void add_to_colormap();
61 void reset_colormap();
66 void draw_segmentation_result();
68 void set_reset_selection_btn(Gtk::Button* btn);
69 void set_add_to_colormap_btn(Gtk::Button* btn);
70 void set_reset_colormap_btn(Gtk::Button* btn);
71 void set_load_histos_btn(Gtk::Button* btn);
72 void set_save_histos_btn(Gtk::Button* btn);
73 void set_load_colormap_btn(Gtk::Button* btn);
74 void set_save_colormap_btn(Gtk::Button* btn);
75 void set_colormap_img(Gtk::Image* img);
76 void set_segmentation_img(Gtk::Image* img);
77 void set_threshold_scl(Gtk::Scale* scl);
78 void set_min_prob_scl(Gtk::Scale* scl);
79 void set_filechooser_dlg(Gtk::FileChooserDialog* dlg);
80 void set_cm_layer_selector(Gtk::Scale* scl);
81 void set_cm_selector(Gtk::SpinButton* depth, Gtk::SpinButton* width = 0, Gtk::SpinButton* height = 0);
83 Glib::Dispatcher& update_image();
84 Glib::Dispatcher& colormap_updated();
87 void resize_seg_image(Gtk::Allocation& allocation);
88 bool set_threshold(Gtk::ScrollType scroll,
double value);
89 bool set_min_prob(Gtk::ScrollType scroll,
double value);
90 static void free_rgb_buffer(
const guint8* rgb_buffer);
98 firevision::hint_t m_fg_object;
100 unsigned char* m_src_buffer;
101 unsigned char* m_draw_buffer;
102 unsigned int m_img_width;
103 unsigned int m_img_height;
104 unsigned int m_img_size;
105 firevision::colorspace_t m_img_cs;
106 unsigned int m_seg_img_max_width;
107 unsigned int m_seg_img_max_height;
109 Gtk::Window* m_wnd_parent;
110 Gtk::Button* m_btn_reset_selection;
111 Gtk::Button* m_btn_add_to_colormap;
112 Gtk::Button* m_btn_reset_colormap;
113 Gtk::Button* m_btn_load_histos;
114 Gtk::Button* m_btn_save_histos;
115 Gtk::Button* m_btn_load_colormap;
116 Gtk::Button* m_btn_save_colormap;
117 Gtk::SpinButton* m_spbtn_cm_depth;
118 Gtk::SpinButton* m_spbtn_cm_width;
119 Gtk::SpinButton* m_spbtn_cm_height;
120 Gtk::Image* m_img_segmentation;
121 Gtk::Scale* m_scl_threshold;
122 Gtk::Scale* m_scl_min_prob;
123 Gtk::FileChooserDialog* m_fcd_filechooser;
125 Glib::Dispatcher m_signal_update_image;
126 Glib::Dispatcher m_signal_colormap_updated;
Zaubertab selection utility.
Colormap Generator using Bayes method.