latest version v1.9 - last update 10 Apr 2010 |
Probability Map based on 3D non-parametric (color) models. More...
#include <ltiProbabilityMap.h>
Classes | |
class | parameters |
The parameters for the class probabilityMap. More... | |
Public Member Functions | |
probabilityMap () | |
probabilityMap (const parameters &theParams) | |
probabilityMap (const probabilityMap &other) | |
virtual | ~probabilityMap () |
virtual const char * | getTypeName () const |
virtual bool | apply (const image &src, channel &dest) const |
virtual bool | apply (const image &src, channel &dest, const channel &apriori) const |
virtual float | apply (const rgbPixel &src, ivector &theBin) const |
virtual float | apply (const rgbPixel &src) const |
probabilityMap & | copy (const probabilityMap &other) |
probabilityMap & | operator= (const probabilityMap &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
virtual bool | read (ioHandler &handler, const bool complete=true) |
Protected Member Functions | |
void | computeMap (const image &img, channel &aPrioriDest) const |
Probability Map based on 3D non-parametric (color) models.
Creates a probability map given two color histogram, one modelling the object color and the other modeling the non-object colors.
The probability of a specified color rgb is calculated according to the Bayes formula:
where p(obj) is the overall objectProbability, p(nonobj) := 1 - p(obj).
and are read from the given object and non-object models.
In case you provide only the object probability histogram, the non-object histogram will be assumed to be uniform distributed, i.e. all colors can be non-object with the same probability.
lti::probabilityMap::probabilityMap | ( | ) |
default constructor
lti::probabilityMap::probabilityMap | ( | const parameters & | theParams | ) |
constructor
theParams | the parameters to be used |
lti::probabilityMap::probabilityMap | ( | const probabilityMap & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::probabilityMap::~probabilityMap | ( | ) | [virtual] |
destructor
virtual float lti::probabilityMap::apply | ( | const rgbPixel & | src | ) | const [virtual] |
Returns the object probability for an rgb color value (values range from 0.0 to 1.0).
This method uses the given vector to compute the index of the histogram. It MUST be preinitialized with a size of 3, or the method will crash.
The idea is to externally provide an ivector in order to spare some creation time.
src | rgbPixel with the source color. | |
theBin | index vector computed by the method to the histogram entry. |
virtual bool lti::probabilityMap::apply | ( | const image & | src, | |
channel & | dest, | |||
const channel & | apriori | |||
) | const [virtual] |
creates an object probability channel of an image (values range from 0.0 to 1.0).
src | image with the source data. | |
dest | channel where the result will be left. | |
apriori | By using this parameter it is possible to include a given position-dependent apriori object probability channel in the computation of the object probability channel. A value of 0.5 at a point indicates equal probabilities for object and non-object values. Any bigger value (< 1.0) indicates a higher probability for object values, any smaller value (> 0) indicates a lower probability. The apriori-channel should have the same size as the input image. |
virtual functor* lti::probabilityMap::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Implements lti::probabilityMapBase.
Reimplemented in lti::skinProbabilityMap.
Compute the second and up iterations of a probability map using the given apriori probabilites per pixel.
probabilityMap& lti::probabilityMap::copy | ( | const probabilityMap & | other | ) |
Copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::probabilityMapBase.
Reimplemented in lti::skinProbabilityMap.
const parameters& lti::probabilityMap::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::probabilityMapBase.
Reimplemented in lti::skinProbabilityMap.
virtual const char* lti::probabilityMap::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("probabilityMap")
Reimplemented from lti::probabilityMapBase.
Reimplemented in lti::skinProbabilityMap.
probabilityMap& lti::probabilityMap::operator= | ( | const probabilityMap & | other | ) |
Copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::probabilityMapBase.
virtual bool lti::probabilityMap::read | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | [virtual] |
Read the functor from the given ioHandler.
The default implementation is to read just the parameters object.
Since this virtual method needs to know the exact type of the parameters to call the proper read method, it will just assume that the current functor instance has a valid parameter set. If this is not the case, you need to reimplement the read method to set first a dummy parameter object.
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Implements lti::probabilityMapBase.