Trisha Shetty (Editor)

Gabor filter

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Gabor filter

In image processing, a Gabor filter, named after Dennis Gabor, is a linear filter used for edge detection. Frequency and orientation representations of Gabor filters are similar to those of the human visual system, and they have been found to be particularly appropriate for texture representation and discrimination. In the spatial domain, a 2D Gabor filter is a Gaussian kernel function modulated by a sinusoidal plane wave.

Contents

Simple cells in the visual cortex of mammalian brains can be modeled by Gabor functions. Thus, image analysis with Gabor filters is thought to be similar to perception in the human visual system.

Definition

Its impulse response is defined by a sinusoidal wave (a plane wave for 2D Gabor filters) multiplied by a Gaussian function. Because of the multiplication-convolution property (Convolution theorem), the Fourier transform of a Gabor filter's impulse response is the convolution of the Fourier transform of the harmonic function and the Fourier transform of the Gaussian function. The filter has a real and an imaginary component representing orthogonal directions. The two components may be formed into a complex number or used individually.

Complex

g ( x , y ; λ , θ , ψ , σ , γ ) = exp ( x 2 + γ 2 y 2 2 σ 2 ) exp ( i ( 2 π x λ + ψ ) )

Real

g ( x , y ; λ , θ , ψ , σ , γ ) = exp ( x 2 + γ 2 y 2 2 σ 2 ) cos ( 2 π x λ + ψ )

Imaginary

g ( x , y ; λ , θ , ψ , σ , γ ) = exp ( x 2 + γ 2 y 2 2 σ 2 ) sin ( 2 π x λ + ψ )

where

x = x cos θ + y sin θ

and

y = x sin θ + y cos θ

In this equation, λ represents the wavelength of the sinusoidal factor, θ represents the orientation of the normal to the parallel stripes of a Gabor function, ψ is the phase offset, σ is the sigma/standard deviation of the Gaussian envelope and γ is the spatial aspect ratio, and specifies the ellipticity of the support of the Gabor function.

Wavelet space

Gabor filters are directly related to Gabor wavelets, since they can be designed for a number of dilations and rotations. However, in general, expansion is not applied for Gabor wavelets, since this requires computation of bi-orthogonal wavelets, which may be very time-consuming. Therefore, usually, a filter bank consisting of Gabor filters with various scales and rotations is created. The filters are convolved with the signal, resulting in a so-called Gabor space. This process is closely related to processes in the primary visual cortex. Jones and Palmer showed that the real part of the complex Gabor function is a good fit to the receptive field weight functions found in simple cells in a cat's striate cortex.

Extraction of features from images

A set of Gabor filters with different frequencies and orientations may be helpful for extracting useful features from an image. In the discrete domain, two-dimensional Gabor filters are given by,

G c [ i , j ] = B e ( i 2 + j 2 ) 2 σ 2 cos ( 2 π f ( i cos θ + j sin θ ) ) G s [ i , j ] = C e ( i 2 + j 2 ) 2 σ 2 sin ( 2 π f ( i cos θ + j sin θ ) )

where B and C are normalizing factors to be determined. 2-D Gabor filters have rich applications in image processing, especially in feature extraction for texture analysis and segmentation. f defines the frequency being looked for in the texture. By varying θ , we can look for texture oriented in a particular direction. By varying σ , we change the support of the basis or the size of the image region being analyzed.

Applications of 2-D Gabor filters in image processing

In document image processing, Gabor features are ideal for identifying the script of a word in a multilingual document. Gabor filters with different frequencies and with orientations in different directions have been used to localize and extract text-only regions from complex document images (both gray and colour), since text is rich in high frequency components, whereas pictures are relatively smooth in nature. It has also been applied for facial expression recognition Gabor filters have also been widely used in pattern analysis applications. For example, it has been used to study the directionality distribution inside the porous spongy trabecular bone in the spine. The Gabor space is very useful in image processing applications such as optical character recognition, iris recognition and fingerprint recognition. Relations between activations for a specific spatial location are very distinctive between objects in an image. Furthermore, important activations can be extracted from the Gabor space in order to create a sparse object representation.

Example implementations

MATLAB code for Gabor feature extraction from images can be found at http://www.mathworks.com/matlabcentral/fileexchange/44630.

This is an example implementation in Python:

For an implementation on images, see [1].

This is an example implementation in MATLAB/Octave:

This is another example implementation in Haskell:

(Note: a :+ b should be read as a + i b)

References

Gabor filter Wikipedia