ColorTrainWidget Class Reference

This widget implements the complete color training process. More...

#include <color_train_widget.h>

List of all members.

Public Member Functions

 ColorTrainWidget (Gtk::Window *parent)
 Constructor.
virtual ~ColorTrainWidget ()
 Destructor.
void set_fg_object (firevision::hint_t fg_object)
 Set the current foreground object.
void set_src_buffer (unsigned char *buffer, unsigned int img_width, unsigned int img_height)
 Set the buffer containing the image data.
void set_draw_buffer (unsigned char *buffer)
 Set the buffer to draw the selection into.
void click (unsigned int x, unsigned int y, unsigned int button=MOUSE_BUTTON_LEFT)
 The user clicked into the image.
void reset_selection ()
 Reset the selection.
void load_histograms ()
 Open a dialog to load a histogram.
void save_histograms ()
 Open a dialog to save a histogram.
void add_to_colormap ()
 Generate a new colormap by adding the current histograms.
void reset_colormap ()
 Reset the colormap.
void load_colormap ()
 Open a dialog to load a colormap.
void save_colormap ()
 Open a dialog to save a colormap.
firevision::YuvColormapget_colormap () const
 Get the current colormap.
void draw_segmentation_result ()
 Render the result of segmenting the image in the source buffer considering the current colormap into the specified Image.
void set_reset_selection_btn (Gtk::Button *btn)
 Set the button to reset the selection.
void set_add_to_colormap_btn (Gtk::Button *btn)
 Set the button to trigger the generation of the colormap.
void set_reset_colormap_btn (Gtk::Button *btn)
 Set the button to reset the colormap.
void set_load_histos_btn (Gtk::Button *btn)
 Set the buffon to open a dialog to load histograms.
void set_save_histos_btn (Gtk::Button *btn)
 Set the buffon to open a dialog to save histograms.
void set_load_colormap_btn (Gtk::Button *btn)
 Set the buffon to open a dialog to load a colormap.
void set_save_colormap_btn (Gtk::Button *btn)
 Set the buffon to open a dialog to save a colormap.
void set_colormap_img (Gtk::Image *img)
 Set the image to render the colormap into.
void set_segmentation_img (Gtk::Image *img)
 Set the image to render the segmented image into.
void set_threshold_scl (Gtk::Scale *scl)
 Set the scale to control the selection threshold.
void set_min_prob_scl (Gtk::Scale *scl)
 Set the scale to control the minimum probability.
void set_filechooser_dlg (Gtk::FileChooserDialog *dlg)
 Set the filechooser dialog to be used by this widget.
void set_cm_layer_selector (Gtk::Scale *scl)
 Set the widget to choose the layer of the colormap to display.
void set_cm_selector (Gtk::SpinButton *depth, Gtk::SpinButton *width=0, Gtk::SpinButton *height=0)
 Set the widget to adjust the depth of the colormap.
Glib::Dispatcher & update_image ()
 Access the signal that is emitted whenever a redraw of the image is necessary.
Glib::Dispatcher & colormap_updated ()
 Access the signal that is emitted whenever the colormap has changed.

Static Public Attributes

static const unsigned int MOUSE_BUTTON_LEFT = 1
 constant for left mouse button id
static const unsigned int MOUSE_BUTTON_RIGHT = 3
 constant for right mouse button id

Detailed Description

This widget implements the complete color training process.

Author:
Daniel Beck

Definition at line 38 of file color_train_widget.h.


Constructor & Destructor Documentation

ColorTrainWidget::ColorTrainWidget ( Gtk::Window *  parent  ) 

Constructor.

Parameters:
parent the parent window

Definition at line 52 of file color_train_widget.cpp.

ColorTrainWidget::~ColorTrainWidget (  )  [virtual]

Destructor.

Definition at line 79 of file color_train_widget.cpp.


Member Function Documentation

void ColorTrainWidget::add_to_colormap (  ) 
void ColorTrainWidget::click ( unsigned int  x,
unsigned int  y,
unsigned int  button = MOUSE_BUTTON_LEFT 
)
Glib::Dispatcher & ColorTrainWidget::colormap_updated (  ) 

Access the signal that is emitted whenever the colormap has changed.

Returns:
reference to a Dispatcher.

Definition at line 366 of file color_train_widget.cpp.

Referenced by Firestation::Firestation().

void ColorTrainWidget::draw_segmentation_result (  ) 
YuvColormap * ColorTrainWidget::get_colormap (  )  const

Get the current colormap.

Returns:
the current colormap

Definition at line 627 of file color_train_widget.cpp.

References firevision::BayesColormapGenerator::get_current().

void ColorTrainWidget::load_colormap (  ) 
void ColorTrainWidget::load_histograms (  ) 
void ColorTrainWidget::reset_colormap (  ) 
void ColorTrainWidget::reset_selection (  ) 

Reset the selection.

Definition at line 186 of file color_train_widget.cpp.

References firevision::Zauberstab::deleteRegion().

Referenced by set_reset_selection_btn().

void ColorTrainWidget::save_colormap (  ) 
void ColorTrainWidget::save_histograms (  ) 

Open a dialog to save a histogram.

Definition at line 419 of file color_train_widget.cpp.

