latest version v1.9 - last update 10 Apr 2010 |
two-dimensional gabor filter kernel More...
#include <ltiGaborKernels.h>
Public Member Functions | |
gaborKernel (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) |
two-dimensional gabor filter kernel
The Gabor kernels are defined by the following equation:
The index m denotes the "band" of the filter (which variance it uses) and the index n the direction of the filter.
For this implementation, the volume under the gauss function for the specified size will be normalized to 1. The result will be modulated with the given direction and frequency.
Due to the nature of this filter, avoid its use with unsigned byte channels! (no lti::channel8, only lti::channel).
You can use an approximation of this kern as separable filter (see lti::sepKernel<T>::separate()), or you can use the lti::gaborKernelSep as a two-filter-pair separable filter.
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::gaborKernel<channel::value_type> kernel(7,1.0,0.5,45.0*Pi/180.0); lti::convolution filter; // convolution operator lti::convolution::parameters param; // parameters param.setKernel(kernel); // use the gabor kernel filter.setParameters(param); // set parameters // filter the data and leave the result there too filter.apply(data);
lti::gaborKernel< T >::gaborKernel | ( | const int & | size, | |
const double & | theVariance, | |||
const double & | frequency, | |||
const double & | angle | |||
) |
void lti::gaborKernel< T >::generate | ( | const int & | size, | |
const double & | theVariance, | |||
const double & | frequency, | |||
const double & | angle | |||
) |
initialize this kernel with the specified values
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) |