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