Gabor filter
This article may be too technical for most readers to understand.(February 2017) |
In
Some authors claim that simple cells in the
Definition
This section's factual accuracy is disputed. (February 2013) |
Its impulse response is defined by a sinusoidal wave (a plane wave for 2D Gabor filters) multiplied by a Gaussian function.[6] Because of the multiplication-convolution property (
Complex
Real
Imaginary
where and .
In this equation, represents the wavelength of the sinusoidal factor, represents the orientation of the normal to the parallel stripes of a
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.[8] 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.[9]
Time-causal analogue of the Gabor filter
When processing temporal signals, data from the future cannot be accessed, which leads to problems if attempting to use Gabor functions for processing real-time signals that depend on the temporal dimension. A time-causal analogue of the Gabor filter has been developed in [10] based on replacing the Gaussian kernel in the Gabor function with a time-causal and time-recursive kernel referred to as the time-causal limit kernel. In this way, time-frequency analysis based on the resulting complex-valued extension of the time-causal limit kernel makes it possible to capture essentially similar transformations of a temporal signal as the Gabor filter can, and as can be described by the Heisenberg group, see [10] for further details.
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.[11] In the discrete domain, two-dimensional Gabor filters are given by,
where B and C are normalizing factors to be determined.
2D Gabor filters have rich applications in image processing, especially in
Applications of 2D Gabor filters in image processing
In document image processing, Gabor features are ideal for identifying the script of a word in a multilingual document.[13] 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.[14][15][16] It has also been applied for facial expression recognition [17] 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
Example implementations
Python
This is an example implementation in Python:
import numpy as np
def gabor(sigma, theta, Lambda, psi, gamma):
"""Gabor feature extraction."""
sigma_x = sigma
sigma_y = float(sigma) / gamma
# Bounding box
nstds = 3 # Number of standard deviation sigma
xmax = max(
abs(nstds * sigma_x * np.cos(theta)), abs(nstds * sigma_y * np.sin(theta))
)
xmax = np.ceil(max(1, xmax))
ymax = max(
abs(nstds * sigma_x * np.sin(theta)), abs(nstds * sigma_y * np.cos(theta))
)
ymax = np.ceil(max(1, ymax))
xmin = -xmax
ymin = -ymax
(y, x) = np.meshgrid(np.arange(ymin, ymax + 1), np.arange(xmin, xmax + 1))
# Rotation
x_theta = x * np.cos(theta) + y * np.sin(theta)
y_theta = -x * np.sin(theta) + y * np.cos(theta)
gb = np.exp(
-0.5 * (x_theta**2 / sigma_x**2 + y_theta**2 / sigma_y**2)
) * np.cos(2 * np.pi / Lambda * x_theta + psi)
return gb
For an implementation on images, see [1].
MATLAB
This is an example implementation in MATLAB/Octave:
function gb = gabor_fn(sigma, theta, lambda, psi, gamma)
sigma_x = sigma;
sigma_y = sigma / gamma;
% Bounding box
nstds = 3;
xmax = max(abs(nstds * sigma_x * cos(theta)), abs(nstds * sigma_y * sin(theta)));
xmax = ceil(max(1, xmax));
ymax = max(abs(nstds * sigma_x * sin(theta)), abs(nstds * sigma_y * cos(theta)));
ymax = ceil(max(1, ymax));
xmin = -xmax;
ymin = -ymax;
[x,y] = meshgrid(xmin:xmax, ymin:ymax);
% Rotation
x_theta = x * cos(theta) + y * sin(theta);
y_theta = -x * sin(theta) + y * cos(theta);
gb = exp(-.5*(x_theta.^2/sigma_x^2+y_theta.^2/sigma_y^2)).*cos(2*pi/lambda*x_theta+psi);
Code for Gabor feature extraction from images in MATLAB can be found at http://www.mathworks.com/matlabcentral/fileexchange/44630.
Haskell
This is another example implementation in
import Data.Complex
gabor λ θ ψ σ γ x y = exp(-(x'^2 + γ^2 * y'^2) / (2*σ^2)) * exp(i * (2*pi*x'/λ + ψ))
where x' = x * cos θ + y * sin θ
y' = -x * sin θ + y * cos θ
i = 0 :+ 1
See also
References
- ^ Gabor, D. (1946). "Theory of communication". J. Inst. Electr. Eng. 93.
- ^
Granlund G. H. (1978). "In Search of a General Picture Processing Operator". Computer Graphics and Image Processing. 8 (2): 155–173. ISSN 0146-664X.
- S2CID 4358477.)
{{cite journal}}
: CS1 maint: multiple names: authors list (link - PMID 7463179.
- S2CID 9271650.
- S2CID 14952808.
- ^ 3D surface tracking and approximation using Gabor filters, Jesper Juul Henriksen, South Denmark University, March 28, 2007
- S2CID 40518532
- S2CID 16809045. Archived from the original(PDF) on 2020-02-28.
- ^ PMID 36689001.
- ISBN 978-3-642-40245-6.
- S2CID 10994982.
- ISSN 0167-8655.
- S2CID 21856192.
- OL 9056158M.
- ^ S Sabari Raju, P B Pati and A G Ramakrishnan, “Text Localization and Extraction from Complex Color Images,” Proc. First International Conference on Advances in Visual Computing (ISVC05), Nevada, USA, LNCS 3804, Springer Verlag, Dec. 5-7, 2005, pp. 486-493.
- S2CID 1586662.
- S2CID 206078730.
External links
- MATLAB code for Gabor filters and Gabor feature extraction
- 3D Gabor demonstrated with Mathematica
- python implementation of log-Gabors for still images
- Gabor filter for image processing and computer vision (demonstration) Archived 2018-05-29 at the Wayback Machine
Further reading
- OL 685385M.
- Gröchenig, Karlheinz (2001). Foundations of time-frequency analysis : with 15 figures. Applied and Numerical Harmonic Analysis. Boston: Birkhäuser. OL 8074618M.
- Daugman, J.G. (1988). "Complete discrete 2-D Gabor transforms by neural networks for image analysis and compression" (PDF). IEEE Transactions on Acoustics, Speech, and Signal Processing. 36 (7): 1169–1179. ISSN 0096-3518.
- "Online Gabor filter demo". Archived from the original on 2009-06-15. Retrieved 2009-05-25.
- Movellan, Javier R. "Tutorial on Gabor Filters" (PDF). Archived from the original (PDF) on 2009-04-19. Retrieved 2008-05-14.
- Lagae, Ares; Lefebvre, Sylvain; Drettakis, George; Dutré, Philip (2009). "Procedural Noise using Sparse Gabor Convolution". ACM Transactions on Graphics. 28 (3): 1. . Retrieved 2009-09-12.
- Steerable Pyramids:
- Eero Simoncelli's page on Steerable Pyramids
- Manduchi, R.; Perona, P.; Shy, D. (April 1998). "Efficient deformable filter banks" (PDF). IEEE Transactions on Signal Processing. 46 (4): 1168–1173. OCLC 926890247. (PDF Archived 2021-11-12 at the Wayback Machine) (Code Archived 2010-06-13 at the Wayback Machine)
- Fischer, Sylvain; Šroubek, Filip; Perrinet, Laurent; Redondo, Rafael; Cristóbal, Gabriel (2007). "Self-Invertible 2D Log-Gabor Wavelets" (PDF). International Journal of Computer Vision. 75 (2): 231–246. S2CID 1452724.