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

lti::kullbackContrast Class Reference

Calculate the Kullback-Constrast for a channel, as described in: Jagersand, Martin. More...

#include <ltiKullbackContrast.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class kullbackContrast More...

Public Member Functions

 kullbackContrast ()
 kullbackContrast (const kullbackContrast &other)
virtual ~kullbackContrast ()
virtual const char * getTypeName () const
vector< float > & apply (const channel &src, vector< float > &dest) const
vector< float > & apply (const channel &src, vector< float > &dest, gaussianPyramid< channel > &pyr, gaussianPyramid< channel > &pyr2) const
float & apply (const channel &q, const channel &p, float &dest) const
float & apply (const vector< float > &q, const vector< float > &p, float &dest) const
kullbackContrastcopy (const kullbackContrast &other)
virtual functorclone () const
const parametersgetParameters () const

Protected Member Functions

void makeHistogram (const channel &src, vector< double > &hist) const

Detailed Description

Calculate the Kullback-Constrast for a channel, as described in: Jagersand, Martin.

Saliency Maps and Attention Selection in Scale and Spatial Coordinates: An Information Theoretic Approach, 5th Int. Conf. on Computer Vision, 1995, pp. 195-202

The given channel will be analized at different resolutions (given through the parameters). The output vector contains the constrast for each size, where the evaluated size corresponds to 2^(vector index).

Note that if one of the distributions contains a zero (p(x_i) = 0) and q(x_i) != 0, the Kullback constrast will be infinite!

With the parameter useHistogram an approximation for the probability distribution of the intensity of a channel will be done in form of a histogram. Please note that this will option is ignored when comparing vectors.


Constructor & Destructor Documentation

lti::kullbackContrast::kullbackContrast (  ) 

default constructor

lti::kullbackContrast::kullbackContrast ( const kullbackContrast other  ) 

copy constructor

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

destructor


Member Function Documentation

float& lti::kullbackContrast::apply ( const vector< float > &  q,
const vector< float > &  p,
float &  dest 
) const

calculates the Kullback contrast between q and p, defined as

\[ K[Q,P] = \int_x p(x) \log \frac{p(x)}{q(x)} dx \]

operates on a copy of the given parameters.

Parameters:
q vector with the source data q(x).
p vector with the source data p(x).
dest vector<float> where the result will be left.
Returns:
a reference to the dest.
float& lti::kullbackContrast::apply ( const channel q,
const channel p,
float &  dest 
) const

calculates the Kullback contrast between q and p, defined as

\[ K[Q,P] = \int_x p(x) \log \frac{p(x)}{q(x)} dx \]

operates on a copy of the given parameters. The input channels do not need to be "normalized". This will be done here, in an efficient way.

Parameters:
q channel with the source data q(x).
p channel with the source data p(x).
dest channel where the result will be left.
Returns:
a reference to the dest.
vector<float>& lti::kullbackContrast::apply ( const channel src,
vector< float > &  dest,
gaussianPyramid< channel > &  pyr,
gaussianPyramid< channel > &  pyr2 
) const

The Kullback contrast of the channel src will be calculated as the Kullback contrast between two adjacent resolutions of the gaussian pyramid for that channel, where the pixel value normalized with the sum of all pixels will be considered as a probability p(x,y).

(for more details see the paper: Jagersand, Martin. "Saliency Maps and Attention Selection in Scale and Spatial Coordinates: An Information Theoretic Approach", 5th Int. Conf. on Computer Vision, 1995, pp. 195-202 operates on a copy of the given parameters.

Parameters:
src channel with the source data.
dest channel where the result will be left. The i-th entry in the vector will contain the Kullback contrast for objects with a diameter of 2^i pixels.
pyr the gaussian pyramid of the given channel
pyr2 the upsampled gaussian pyramid (pyr2.size() == pyr.size()-1)
Returns:
a reference to the dest.
vector<float>& lti::kullbackContrast::apply ( const channel src,
vector< float > &  dest 
) const

The Kullback contrast of the channel src will be calculated as the Kullback contrast between two adjacent resolutions of the gaussian pyramid for that channel, where the pixel value normalized with the sum of all pixels will be considered as a probability p(x,y).

(for more details see the paper: Jagersand, Martin. "Saliency Maps and Attention Selection in Scale and Spatial Coordinates: An Information Theoretic Approach", 5th Int. Conf. on Computer Vision, 1995, pp. 195-202 operates on a copy of the given parameters.

Parameters:
src channel with the source data.
dest channel where the result will be left. The i-th entry in the vector will contain the Kullback contrast for objects with a diameter of 2^i pixels.
Returns:
a reference to the dest.
virtual functor* lti::kullbackContrast::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::statisticsFunctor.

kullbackContrast& lti::kullbackContrast::copy ( const kullbackContrast other  ) 

copy data of "other" functor.

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

Reimplemented from lti::statisticsFunctor.

const parameters& lti::kullbackContrast::getParameters (  )  const

returns used parameters

Reimplemented from lti::statisticsFunctor.

virtual const char* lti::kullbackContrast::getTypeName (  )  const [virtual]

returns the name of this type ("kullbackContrast")

Reimplemented from lti::statisticsFunctor.

void lti::kullbackContrast::makeHistogram ( const channel src,
vector< double > &  hist 
) const [protected]

make an histogram of the src channel in hist.

The number of bin is the number of elements in hist.


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

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