LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::probabilityMap2D Class Reference

Probability Map based on 2D non-parametric (color) models. More...

#include <ltiProbabilityMap2D.h>

Inheritance diagram for lti::probabilityMap2D:
Inheritance graph
[legend]
Collaboration diagram for lti::probabilityMap2D:
Collaboration graph
[legend]

List of all members.

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
probabilityMap2Dcopy (const probabilityMap2D &other)
probabilityMap2Doperator= (const probabilityMap2D &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool read (ioHandler &handler, const bool complete=true)
bool computeMap (const channel8 &src1, const channel8 &src2, channel &aPrioriDest) const

Detailed Description

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:

\[ p(obj|rgb) = \frac{p(rgb|obj) \cdot p(obj)} {(p(rgb|obj) \cdot p(obj) + p(rgb|nonobj) \cdot p(nonobj))} \]

where p(obj) is the overall objectProbability, p(nonobj) := 1 - p(obj).

$p(rgb|obj)$ and $p(rgb|nonobj)$ are read from the given object and non-object models.


Constructor & Destructor Documentation

lti::probabilityMap2D::probabilityMap2D (  ) 

default constructor

lti::probabilityMap2D::probabilityMap2D ( const parameters theParams  ) 

constructor

Parameters:
theParams the parameters to be used
lti::probabilityMap2D::probabilityMap2D ( const probabilityMap2D other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::probabilityMap2D::~probabilityMap2D (  )  [virtual]

destructor


Member Function Documentation

virtual float lti::probabilityMap2D::apply ( const ubyte value1,
const ubyte value2 
) const [virtual]

returns the object probability for a chromacity value (values range from 0.0 to 1.0).

This method is thread safe, but much slower than the other one.

Parameters:
value1 pixel' value int the first chromacity band.
value2 pixel' value int the second chromacity band.
Returns:
the object probability
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.

Parameters:
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.
Returns:
the object probability
virtual bool lti::probabilityMap2D::apply ( const channel8 src1,
const channel8 src2,
channel dest 
) const [virtual]

creates a object probability channel of an image (values range from 0.0 to 1.0).

Parameters:
src1 channel with the first chromacity band.
src2 channel with the second chromacity band.
dest channel where the result will be left.
Returns:
true is successful, false otherwise
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.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

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.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

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.

Parameters:
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.
Returns:
true if write was successful

Implements lti::probabilityMapBase.


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

Generated on Sat Apr 10 15:27:42 2010 for LTI-Lib by Doxygen 1.6.1