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

lti::gaussKernel1D< T > Class Template Reference

one-dimensional filter kernel More...

#include <ltiGaussKernels.h>

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

List of all members.

Public Member Functions

 gaussKernel1D (const int &size=3, const double &variance=-1.0)
void generate (const int &size, const double &theVariance=-1.0)
const double & getActualVariance () const

Detailed Description

template<class T>
class lti::gaussKernel1D< T >

one-dimensional filter kernel

This class will create a one-dimensional gaussian filter kernel.

The area under the filter will be normalized to one.

The one dimesional kernel is calculated with following equation:

$ g(x) = \frac{1}{\sigma \sqrt{2\pi}} \exp{-\frac{x^2}{2\sigma^2}}$

Example:

  // the vector to be filtered:
  lti::vector<channel::value_type> data;

  // ... initialize vector here ...

  // gaussian filter kernel with 3 elements, and a variance of 0.72
  lti::gaussKernel1D<channel::value_type> kernel(3,0.72);

  lti::convolution filter;                        // convolution operator
  lti::convolution::parameters param;             // parameters
  param.setKernel(kernel);                        // use the gauss kernel
  filter.setParameters(param);                    // set parameters

  // filter the vector and leave the result there too

  filter.apply(data);

Constructor & Destructor Documentation

template<class T>
lti::gaussKernel1D< T >::gaussKernel1D ( const int &  size = 3,
const double &  variance = -1.0 
)

constructor

Parameters:
size size of the kernel in one dimension
variance variance of the kernel. If this argument is ommited or a negative value is given, the variance will be calculated such that the value at the index floor(size/2) is 1/(1+floor(size/2)) times the value at index 0. For example, for size==3, the value at 1 will be 1/2 the value at 0. Hence a 3 taps kernel will contain the elements (1/4,1/2,1/4).

Member Function Documentation

template<class T>
void lti::gaussKernel1D< T >::generate ( const int &  size,
const double &  theVariance = -1.0 
)

initialize this kernel with the specified values

Parameters:
size size of the kernel in one dimension
theVariance variance of the kernel. If this argument is ommited or a negative value is given, the variance will be calculated such that the value at the index floor(size/2) is 1/(1+floor(size/2)) times the value at index 0. For example, for size==3, the value at 1 will be 1/2 the value at 0. Hence a 3 taps kernel will contain the elements (1/4,1/2,1/4).
template<class T>
const double& lti::gaussKernel1D< T >::getActualVariance (  )  const

Returns the actual variance used for generating the kernel.

This is helpful if a negative value was given in the generation.


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