Fawkes API Fawkes Development Version
firevision::BayesColormapGenerator Class Reference

Colormap Generator using Bayes method. More...

#include <>>

Inheritance diagram for firevision::BayesColormapGenerator:

Public Member Functions

 BayesColormapGenerator (unsigned int lut_depth=1, hint_t fg_object=H_UNKNOWN, unsigned int lut_width=256, unsigned int lut_height=256)
 Constructor. More...
 
 ~BayesColormapGenerator ()
 Destructor. More...
 
virtual void set_fg_object (hint_t object)
 Set foreground object. More...
 
virtual void set_buffer (unsigned char *buffer, unsigned int width, unsigned int height)
 Set buffer. More...
 
virtual YuvColormapget_current ()
 Get current color model. More...
 
virtual void consider ()
 Consider current image. More...
 
virtual void calc ()
 Calculate. More...
 
virtual void undo ()
 Undo last inclusion. More...
 
virtual void reset ()
 Reset color model. More...
 
virtual void reset_undo ()
 Reset undo. More...
 
virtual void set_selection (std::vector< fawkes::rectangle_t > region)
 Set selection. More...
 
virtual bool has_histograms ()
 Check if this color model uses histograms. More...
 
virtual std::map< hint_t, Histogram * > * get_histograms ()
 Get histograms. More...
 
virtual void load_histograms (const char *filename)
 Load histogram from a file. More...
 
virtual void save_histograms (const char *filename)
 Save histograms to a file. More...
 
void set_min_probability (float min_prob)
 Set min probability. More...
 
- Public Member Functions inherited from firevision::ColormapGenerator
virtual ~ColormapGenerator ()
 Virtual empty destructor. More...
 
virtual void set_buffer (unsigned char *buffer, unsigned int width, unsigned int height)=0
 Set image buffer. More...
 
virtual YuvColormapget_current ()=0
 Get the current colormap. More...
 
virtual void consider ()=0
 Considers the given buffer and extracts the needed information. More...
 
virtual void calc ()=0
 Calculate LUT. More...
 
virtual void undo ()=0
 Undo last calls to consider(). More...
 
virtual void reset ()=0
 Reset the generator. More...
 
virtual void reset_undo ()=0
 Reset undo buffer. More...
 
virtual bool has_histograms ()=0
 Check if this generator has histograms. More...
 
virtual std::map< hint_t, Histogram * > * get_histograms ()=0
 Get histograms. More...
 

Detailed Description

Colormap Generator using Bayes method.

Author
Tim Niemueller
Daniel Beck

Definition at line 37 of file bayes_generator.h.

Constructor & Destructor Documentation

◆ BayesColormapGenerator()

firevision::BayesColormapGenerator::BayesColormapGenerator ( unsigned int  lut_depth = 1,
hint_t  fg_object = H_UNKNOWN,
unsigned int  lut_width = 256,
unsigned int  lut_height = 256 
)

Constructor.

Parameters
lut_depththe depth of the lookup table
fg_objectthe type of a foreground object
lut_widththe width of the lookup table (u-resolution)
lut_heightthe height of the lookup table (v-resolution)

Definition at line 53 of file bayes_generator.cpp.

References firevision::BayesHistosToLut::get_colormap(), and set_fg_object().

◆ ~BayesColormapGenerator()

firevision::BayesColormapGenerator::~BayesColormapGenerator ( )

Destructor.

Definition at line 76 of file bayes_generator.cpp.

Member Function Documentation

◆ calc()

void firevision::BayesColormapGenerator::calc ( )
virtual

◆ consider()

void firevision::BayesColormapGenerator::consider ( )
virtual

Consider current image.

Implements firevision::ColormapGenerator.

Definition at line 192 of file bayes_generator.cpp.

Referenced by ColorTrainWidget::add_to_colormap().

◆ get_current()

YuvColormap * firevision::BayesColormapGenerator::get_current ( )
virtual

◆ get_histograms()

std::map< hint_t, Histogram * > * firevision::BayesColormapGenerator::get_histograms ( )
virtual

Get histograms.

Returns
histograms

Implements firevision::ColormapGenerator.

Definition at line 310 of file bayes_generator.cpp.

◆ has_histograms()

bool firevision::BayesColormapGenerator::has_histograms ( )
virtual

Check if this color model uses histograms.

Returns
true

Implements firevision::ColormapGenerator.

Definition at line 301 of file bayes_generator.cpp.

◆ load_histograms()

void firevision::BayesColormapGenerator::load_histograms ( const char *  filename)
virtual

◆ reset()

void firevision::BayesColormapGenerator::reset ( void  )
virtual

Reset color model.

Implements firevision::ColormapGenerator.

Definition at line 259 of file bayes_generator.cpp.

References firevision::YuvColormap::reset().

Referenced by ColorTrainWidget::reset_colormap().

◆ reset_undo()

void firevision::BayesColormapGenerator::reset_undo ( )
virtual

Reset undo.

Implements firevision::ColormapGenerator.

Definition at line 282 of file bayes_generator.cpp.

Referenced by ColorTrainWidget::add_to_colormap().

◆ save_histograms()

void firevision::BayesColormapGenerator::save_histograms ( const char *  filename)
virtual

◆ set_buffer()

void firevision::BayesColormapGenerator::set_buffer ( unsigned char *  buffer,
unsigned int  width,
unsigned int  height 
)
virtual

Set buffer.

Parameters
bufferimage buffer
widthimage width
heightimage height

Implements firevision::ColormapGenerator.

Definition at line 118 of file bayes_generator.cpp.

Referenced by ColorTrainWidget::add_to_colormap().

◆ set_fg_object()

void firevision::BayesColormapGenerator::set_fg_object ( hint_t  object)
virtual

Set foreground object.

Parameters
objectthe new foreground object

Definition at line 97 of file bayes_generator.cpp.

Referenced by ColorTrainWidget::add_to_colormap(), and BayesColormapGenerator().

◆ set_min_probability()

void firevision::BayesColormapGenerator::set_min_probability ( float  min_prob)

Set min probability.

Parameters
min_probmin probability.
See also
BayesHistosToLut::setMinProbability()

Definition at line 185 of file bayes_generator.cpp.

References firevision::BayesHistosToLut::setMinProbability().

◆ set_selection()

void firevision::BayesColormapGenerator::set_selection ( std::vector< fawkes::rectangle_t region)
virtual

Set selection.

Parameters
regionselected region.

Definition at line 157 of file bayes_generator.cpp.

Referenced by ColorTrainWidget::add_to_colormap().

◆ undo()

void firevision::BayesColormapGenerator::undo ( )
virtual

Undo last inclusion.

Implements firevision::ColormapGenerator.

Definition at line 242 of file bayes_generator.cpp.


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