latest version v1.9 - last update 10 Apr 2010 |
two-dimensional separable gabor filter kernel More...
#include <ltiGaborKernels.h>
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) |
two-dimensional separable 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.
This kernel can be expressed also as:
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.
lti::gaborKernelSep< T >::gaborKernelSep | ( | const int & | size, | |
const double & | theVariance, | |||
const double & | frequency, | |||
const double & | angle | |||
) |
void lti::gaborKernelSep< 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) |