Fawkes API
Fawkes Development Version
|
LUT generation by using Bayesian method on histograms. More...
#include <>>
Public Member Functions | |
BayesHistosToLut (std::map< hint_t, Histogram * > &histos, unsigned int d=1, hint_t fg_object=H_UNKNOWN, unsigned int w=256, unsigned int h=256) | |
Constructor. More... | |
~BayesHistosToLut () | |
Destructor. More... | |
std::string | getName () |
Get name. More... | |
float | getObjectProb (hint_t object) |
Get object probability. More... | |
float | getAPrioriProb (unsigned int u, unsigned int v, hint_t object) |
P(u, v| object). More... | |
float | getAPrioriProb (unsigned int y, unsigned int u, unsigned int v, hint_t object) |
P(u, v| object). More... | |
float | getAPosterioriProb (hint_t object, unsigned int u, unsigned int v) |
P(object| u, v). More... | |
float | getAPosterioriProb (hint_t object, unsigned int y, unsigned int u, unsigned int v) |
P(object| u, v). More... | |
hint_t | getMostLikelyObject (unsigned int u, unsigned int v) |
Get most likely object. More... | |
hint_t | getMostLikelyObject (unsigned int y, unsigned int u, unsigned int v) |
Get most likely object. More... | |
void | setMinProbability (float min_prob) |
Set min probability. More... | |
void | setMinProbForColor (float min_prob, hint_t hint) |
Set min probability for color. More... | |
YuvColormap * | get_colormap () |
Get generated color model. More... | |
void | calculateLutValues (bool penalty=false) |
Calculate LUT values. More... | |
void | calculateLutAllColors () |
Calculate all LUT colors. More... | |
void | saveLut (char *file) |
Save LUT to file. More... | |
void | save (std::string filename) |
Save LUT to file. More... | |
LUT generation by using Bayesian method on histograms.
Generates a YUV colormap.
Definition at line 46 of file bayes_histos_to_lut.h.
firevision::BayesHistosToLut::BayesHistosToLut | ( | std::map< hint_t, Histogram * > & | histos, |
unsigned int | d = 1 , |
||
hint_t | fg_object = H_UNKNOWN , |
||
unsigned int | w = 256 , |
||
unsigned int | h = 256 |
||
) |
Constructor.
histos | histograms |
d | depth of lookup table |
fg_object | type of the foreground object |
w | the width of the lookup table (u-resolution) |
h | the height of the lookup table (v-resolution) |
Definition at line 65 of file bayes_histos_to_lut.cpp.
firevision::BayesHistosToLut::~BayesHistosToLut | ( | ) |
Destructor.
Definition at line 86 of file bayes_histos_to_lut.cpp.
void firevision::BayesHistosToLut::calculateLutAllColors | ( | ) |
Calculate all LUT colors.
Definition at line 314 of file bayes_histos_to_lut.cpp.
References firevision::YuvColormap::deepness(), firevision::YuvColormap::depth(), firevision::ColorObjectMap::get_instance(), and firevision::YuvColormap::set().
void firevision::BayesHistosToLut::calculateLutValues | ( | bool | penalty = false | ) |
Calculate LUT values.
penalty | if true, non-ball colors are penalized |
Definition at line 381 of file bayes_histos_to_lut.cpp.
References firevision::YuvColormap::deepness(), firevision::YuvColormap::depth(), firevision::Histogram::get_average(), firevision::ColorObjectMap::get_instance(), firevision::Histogram::get_median(), firevision::Histogram::get_num_undos(), firevision::Histogram::get_value(), getMostLikelyObject(), firevision::YuvColormap::height(), firevision::YuvColormap::reset(), firevision::YuvColormap::set(), firevision::Histogram::set_value(), firevision::Histogram::switch_undo(), firevision::Histogram::undo(), and firevision::YuvColormap::width().
YuvColormap * firevision::BayesHistosToLut::get_colormap | ( | ) |
Get generated color model.
Definition at line 601 of file bayes_histos_to_lut.cpp.
float firevision::BayesHistosToLut::getAPosterioriProb | ( | hint_t | object, |
unsigned int | u, | ||
unsigned int | v | ||
) |
P(object| u, v).
Get a-posteriori probability.
object | objcet |
u | YUV U-value |
v | YUV V-value |
Definition at line 200 of file bayes_histos_to_lut.cpp.
References getAPrioriProb(), and getObjectProb().
Referenced by getMostLikelyObject().
float firevision::BayesHistosToLut::getAPosterioriProb | ( | hint_t | object, |
unsigned int | y, | ||
unsigned int | u, | ||
unsigned int | v | ||
) |
P(object| u, v).
Get a-posteriori probability.
object | objcet |
y | YUV Y-value |
u | YUV U-value |
v | YUV V-value |
Definition at line 229 of file bayes_histos_to_lut.cpp.
References getAPrioriProb(), and getObjectProb().
float firevision::BayesHistosToLut::getAPrioriProb | ( | unsigned int | u, |
unsigned int | v, | ||
hint_t | object | ||
) |
P(u, v| object).
Get a-priori probability.
u | YUV U-value |
v | YUV V-value |
object | object. |
Definition at line 163 of file bayes_histos_to_lut.cpp.
Referenced by getAPosterioriProb().
float firevision::BayesHistosToLut::getAPrioriProb | ( | unsigned int | y, |
unsigned int | u, | ||
unsigned int | v, | ||
hint_t | object | ||
) |
P(u, v| object).
Get a-priori probability.
y | YUV Y-value |
u | YUV U-value |
v | YUV V-value |
object | object. |
Definition at line 184 of file bayes_histos_to_lut.cpp.
hint_t firevision::BayesHistosToLut::getMostLikelyObject | ( | unsigned int | u, |
unsigned int | v | ||
) |
Get most likely object.
u | YUV U-value |
v | YUV V-value |
Definition at line 256 of file bayes_histos_to_lut.cpp.
References getAPosterioriProb().
Referenced by calculateLutValues().
hint_t firevision::BayesHistosToLut::getMostLikelyObject | ( | unsigned int | y, |
unsigned int | u, | ||
unsigned int | v | ||
) |
Get most likely object.
y | YUV Y-value |
u | YUV U-value |
v | YUV V-value |
Definition at line 288 of file bayes_histos_to_lut.cpp.
References getAPosterioriProb().
string firevision::BayesHistosToLut::getName | ( | void | ) |
float firevision::BayesHistosToLut::getObjectProb | ( | hint_t | object | ) |
Get object probability.
object | object |
Definition at line 105 of file bayes_histos_to_lut.cpp.
Referenced by getAPosterioriProb().
void firevision::BayesHistosToLut::save | ( | std::string | filename | ) |
Save LUT to file.
filename | file name |
Definition at line 547 of file bayes_histos_to_lut.cpp.
References firevision::ColormapFile::add_colormap(), and firevision::FireVisionDataFile::write().
void firevision::BayesHistosToLut::saveLut | ( | char * | file | ) |
Save LUT to file.
file | file name |
Definition at line 536 of file bayes_histos_to_lut.cpp.
References firevision::ColormapFile::add_colormap(), and firevision::FireVisionDataFile::write().
void firevision::BayesHistosToLut::setMinProbability | ( | float | min_prob | ) |
Set min probability.
min_prob | minimum probability |
Definition at line 559 of file bayes_histos_to_lut.cpp.
void firevision::BayesHistosToLut::setMinProbForColor | ( | float | min_prob, |
hint_t | hint | ||
) |
Set min probability for color.
min_prob | minimum probability |
hint | color hint |
Definition at line 570 of file bayes_histos_to_lut.cpp.