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

lti::probabilityMap Class Reference

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

#include <ltiProbabilityMap.h>

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

List of all members.

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
probabilityMapcopy (const probabilityMap &other)
probabilityMapoperator= (const probabilityMap &other)
virtual functorclone () const
const parametersgetParameters () const
virtual bool read (ioHandler &handler, const bool complete=true)

Protected Member Functions

void computeMap (const image &img, channel &aPrioriDest) const

Detailed Description

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:

\[ 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.

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.


Constructor & Destructor Documentation

lti::probabilityMap::probabilityMap (  ) 

default constructor

lti::probabilityMap::probabilityMap ( const parameters theParams  ) 

constructor

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

copy constructor

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

destructor


Member Function Documentation

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 is thread safe, but much slower than the other one.

Parameters:
src rgbPixel with the source color.
Returns:
the object probability
virtual float lti::probabilityMap::apply ( const rgbPixel src,
ivector theBin 
) 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.

Parameters:
src rgbPixel with the source color.
theBin index vector computed by the method to the histogram entry.
Returns:
the object probability
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).

Parameters:
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.
Returns:
true is successful, false otherwise
virtual bool lti::probabilityMap::apply ( const image src,
channel dest 
) const [virtual]

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

Parameters:
src image with the source data.
dest channel where the result will be left.
Returns:
true is successful, false otherwise
virtual functor* lti::probabilityMap::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements lti::probabilityMapBase.

Reimplemented in lti::skinProbabilityMap.

void lti::probabilityMap::computeMap ( const image img,
channel aPrioriDest 
) const [protected]

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.

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

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.

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

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.

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:41 2010 for LTI-Lib by Doxygen 1.6.1