latest version v1.9 - last update 10 Apr 2010 |
Probability Map based on 2D non-parametric (color) models. More...
#include <ltiProbabilityMap2D.h>
Classes | |
class | parameters |
the parameters for the class probabilityMap2D More... | |
Public Member Functions | |
probabilityMap2D () | |
probabilityMap2D (const parameters &theParams) | |
probabilityMap2D (const probabilityMap2D &other) | |
virtual | ~probabilityMap2D () |
virtual const char * | getTypeName () const |
virtual bool | apply (const channel8 &src1, const channel8 &src2, channel &dest) const |
virtual float | apply (const ubyte &value1, const ubyte &value2, ivector &theBin) const |
virtual float | apply (const ubyte &value1, const ubyte &value2) const |
probabilityMap2D & | copy (const probabilityMap2D &other) |
probabilityMap2D & | operator= (const probabilityMap2D &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
virtual bool | read (ioHandler &handler, const bool complete=true) |
bool | computeMap (const channel8 &src1, const channel8 &src2, channel &aPrioriDest) const |
Probability Map based on 2D non-parametric (color) models.
Creates a probability map given two chromacity 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.
lti::probabilityMap2D::probabilityMap2D | ( | ) |
default constructor
lti::probabilityMap2D::probabilityMap2D | ( | const parameters & | theParams | ) |
constructor
theParams | the parameters to be used |
lti::probabilityMap2D::probabilityMap2D | ( | const probabilityMap2D & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::probabilityMap2D::~probabilityMap2D | ( | ) | [virtual] |
destructor
virtual float lti::probabilityMap2D::apply | ( | const ubyte & | value1, | |
const ubyte & | value2, | |||
ivector & | theBin | |||
) | const [virtual] |
returns the object probability for a chromacity 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 2, or the method will crash.
The idea is to externally provide an ivector in order to spare some creation time.
value1 | pixel' value int the first chromacity band. | |
value2 | pixel' value int the second chromacity band. | |
theBin | index vector computed by the method to the histogram entry. |
virtual functor* lti::probabilityMap2D::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::probabilityMapBase.
bool lti::probabilityMap2D::computeMap | ( | const channel8 & | src1, | |
const channel8 & | src2, | |||
channel & | aPrioriDest | |||
) | const |
compute the second and up iterations of a probability map using the given aPriori probabilites per pixel.
probabilityMap2D& lti::probabilityMap2D::copy | ( | const probabilityMap2D & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::probabilityMapBase.
const parameters& lti::probabilityMap2D::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::probabilityMapBase.
virtual const char* lti::probabilityMap2D::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("probabilityMap2D")
Reimplemented from lti::probabilityMapBase.
probabilityMap2D& lti::probabilityMap2D::operator= | ( | const probabilityMap2D & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::probabilityMapBase.
virtual bool lti::probabilityMap2D::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.