Fawkes API
Fawkes Development Version
|
This widget implements the complete color training process. More...
#include "color_train_widget.h"
Public Member Functions | |
ColorTrainWidget (Gtk::Window *parent) | |
Constructor. More... | |
virtual | ~ColorTrainWidget () |
Destructor. More... | |
void | set_fg_object (firevision::hint_t fg_object) |
Set the current foreground object. More... | |
void | set_src_buffer (unsigned char *buffer, unsigned int img_width, unsigned int img_height) |
Set the buffer containing the image data. More... | |
void | set_draw_buffer (unsigned char *buffer) |
Set the buffer to draw the selection into. More... | |
void | click (unsigned int x, unsigned int y, unsigned int button=MOUSE_BUTTON_LEFT) |
The user clicked into the image. More... | |
void | reset_selection () |
Reset the selection. More... | |
void | load_histograms () |
Open a dialog to load a histogram. More... | |
void | save_histograms () |
Open a dialog to save a histogram. More... | |
void | add_to_colormap () |
Generate a new colormap by adding the current histograms. More... | |
void | reset_colormap () |
Reset the colormap. More... | |
void | load_colormap () |
Open a dialog to load a colormap. More... | |
void | save_colormap () |
Open a dialog to save a colormap. More... | |
firevision::YuvColormap * | get_colormap () const |
Get the current colormap. More... | |
void | draw_segmentation_result () |
Render the result of segmenting the image in the source buffer considering the current colormap into the specified Image. More... | |
void | set_reset_selection_btn (Gtk::Button *btn) |
Set the button to reset the selection. More... | |
void | set_add_to_colormap_btn (Gtk::Button *btn) |
Set the button to trigger the generation of the colormap. More... | |
void | set_reset_colormap_btn (Gtk::Button *btn) |
Set the button to reset the colormap. More... | |
void | set_load_histos_btn (Gtk::Button *btn) |
Set the buffon to open a dialog to load histograms. More... | |
void | set_save_histos_btn (Gtk::Button *btn) |
Set the buffon to open a dialog to save histograms. More... | |
void | set_load_colormap_btn (Gtk::Button *btn) |
Set the buffon to open a dialog to load a colormap. More... | |
void | set_save_colormap_btn (Gtk::Button *btn) |
Set the buffon to open a dialog to save a colormap. More... | |
void | set_colormap_img (Gtk::Image *img) |
Set the image to render the colormap into. More... | |
void | set_segmentation_img (Gtk::Image *img) |
Set the image to render the segmented image into. More... | |
void | set_threshold_scl (Gtk::Scale *scl) |
Set the scale to control the selection threshold. More... | |
void | set_min_prob_scl (Gtk::Scale *scl) |
Set the scale to control the minimum probability. More... | |
void | set_filechooser_dlg (Gtk::FileChooserDialog *dlg) |
Set the filechooser dialog to be used by this widget. More... | |
void | set_cm_layer_selector (Gtk::Scale *scl) |
Set the widget to choose the layer of the colormap to display. More... | |
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. More... | |
Glib::Dispatcher & | update_image () |
Access the signal that is emitted whenever a redraw of the image is necessary. More... | |
Glib::Dispatcher & | colormap_updated () |
Access the signal that is emitted whenever the colormap has changed. More... | |
Static Public Attributes | |
static const unsigned int | MOUSE_BUTTON_LEFT = 1 |
constant for left mouse button id More... | |
static const unsigned int | MOUSE_BUTTON_RIGHT = 3 |
constant for right mouse button id More... | |
This widget implements the complete color training process.
Definition at line 38 of file color_train_widget.h.
ColorTrainWidget::ColorTrainWidget | ( | Gtk::Window * | parent | ) |
Constructor.
parent | the parent window |
Definition at line 52 of file color_train_widget.cpp.
|
virtual |
Destructor.
Definition at line 79 of file color_train_widget.cpp.
void ColorTrainWidget::add_to_colormap | ( | ) |
Generate a new colormap by adding the current histograms.
Definition at line 452 of file color_train_widget.cpp.
Referenced by set_add_to_colormap_btn().
void ColorTrainWidget::click | ( | unsigned int | x, |
unsigned int | y, | ||
unsigned int | button = MOUSE_BUTTON_LEFT |
||
) |
The user clicked into the image.
x | the x-coordinate |
y | the y-coordinate |
button | 1 for left click, 3 for right click |
Definition at line 140 of file color_train_widget.cpp.
References firevision::Drawer::draw_rectangle_inverted(), firevision::Drawer::set_buffer(), and firevision::ZRegion::slices.
Glib::Dispatcher & ColorTrainWidget::colormap_updated | ( | ) |
Access the signal that is emitted whenever the colormap has changed.
Definition at line 366 of file color_train_widget.cpp.
void ColorTrainWidget::draw_segmentation_result | ( | ) |
Render the result of segmenting the image in the source buffer considering the current colormap into the specified Image.
Definition at line 665 of file color_train_widget.cpp.
References firevision::Drawer::color_point(), firevision::YuvColormap::determine(), firevision::ColorObjectMap::get_color(), firevision::LossyScaler::needed_scaled_height(), firevision::LossyScaler::needed_scaled_width(), firevision::LossyScaler::scale(), firevision::Drawer::set_buffer(), firevision::Drawer::set_color(), firevision::LossyScaler::set_original_buffer(), firevision::LossyScaler::set_original_dimensions(), firevision::LossyScaler::set_scaled_buffer(), and firevision::LossyScaler::set_scaled_dimensions().
YuvColormap * ColorTrainWidget::get_colormap | ( | ) | const |
Get the current colormap.
Definition at line 627 of file color_train_widget.cpp.
void ColorTrainWidget::load_colormap | ( | ) |
Open a dialog to load a colormap.
Definition at line 531 of file color_train_widget.cpp.
References firevision::Colormap::depth(), firevision::ColormapFile::get_colormap(), firevision::Colormap::height(), firevision::FireVisionDataFile::read(), and firevision::Colormap::width().
Referenced by set_load_colormap_btn().
void ColorTrainWidget::load_histograms | ( | ) |
Open a dialog to load a histogram.
Definition at line 373 of file color_train_widget.cpp.
References firevision::YuvColormap::depth(), firevision::YuvColormap::height(), and firevision::YuvColormap::width().
Referenced by set_load_histos_btn().
void ColorTrainWidget::reset_colormap | ( | ) |
Reset the colormap.
Definition at line 508 of file color_train_widget.cpp.
Referenced by set_reset_colormap_btn().
void ColorTrainWidget::reset_selection | ( | ) |
Reset the selection.
Definition at line 186 of file color_train_widget.cpp.
Referenced by set_reset_selection_btn().
void ColorTrainWidget::save_colormap | ( | ) |
Open a dialog to save a colormap.
Definition at line 589 of file color_train_widget.cpp.
References firevision::ColormapFile::add_colormap(), firevision::YuvColormap::depth(), firevision::YuvColormap::height(), and firevision::YuvColormap::width().
Referenced by set_save_colormap_btn().
void ColorTrainWidget::save_histograms | ( | ) |
Open a dialog to save a histogram.
Definition at line 419 of file color_train_widget.cpp.
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.
btn | a Button |
Definition at line 211 of file color_train_widget.cpp.
References add_to_colormap().
void ColorTrainWidget::set_cm_layer_selector | ( | Gtk::Scale * | scl | ) |
Set the widget to choose the layer of the colormap to display.
scl | a Scale |
Definition at line 335 of file color_train_widget.cpp.
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.
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.
void ColorTrainWidget::set_colormap_img | ( | Gtk::Image * | img | ) |
Set the image to render the colormap into.
img | an Image |
Definition at line 271 of file color_train_widget.cpp.
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.
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.
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.
dlg | a FileChooserDialog |
Definition at line 326 of file color_train_widget.cpp.
void ColorTrainWidget::set_load_colormap_btn | ( | Gtk::Button * | btn | ) |
Set the buffon to open a dialog to load a colormap.
btn | a Button |
Definition at line 251 of file color_train_widget.cpp.
References load_colormap().
void ColorTrainWidget::set_load_histos_btn | ( | Gtk::Button * | btn | ) |
Set the buffon to open a dialog to load histograms.
btn | a Button |
Definition at line 231 of file color_train_widget.cpp.
References load_histograms().
void ColorTrainWidget::set_min_prob_scl | ( | Gtk::Scale * | scl | ) |
Set the scale to control the minimum probability.
scl | a Scale |
Definition at line 316 of file color_train_widget.cpp.
void ColorTrainWidget::set_reset_colormap_btn | ( | Gtk::Button * | btn | ) |
Set the button to reset the colormap.
btn | a Button |
Definition at line 221 of file color_train_widget.cpp.
References reset_colormap().
void ColorTrainWidget::set_reset_selection_btn | ( | Gtk::Button * | btn | ) |
Set the button to reset the selection.
btn | the reset selection button |
Definition at line 201 of file color_train_widget.cpp.
References reset_selection().
void ColorTrainWidget::set_save_colormap_btn | ( | Gtk::Button * | btn | ) |
Set the buffon to open a dialog to save a colormap.
btn | a Button |
Definition at line 261 of file color_train_widget.cpp.
References save_colormap().
void ColorTrainWidget::set_save_histos_btn | ( | Gtk::Button * | btn | ) |
Set the buffon to open a dialog to save histograms.
btn | a Button |
Definition at line 241 of file color_train_widget.cpp.
References save_histograms().
void ColorTrainWidget::set_segmentation_img | ( | Gtk::Image * | img | ) |
Set the image to render the segmented image into.
img | an Image |
Definition at line 280 of file color_train_widget.cpp.
void ColorTrainWidget::set_src_buffer | ( | unsigned char * | yuv422_buffer, |
unsigned int | img_width, | ||
unsigned int | img_height | ||
) |
Set the buffer containing the image data.
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.
void ColorTrainWidget::set_threshold_scl | ( | Gtk::Scale * | scl | ) |
Set the scale to control the selection threshold.
scl | a Scale |
Definition at line 306 of file color_train_widget.cpp.
Glib::Dispatcher & ColorTrainWidget::update_image | ( | ) |
Access the signal that is emitted whenever a redraw of the image is necessary.
Definition at line 357 of file color_train_widget.cpp.
|
static |
constant for left mouse button id
Definition at line 41 of file color_train_widget.h.
|
static |
constant for right mouse button id
Definition at line 42 of file color_train_widget.h.