latest version v1.9 - last update 10 Apr 2010 |
This class computes a map between the chrominances and the most likely object based on chrominance histograms and the Bayes Theorem. More...
#include <ltiChrominanceMapEstimator.h>
This class computes a map between the chrominances and the most likely object based on chrominance histograms and the Bayes Theorem.
For details about building the colors models take a look at the description of chrominanceModelEstimator.
lti::chrominanceMapEstimator::chrominanceMapEstimator | ( | ) |
default constructor
lti::chrominanceMapEstimator::chrominanceMapEstimator | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::chrominanceMapEstimator::chrominanceMapEstimator | ( | const chrominanceMapEstimator & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::chrominanceMapEstimator::~chrominanceMapEstimator | ( | ) | [virtual] |
destructor
bool lti::chrominanceMapEstimator::apply | ( | ubyte | u, | |
ubyte | v, | |||
int & | label, | |||
float & | prob | |||
) | const [inline] |
For a given chrominance get the object label which is most likely and its probability.
For more sophisticated segmentation
u | refers to the columns of the chrominance map. | |
v | refers to the rows of the chrominance map. | |
label | the most likely object label. | |
prob | the probability of the most likely object. |
References lti::genericMatrix< T >::at(), m_colorMap, and m_probabilityMap.
For a given chrominance get the object label which is most likely.
For more sophisticated segmentation
u | refers to the columns of the chrominance map. | |
v | refers to the rows of the chrominance map. | |
label | the most likely object label. |
References lti::genericMatrix< T >::at(), and m_colorMap.
virtual functor* lti::chrominanceMapEstimator::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Reimplemented from lti::chrominanceModelEstimator.
chrominanceMapEstimator& lti::chrominanceMapEstimator::copy | ( | const chrominanceMapEstimator & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::chrominanceModelEstimator.
const channel8& lti::chrominanceMapEstimator::getChrominanceMap | ( | ) | const |
Returns the chrominance map.
const parameters& lti::chrominanceMapEstimator::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::chrominanceModelEstimator.
const channel& lti::chrominanceMapEstimator::getProbabilityMap | ( | ) | const |
Returns the probabilities of the most likely object.
virtual const char* lti::chrominanceMapEstimator::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("chrominanceModelEstimator")
Reimplemented from lti::chrominanceModelEstimator.
parameters& lti::chrominanceMapEstimator::getWritableParameters | ( | ) | [protected] |
Returns used parameters.
Reimplemented from lti::chrominanceModelEstimator.
void lti::chrominanceMapEstimator::initUpdate | ( | std::vector< histogram2D::const_iterator > & | histIts, | |
dvector & | objNumEntries | |||
) | const [protected] |
Initializes stuff needed by the update methods.
histIts | iterator pointing at the chrominance model | |
objNumEntries | the number of entries in each histogram. |
chrominanceMapEstimator& lti::chrominanceMapEstimator::operator= | ( | const chrominanceMapEstimator & | other | ) |
alias for copy member
other | the functor to be copied |
Reimplemented from lti::chrominanceModelEstimator.
bool lti::chrominanceMapEstimator::setParameters | ( | const parameters & | theParams | ) | [virtual] |
set the parameters and ensure validity
Reimplemented from lti::chrominanceModelEstimator.
bool lti::chrominanceMapEstimator::update | ( | ) |
Recompute the chrominance map and probabilities from the chrominance models.
This method checks the parameters to determine if the entire map is processed or only those parts that are covered by an object as specified by the maximal chrominance sets.
bool lti::chrominanceMapEstimator::updateAll | ( | ) |
Recompute the chrominance map and probabilities from the chrominance models.
This method processes the entire map. specified by the maximal chrominance sets.
bool lti::chrominanceMapEstimator::updateExclude | ( | ) |
Recompute the chrominance map and probabilities from the chrominance models.
This method processes only those parts that are covered by an object. specified by the maximal chrominance sets.
bool lti::chrominanceMapEstimator::writeChrominanceMap | ( | const std::string & | prefix, | |
const vector< rgbPixel > & | colors | |||
) | const |
Writes the chrominance map and probabilities to disk.
prefix | a string containing the path or prefix to the files. If you specify a directory, please do not forget the /. It is not added automatically. | |
colors | color each object as specified by this vector. |
channel8 lti::chrominanceMapEstimator::m_colorMap [protected] |
the color map
Referenced by apply().
bool lti::chrominanceMapEstimator::m_constructMap [protected] |
Special care when error in setParameters during construction.
Historic and complicated code, but it works.