latest version v1.9 - last update 10 Apr 2010 |
Calculate the Kullback-Constrast for a channel, as described in: Jagersand, Martin. More...
#include <ltiKullbackContrast.h>
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 |
kullbackContrast & | copy (const kullbackContrast &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Protected Member Functions | |
void | makeHistogram (const channel &src, vector< double > &hist) const |
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.
lti::kullbackContrast::kullbackContrast | ( | ) |
default constructor
lti::kullbackContrast::kullbackContrast | ( | const kullbackContrast & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::kullbackContrast::~kullbackContrast | ( | ) | [virtual] |
destructor
calculates the Kullback contrast between q and p, defined as
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.
q | channel with the source data q(x). | |
p | channel with the source data p(x). | |
dest | channel where the result will be left. |
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.
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) |
dest
. 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.
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. |
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.
other | the functor to be copied |
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.