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

lti::gaborKernelSep< T > Class Template Reference

two-dimensional separable gabor filter kernel More...

#include <ltiGaborKernels.h>

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

List of all members.

Public Member Functions

 gaborKernelSep (const int &size, const double &theVariance, const double &frequency, const double &angle)
void generate (const int &size, const double &theVariance, const double &frequency, const double &angle)

Detailed Description

template<class T>
class lti::gaborKernelSep< T >

two-dimensional separable gabor filter kernel

The Gabor kernels are defined by the following equation:

$ f_{mn}(x,y) = \frac{1}{2\pi\sigma^2}\exp(-\frac{x^2+y^2}{2\sigma_m^2}) \cos\left(\omega_mx\cos\theta_n+\omega_my\sin\theta_n \right) $

The index m denotes the "band" of the filter (which variance it uses) and the index n the direction of the filter.

This kernel can be expressed also as: $ f_{mn} = h_1(x)h_2(x)-h_3(x)h_4(x)$

This two-filter-pair separation property is used in this implementation.

Due to the nature of this filter, avoid its use with unsigned byte channels! (no lti::channel8, only lti::channel).

Example:

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

      // ... initialize channel here ...

      // gabor filter kernel with 7 elements, a variance of 1.0, frequency
      // of 0.5 and 45°
      lti::gaborKernelSep<channel::value_type> kernel(3,1.0,0.5,45*Pi/180.0);

      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);

Generally, it is faster to use the separable kernel for kernel dimension bigger or equal han 5x5.


Constructor & Destructor Documentation

template<class T>
lti::gaborKernelSep< T >::gaborKernelSep ( const int &  size,
const double &  theVariance,
const double &  frequency,
const double &  angle 
)

constructor

Parameters:
size is the number of elements pro dimension (i.e. the filter kern is a 'size x size' kernel!)
theVariance variance of the kernel
frequency the angular frequency to be modulated with (in radians per line)
angle the angle to modulate the gaussian function (in radians)

Member Function Documentation

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

initialize this kernel with the specified values

Parameters:
size size of the kernel in one dimension
theVariance variance of the kernel
frequency the angular frequency to be modulated with (in radians per line)
angle the angle to modulate the gaussian function (in radians)

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