Formula for generating Gabor filter.
A 2D Gabor kernel can be mathematically defined as:

where
The parameters involved in the construction of a 2D Gabor filter are:
• The variance
of the gaussian function
• The wavelength
of the sinusoidal function
• The orientation
of the normal to the parallel stripes of the Gabor function
• The spatial aspect ratio
specifies the ellipticity of the support of the Gabor function. For
, the support is circular. For
the support is elongated in the orientation of the parallel stripes of the function.