References firevision::BayesColormapGenerator::save_histograms().

Referenced by set_save_histos_btn().

void ColorTrainWidget::set_add_to_colormap_btn ( Gtk::Button *  btn  ) 

Set the button to trigger the generation of the colormap.

Parameters:
btn a Button

Definition at line 211 of file color_train_widget.cpp.

References add_to_colormap().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_cm_layer_selector ( Gtk::Scale *  scl  ) 

Set the widget to choose the layer of the colormap to display.

Parameters:
scl a Scale

Definition at line 335 of file color_train_widget.cpp.

References ColormapViewerWidget::set_layer_selector().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_cm_selector ( Gtk::SpinButton *  depth,
Gtk::SpinButton *  width = 0,
Gtk::SpinButton *  height = 0 
)

Set the widget to adjust the depth of the colormap.

Parameters:
depth SpinButton to set the Y-resolution of the color map
width SpinButton to set the U-resolution of the color map
height SpinButton to set the V-resolution of the color map

Definition at line 346 of file color_train_widget.cpp.

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_colormap_img ( Gtk::Image *  img  ) 

Set the image to render the colormap into.

Parameters:
img an Image

Definition at line 271 of file color_train_widget.cpp.

References ColormapViewerWidget::set_colormap_img().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_draw_buffer ( unsigned char *  buffer  ) 

Set the buffer to draw the selection into.

It is assumed that this buffer has the same dimensions as the buffer holding the soruce image.

Parameters:
buffer the draw buffer

Definition at line 129 of file color_train_widget.cpp.

void ColorTrainWidget::set_fg_object ( firevision::hint_t  fg_object  ) 

Set the current foreground object.

Parameters:
fg_object the foreground object

Definition at line 90 of file color_train_widget.cpp.

void ColorTrainWidget::set_filechooser_dlg ( Gtk::FileChooserDialog *  dlg  ) 

Set the filechooser dialog to be used by this widget.

Parameters:
dlg a FileChooserDialog

Definition at line 326 of file color_train_widget.cpp.

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_load_colormap_btn ( Gtk::Button *  btn  ) 

Set the buffon to open a dialog to load a colormap.

Parameters:
btn a Button

Definition at line 251 of file color_train_widget.cpp.

References load_colormap().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_load_histos_btn ( Gtk::Button *  btn  ) 

Set the buffon to open a dialog to load histograms.

Parameters:
btn a Button

Definition at line 231 of file color_train_widget.cpp.

References load_histograms().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_min_prob_scl ( Gtk::Scale *  scl  ) 

Set the scale to control the minimum probability.

Parameters:
scl a Scale

Definition at line 316 of file color_train_widget.cpp.

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_reset_colormap_btn ( Gtk::Button *  btn  ) 

Set the button to reset the colormap.

Parameters:
btn a Button

Definition at line 221 of file color_train_widget.cpp.

References reset_colormap().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_reset_selection_btn ( Gtk::Button *  btn  ) 

Set the button to reset the selection.

Parameters:
btn the reset selection button

Definition at line 201 of file color_train_widget.cpp.

References reset_selection().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_save_colormap_btn ( Gtk::Button *  btn  ) 

Set the buffon to open a dialog to save a colormap.

Parameters:
btn a Button

Definition at line 261 of file color_train_widget.cpp.

References save_colormap().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_save_histos_btn ( Gtk::Button *  btn  ) 

Set the buffon to open a dialog to save histograms.

Parameters:
btn a Button

Definition at line 241 of file color_train_widget.cpp.

References save_histograms().

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_segmentation_img ( Gtk::Image *  img  ) 

Set the image to render the segmented image into.

Parameters:
img an Image

Definition at line 280 of file color_train_widget.cpp.

Referenced by Firestation::Firestation().

void ColorTrainWidget::set_src_buffer ( unsigned char *  yuv422_buffer,
unsigned int  img_width,
unsigned int  img_height 
)

Set the buffer containing the image data.

Parameters:
yuv422_buffer the YUV422_PLANAR buffer holding the image data
img_width the width of the image
img_height the height of the image

Definition at line 101 of file color_train_widget.cpp.

References firevision::Zauberstab::deleteRegion(), firevision::Zauberstab::setBuffer(), and firevision::Zauberstab::setThreshold().

void ColorTrainWidget::set_threshold_scl ( Gtk::Scale *  scl  ) 

Set the scale to control the selection threshold.

Parameters:
scl a Scale

Definition at line 306 of file color_train_widget.cpp.

Referenced by Firestation::Firestation().

Glib::Dispatcher & ColorTrainWidget::update_image (  ) 

Access the signal that is emitted whenever a redraw of the image is necessary.

Returns:
reference to a Dispatcher.

Definition at line 357 of file color_train_widget.cpp.

Referenced by Firestation::Firestation().


Member Data Documentation

const unsigned int ColorTrainWidget::MOUSE_BUTTON_LEFT = 1 [static]

constant for left mouse button id

Definition at line 41 of file color_train_widget.h.

Referenced by click().

const unsigned int ColorTrainWidget::MOUSE_BUTTON_RIGHT = 3 [static]

constant for right mouse button id

Definition at line 42 of file color_train_widget.h.

Referenced by click().


The documentation for this class was generated from the following files:

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1