Fawkes API  Fawkes Development Version
firevision::BayesHistosToLut Class Reference

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...
 
YuvColormapget_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...
 

Detailed Description

LUT generation by using Bayesian method on histograms.

Generates a YUV colormap.

Author
Martin Herakles.
Tim Niemueller
Daniel Beck

Definition at line 46 of file bayes_histos_to_lut.h.

Constructor & Destructor Documentation

◆ BayesHistosToLut()

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.

Parameters
histoshistograms
ddepth of lookup table
fg_objecttype of the foreground object
wthe width of the lookup table (u-resolution)
hthe height of the lookup table (v-resolution)

Definition at line 65 of file bayes_histos_to_lut.cpp.

◆ ~BayesHistosToLut()

firevision::BayesHistosToLut::~BayesHistosToLut ( )

Destructor.

Definition at line 86 of file bayes_histos_to_lut.cpp.

Member Function Documentation

◆ calculateLutAllColors()

void firevision::BayesHistosToLut::calculateLutAllColors ( )

◆ calculateLutValues()

◆ get_colormap()

YuvColormap * firevision::BayesHistosToLut::get_colormap ( )

Get generated color model.

Returns
generated color model

Definition at line 601 of file bayes_histos_to_lut.cpp.

◆ getAPosterioriProb() [1/2]

float firevision::BayesHistosToLut::getAPosterioriProb ( hint_t  object,
unsigned int  u,
unsigned int  v 
)

P(object| u, v).

Get a-posteriori probability.

Parameters
objectobjcet
uYUV U-value
vYUV V-value
Returns
a posteriori probability

Definition at line 200 of file bayes_histos_to_lut.cpp.

References getAPrioriProb(), and getObjectProb().

Referenced by getMostLikelyObject().

◆ getAPosterioriProb() [2/2]

float firevision::BayesHistosToLut::getAPosterioriProb ( hint_t  object,
unsigned int  y,
unsigned int  u,
unsigned int  v 
)

P(object| u, v).

Get a-posteriori probability.

Parameters
objectobjcet
yYUV Y-value
uYUV U-value
vYUV V-value
Returns
a posteriori probability

Definition at line 229 of file bayes_histos_to_lut.cpp.

References getAPrioriProb(), and getObjectProb().

◆ getAPrioriProb() [1/2]

float firevision::BayesHistosToLut::getAPrioriProb ( unsigned int  u,
unsigned int  v,
hint_t  object 
)

P(u, v| object).

Get a-priori probability.

Parameters
uYUV U-value
vYUV V-value
objectobject.
Returns
probability

Definition at line 163 of file bayes_histos_to_lut.cpp.

Referenced by getAPosterioriProb().

◆ getAPrioriProb() [2/2]

float firevision::BayesHistosToLut::getAPrioriProb ( unsigned int  y,
unsigned int  u,
unsigned int  v,
hint_t  object 
)

P(u, v| object).

Get a-priori probability.

Parameters
yYUV Y-value
uYUV U-value
vYUV V-value
objectobject.
Returns
probability

Definition at line 184 of file bayes_histos_to_lut.cpp.

◆ getMostLikelyObject() [1/2]

hint_t firevision::BayesHistosToLut::getMostLikelyObject ( unsigned int  u,
unsigned int  v 
)

Get most likely object.

Parameters
uYUV U-value
vYUV V-value
Returns
most likely object for this color

Definition at line 256 of file bayes_histos_to_lut.cpp.

References getAPosterioriProb().

Referenced by calculateLutValues().

◆ getMostLikelyObject() [2/2]

hint_t firevision::BayesHistosToLut::getMostLikelyObject ( unsigned int  y,
unsigned int  u,
unsigned int  v 
)

Get most likely object.

Parameters
yYUV Y-value
uYUV U-value
vYUV V-value
Returns
most likely object for this color

Definition at line 288 of file bayes_histos_to_lut.cpp.

References getAPosterioriProb().

◆ getName()

string firevision::BayesHistosToLut::getName ( void  )

Get name.

Returns
BayesHistosToLut

Definition at line 95 of file bayes_histos_to_lut.cpp.

◆ getObjectProb()

float firevision::BayesHistosToLut::getObjectProb ( hint_t  object)

Get object probability.

Parameters
objectobject
Returns
probability.

Definition at line 105 of file bayes_histos_to_lut.cpp.

Referenced by getAPosterioriProb().

◆ save()

void firevision::BayesHistosToLut::save ( std::string  filename)

Save LUT to file.

Parameters
filenamefile name

Definition at line 547 of file bayes_histos_to_lut.cpp.

References firevision::ColormapFile::add_colormap(), and firevision::FireVisionDataFile::write().

◆ saveLut()

void firevision::BayesHistosToLut::saveLut ( char *  file)

Save LUT to file.

Parameters
filefile name

Definition at line 536 of file bayes_histos_to_lut.cpp.

References firevision::ColormapFile::add_colormap(), and firevision::FireVisionDataFile::write().

◆ setMinProbability()

void firevision::BayesHistosToLut::setMinProbability ( float  min_prob)

Set min probability.

Parameters
min_probminimum probability

Definition at line 559 of file bayes_histos_to_lut.cpp.

◆ setMinProbForColor()

void firevision::BayesHistosToLut::setMinProbForColor ( float  min_prob,
hint_t  hint 
)

Set min probability for color.

Parameters
min_probminimum probability
hintcolor hint

Definition at line 570 of file bayes_histos_to_lut.cpp.


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