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

lti::gaussianPyramid< T > Class Template Reference

GaussianPyramid class. More...

#include <ltiGaussianPyramid.h>

Inheritance diagram for lti::gaussianPyramid< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::gaussianPyramid< T >:
Collaboration graph
[legend]

List of all members.

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 mathObjectclone () 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

Detailed Description

template<class T>
class lti::gaussianPyramid< T >

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

Constructor & Destructor Documentation

template<class T>
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

Parameters:
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>)
template<class T>
lti::gaussianPyramid< T >::gaussianPyramid ( const gaussianPyramid< T > &  other  ) 

create this gaussianPyramid as a copy of another gaussianPyramid

Parameters:
other the gaussianPyramid to be copied.
template<class T>
virtual lti::gaussianPyramid< T >::~gaussianPyramid (  )  [virtual]

destructor


Member Function Documentation

template<class T>
virtual mathObject* lti::gaussianPyramid< T >::clone (  )  const [virtual]

create a clone of this gaussianPyramid

Returns:
a pointer to a copy of this gaussianPyramid

Reimplemented from lti::pyramid< T >.

Reimplemented in lti::gaborPyramid< T >.

template<class T>
gaussianPyramid<T>& lti::gaussianPyramid< T >::copy ( const gaussianPyramid< T > &  other  ) 

assigment operator.

copy the contents of other in this object.

Parameters:
other the source gaussianPyramid to be copied.
Returns:
a reference to this object

Reimplemented from lti::pyramid< T >.

Reimplemented in lti::gaborPyramid< T >.

template<class 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 >.

template<class 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 >.

template<class 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 >.

template<class T>
void lti::gaussianPyramid< T >::getKernelParameters ( int &  size,
double &  variance,
bool &  gaussian 
) const

return the size and variance of the used gaussian kernel

template<class T>
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 >.

template<class 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.

Parameters:
i the resolution to be reconstructed
fromJ the resolution from which the data is to be taken.
result the resulting pyramid.
Returns:
a reference to the result pyramid
template<class T>
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

Parameters:
i the resolution to be reconstructed
fromJ the resolution from which the data is to be taken.
result the resulting object
Returns:
a reference to the result object.
template<class T>
void lti::gaussianPyramid< T >::setKernelParameters ( const int &  size,
const double &  variance = -1,
const bool &  gaussian = true 
)

set the kernel parameters

Parameters:
size the size of the kernel
variance the variance for the gaussian kernel. A negative value will force the default variance of a gaussian kernel with size size.
gaussian specify if for the channel upsampling a gaussian or a rectangular kernel should be used.

Member Data Documentation

template<class T>
bool lti::gaussianPyramid< T >::gaussian [protected]

specify if the upsampling kernel is gaussian (true) or rectangular(false)

template<class T>
int lti::gaussianPyramid< T >::kernelSize [protected]

kernel size

template<class T>
double lti::gaussianPyramid< T >::kernelVariance [protected]

kernel variance


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

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