latest version v1.9 - last update 10 Apr 2010 |
GaussianPyramid class. More...
#include <ltiGaussianPyramid.h>
Public Member Functions | |
gaussianPyramid (const int &resolutions=0, const int &gaussianSize=3, const double &variance=-1, const bool &upsampleWithGaussian=true) | |
gaussianPyramid (const gaussianPyramid &other) | |
virtual | ~gaussianPyramid () |
void | getKernelParameters (int &size, double &variance, bool &gaussian) const |
void | setKernelParameters (const int &size, const double &variance=-1, const bool &gaussian=true) |
const char * | getTypeName () const |
gaussianPyramid< T > & | copy (const gaussianPyramid< T > &other) |
virtual mathObject * | clone () const |
void | generate (const T &src) |
void | generate (const T &src, const int &theResolutions) |
void | generate (const T &src, const lti::point &limit) |
T & | reconstruct (const int &i, const int &fromJ, T &result) const |
pyramid< T > & | reconstruct (const int &i, const int &fromJ, pyramid< T > &result) const |
Protected Attributes | |
int | kernelSize |
double | kernelVariance |
bool | gaussian |
GaussianPyramid class.
This class implements the gaussian pyramids as described in Greenspan et.at. "Overcomplete Steerable Pyramid Filters and Rotation Invariance", Proc. of the IEEE Conf. on Computer Visiona and Pattern Recognition, Seattle, 1994
It allows an easy manipulation of the different resolutions.
See method generate() to an detailed explanation.
The template type T is the type of the elements in the pyramid.
Example:
channel chnl; // initialize channel or load it from an image... lti::gaussianPyramid<lti::channel> thePyramid(4); // four levels thePyramid.generate(chnl); // generate a pyramid for the given channel
lti::gaussianPyramid< T >::gaussianPyramid | ( | const int & | resolutions = 0 , |
|
const int & | gaussianSize = 3 , |
|||
const double & | variance = -1 , |
|||
const bool & | upsampleWithGaussian = true | |||
) |
create a gaussian pyramid with the given number of resolutions
resolutions | the number of resolutions that the pyramid can hold (default 0: an empty pyramid will be created) | |
upsampleWithGaussian | a gaussian kernel will be used to upsample the images. If false a squared kernel will be used. | |
gaussianSize | the size of the gaussian kernel (default 3) | |
variance | the variance of the gaussian kernel (default -1, meaning that the variance should be calculated as described in the lti::gaussKernel1D<T>) |
lti::gaussianPyramid< T >::gaussianPyramid | ( | const gaussianPyramid< T > & | other | ) |
create this gaussianPyramid as a copy of another gaussianPyramid
other | the gaussianPyramid to be copied. |
virtual lti::gaussianPyramid< T >::~gaussianPyramid | ( | ) | [virtual] |
destructor
virtual mathObject* lti::gaussianPyramid< T >::clone | ( | ) | const [virtual] |
create a clone of this gaussianPyramid
Reimplemented from lti::pyramid< T >.
Reimplemented in lti::gaborPyramid< T >.
gaussianPyramid<T>& lti::gaussianPyramid< T >::copy | ( | const gaussianPyramid< T > & | other | ) |
assigment operator.
copy the contents of other
in this object.
other | the source gaussianPyramid to be copied. |
Reimplemented from lti::pyramid< T >.
Reimplemented in lti::gaborPyramid< T >.
void lti::gaussianPyramid< T >::generate | ( | const T & | src, | |
const lti::point & | limit | |||
) |
generate the gaussian pyramid of the given object.
Proceed, until given limit.x or limit.y is reached. smallest resolution will be > limit.
The resolution "0" corresponds to the original channel, and the resolution i+1 is always a factor 2 smaller than the resolution i.
Reimplemented in lti::gaborPyramid< T >.
void lti::gaussianPyramid< T >::generate | ( | const T & | src, | |
const int & | theResolutions | |||
) |
generate the gaussian pyramid of the given object.
The pyramid will contain the number of resolutions specified by theResolutions. The resolution "0" will correspond the the original channel, and the resolution i+1 is always a factor 2 smaller than the resolution i.
Reimplemented in lti::gaborPyramid< T >.
void lti::gaussianPyramid< T >::generate | ( | const T & | src | ) |
generate the gaussian pyramid of the given object.
The pyramid will contain the number of resolutions specified in the construction or in the resize() method. The resolution "0" will correspond the the original channel, and the resolution i+1 is always a factor 2 smaller than the resolution i.
Reimplemented in lti::gaborPyramid< T >.
void lti::gaussianPyramid< T >::getKernelParameters | ( | int & | size, | |
double & | variance, | |||
bool & | gaussian | |||
) | const |
return the size and variance of the used gaussian kernel
const char* lti::gaussianPyramid< T >::getTypeName | ( | void | ) | const [inline, virtual] |
returns the name of this class: "gaussianPyramid"
Reimplemented from lti::pyramid< T >.
Reimplemented in lti::gaborPyramid< T >.
pyramid<T>& lti::gaussianPyramid< T >::reconstruct | ( | const int & | i, | |
const int & | fromJ, | |||
pyramid< T > & | result | |||
) | const |
reconstructs the resolution with index i from a second resolution j.
If i>j, the object the same pyramid will be returned, otherwise the corresponding upsampling will be done with the kernel type specified in the construction A pyramid with the same original size will be returned, where only the elements between i and fromJ will be initialized.
i | the resolution to be reconstructed | |
fromJ | the resolution from which the data is to be taken. | |
result | the resulting pyramid. |
T& lti::gaussianPyramid< T >::reconstruct | ( | const int & | i, | |
const int & | fromJ, | |||
T & | result | |||
) | const |
reconstructs the resolution with index i from a second resolution j.
If i>j, the object at(i) will be returned, otherwise the corresponding upsampling will be done with the kernel type specified in the construction
i | the resolution to be reconstructed | |
fromJ | the resolution from which the data is to be taken. | |
result | the resulting object |
void lti::gaussianPyramid< T >::setKernelParameters | ( | const int & | size, | |
const double & | variance = -1 , |
|||
const bool & | gaussian = true | |||
) |
bool lti::gaussianPyramid< T >::gaussian [protected] |
specify if the upsampling kernel is gaussian (true) or rectangular(false)
int lti::gaussianPyramid< T >::kernelSize [protected] |
kernel size
double lti::gaussianPyramid< T >::kernelVariance [protected] |
kernel variance