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

lti::gaussKernel2D< T > Class Template Reference

Two-dimensional Gaussian filter kernel. More...

#include <ltiGaussKernels.h>

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

List of all members.

Public Member Functions

 gaussKernel2D (const int &size=3, const double &theVariance=1.4426950409)
void generate (const int &size, const double &theVariance)
const double & getActualVariance () const

Detailed Description

template<class T>
class lti::gaussKernel2D< T >

Two-dimensional Gaussian filter kernel.

Gaussian kernels are separable, and will be created this way! (

See also:
gaussKernel1D)

You can create a "real" 2D kernel with the following code

 lti::gaussKernel2D<float> gauss(5); // a kernel 5x5 with default variance
 lti::kernel2D<float>      kern;     // a 2D kernel;
 
 kern.castFrom(gauss);

but note that the convolution of this kernel with a channel is less efficient than convolving its separable version.

To convolve this filter with a channel follow the next example

 // the channel to be filtered:
 lti::channel data;

 // ... initialize channel here ...

 // gauss filter kernel with dimensions 5x5, and a variance of 1.3
 lti::gaussKernel2D<lti::channel::value_type> kernel(5,1.3);

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

 // filter the channel and leave the result there too
 filter.apply(data);

You can also use following shortcut, if you can use the default boundary type for the convolution:

 // gauss filter kernel with dimensions 5x5, and a variance of 1.3
 lti::gaussKernel2D<lti::channel::value_type> kernel(5,1.3);

 lti::convolution filter(kernel);                // convolution operator

 // filter the channel and leave the result there too
 filter.apply(data);

Constructor & Destructor Documentation

template<class T>
lti::gaussKernel2D< T >::gaussKernel2D ( const int &  size = 3,
const double &  theVariance = 1.4426950409 
)

constructor

Parameters:
size is the dimension of the one dimensional part (i.e. the filter kern is a size x size kernel!)
theVariance variance of the kernel. If negative, a default value from the given size will be computed (see lti::gaussKernel1D<T>)

Member Function Documentation

template<class T>
void lti::gaussKernel2D< T >::generate ( const int &  size,
const double &  theVariance 
)

initialize this kernel with the specified values

Parameters:
size size of the kernel in one dimension
theVariance variance of the kernel. If negative, a default value from the given size will be computed (see lti::gaussKernel1D<T>)
template<class T>
const double& lti::gaussKernel2D< 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