24 #ifndef __FIREVISION_MODELS_COLOR_BAYES_BAYES_GENERATOR_ 25 #define __FIREVISION_MODELS_COLOR_BAYES_BAYES_GENERATOR_ 27 #include <fvutils/colormap/generator.h> 38 class BayesHistosToLut;
45 hint_t fg_object = H_UNKNOWN,
46 unsigned int lut_width = 256,
unsigned int lut_height = 256);
51 unsigned int width,
unsigned int height);
59 virtual void set_selection(std::vector< fawkes::rectangle_t > region);
70 bool is_in_region(
unsigned int x,
unsigned int y);
71 void normalize_histos();
73 typedef std::map< hint_t, Histogram * > HistogramMap;
74 HistogramMap fg_histos;
75 HistogramMap bg_histos;
77 HistogramMap::iterator histo_it;
84 unsigned int lut_width;
85 unsigned int lut_height;
86 unsigned int lut_depth;
88 unsigned int image_width;
89 unsigned int image_height;
91 unsigned int norm_size;
93 unsigned char *buffer;
94 std::vector< fawkes::rectangle_t > region;
95 std::vector< fawkes::rectangle_t >::iterator rit;
LUT generation by using Bayesian method on histograms.
virtual void set_selection(std::vector< fawkes::rectangle_t > region)
Set selection.
~BayesColormapGenerator()
Destructor.
virtual void undo()
Undo last inclusion.
void set_min_probability(float min_prob)
Set min probability.
virtual std::map< hint_t, Histogram *> * get_histograms()
Get histograms.
virtual YuvColormap * get_current()
Get current color model.
virtual void save_histograms(const char *filename)
Save histograms to a file.
virtual void reset_undo()
Reset undo.
virtual void calc()
Calculate.
virtual void reset()
Reset color model.
BayesColormapGenerator(unsigned int lut_depth=1, hint_t fg_object=H_UNKNOWN, unsigned int lut_width=256, unsigned int lut_height=256)
Constructor.
Interface for colormap generators.
Colormap Generator using Bayes method.
virtual void set_buffer(unsigned char *buffer, unsigned int width, unsigned int height)
Set buffer.
virtual void set_fg_object(hint_t object)
Set foreground object.
virtual void load_histograms(const char *filename)
Load histogram from a file.
virtual bool has_histograms()
Check if this color model uses histograms.
virtual void consider()
Consider current image.