Gabor Filter

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

7/14/23, 10:06 AM Gabor filter - Wikipedia

Gabor filter
In image processing, a Gabor filter, named after Dennis Gabor,
who first proposed it as a 1D filter.[1] The Gabor filter was first
generalized to 2D by Gösta Granlund,[2] by adding a reference
direction. The Gabor filter is a linear filter used for texture
analysis, which essentially means that it analyzes whether there is
any specific frequency content in the image in specific directions
in a localized region around the point or region of analysis.
Frequency and orientation representations of Gabor filters are
claimed by many contemporary vision scientists to be similar to
those of the human visual system.[3] 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 Example of a two-dimensional
(see Gabor transform). Gabor filter

Some authors claim that simple cells in the visual cortex of


mammalian brains can be modeled by Gabor functions.[4][5] Thus, image analysis with Gabor filters is
thought by some 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.[6] 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 (sinusoidal function) and the Fourier transform of the Gaussian function.
The filter has a real and an imaginary component representing orthogonal directions.[7] The two
components may be formed into a complex number or used individually.

Complex

Real

Imaginary

where and .
https://en.wikipedia.org/wiki/Gabor_filter 1/7
7/14/23, 10:06 AM Gabor filter - Wikipedia

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.[8] Jones and Palmer showed that the real part of the Demonstration of a Gabor filter
complex Gabor function is a good fit to the receptive field weight applied to Chinese OCR. Four
orientations are shown on the right
functions found in simple cells in a cat's striate cortex.[9]
0°, 45°, 90° and 135°. The original
character picture and the
Time-causal analogue of the Gabor superposition of all four orientations
are shown on the left.
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.

https://en.wikipedia.org/wiki/Gabor_filter 2/7
7/14/23, 10:06 AM Gabor filter - Wikipedia

2D Gabor filters have rich applications in image processing, especially in feature extraction for texture
analysis and segmentation.[12] 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 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 trabecular bone in the spine.[18]
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
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] (https://pythonhosted.org/LogGabor/).

This is an example implementation in MATLAB/Octave:

https://en.wikipedia.org/wiki/Gabor_filter 3/7
7/14/23, 10:06 AM Gabor filter - Wikipedia

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.

This is another example implementation in Haskell:

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
Gabor transform
Gabor wavelet
Gabor atom
Log Gabor filter

References
1. Gabor, D. (1946). "Theory of communication". J. Inst. Electr. Eng. 93.
2. Granlund G. H. (1978). "In Search of a General Picture Processing Operator". Computer Graphics
and Image Processing. 8 (2): 155–173. doi:10.1016/0146-664X(78)90047-3 (https://doi.org/10.10
16%2F0146-664X%2878%2990047-3). ISSN 0146-664X (https://www.worldcat.org/issn/0146-664
X).
3. Olshausen, B. A. & Field, D. J. (1996). "Emergence of simple-cell receptive-field properties by
learning a sparse code for natural images". Nature. 381 (6583): 607–609.
Bibcode:1996Natur.381..607O (https://ui.adsabs.harvard.edu/abs/1996Natur.381..607O).
doi:10.1038/381607a0 (https://doi.org/10.1038%2F381607a0). PMID 8637596 (https://pubmed.nc
bi.nlm.nih.gov/8637596). S2CID 4358477 (https://api.semanticscholar.org/CorpusID:4358477).
4. Marčelja, S. (1980). "Mathematical description of the responses of simple cortical cells". Journal of
the Optical Society of America. 70 (11): 1297–1300. Bibcode:1980JOSA...70.1297M (https://ui.ad
sabs.harvard.edu/abs/1980JOSA...70.1297M). doi:10.1364/JOSA.70.001297 (https://doi.org/10.1
364%2FJOSA.70.001297). PMID 7463179 (https://pubmed.ncbi.nlm.nih.gov/7463179).

https://en.wikipedia.org/wiki/Gabor_filter 4/7
7/14/23, 10:06 AM Gabor filter - Wikipedia

5. Daugman, John G. (1985-07-01). "Uncertainty relation for resolution in space, spatial frequency,
and orientation optimized by two-dimensional visual cortical filters". Journal of the Optical Society
of America A. 2 (7): 1160–9. Bibcode:1985JOSAA...2.1160D (https://ui.adsabs.harvard.edu/abs/19
85JOSAA...2.1160D). CiteSeerX 10.1.1.465.8506 (https://citeseerx.ist.psu.edu/viewdoc/summar
y?doi=10.1.1.465.8506). doi:10.1364/JOSAA.2.001160 (https://doi.org/10.1364%2FJOSAA.2.001
160). ISSN 1084-7529 (https://www.worldcat.org/issn/1084-7529). PMID 4020513 (https://pubme
d.ncbi.nlm.nih.gov/4020513).
6. Fogel, I.; Sagi, D. (June 1989). "Gabor filters as texture discriminator". Biological Cybernetics. 61
(2): 103–113. CiteSeerX 10.1.1.367.2700 (https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.
1.1.367.2700). doi:10.1007/BF00204594 (https://doi.org/10.1007%2FBF00204594). ISSN 0340-
1200 (https://www.worldcat.org/issn/0340-1200). OCLC 895625214 (https://www.worldcat.org/ocl
c/895625214). S2CID 14952808 (https://api.semanticscholar.org/CorpusID:14952808).
7. 3D surface tracking and approximation using Gabor filters, Jesper Juul Henriksen, South
Denmark University, March 28, 2007
8. Daugman, J.G. (1980), "Two-dimensional spectral analysis of cortical receptive field profiles",
Vision Res., 20 (10): 847–56, doi:10.1016/0042-6989(80)90065-6 (https://doi.org/10.1016%2F004
2-6989%2880%2990065-6), PMID 7467139 (https://pubmed.ncbi.nlm.nih.gov/7467139),
S2CID 40518532 (https://api.semanticscholar.org/CorpusID:40518532)
9. Jones, J.P.; Palmer, L.A. (1987). "An evaluation of the two-dimensional gabor filter model of
simple receptive fields in cat striate cortex" (https://web.archive.org/web/20200228110529/http://p
dfs.semanticscholar.org/0dbf/797d5b34f40d16eeadfa7a5b4543c2af2c11.pdf) (PDF). J.
Neurophysiol. 58 (6): 1233–1258. doi:10.1152/jn.1987.58.6.1233 (https://doi.org/10.1152%2Fjn.19
87.58.6.1233). PMID 3437332 (https://pubmed.ncbi.nlm.nih.gov/3437332). S2CID 16809045 (http
s://api.semanticscholar.org/CorpusID:16809045). Archived from the original (http://pdfs.semantics
cholar.org/0dbf/797d5b34f40d16eeadfa7a5b4543c2af2c11.pdf) (PDF) on 2020-02-28.
10. Lindeberg, T. (23 January 2023). "A time-causal and time-recursive scale-covariant scale-space
representation of temporal signals and past time" (https://doi.org/10.1007%2Fs00422-022-00953-
6). Biological Cybernetics: 1–39. doi:10.1007/s00422-022-00953-6 (https://doi.org/10.1007%2Fs0
0422-022-00953-6).
11. Haghighat, M.; Zonouz, S.; Abdel-Mottaleb, M. (2013). "Identification Using Encrypted Biometrics".
Computer Analysis of Images and Patterns. Lecture Notes in Computer Science. Vol. 8048.
p. 440. doi:10.1007/978-3-642-40246-3_55 (https://doi.org/10.1007%2F978-3-642-40246-3_55).
ISBN 978-3-642-40245-6.
12. Ramakrishnan, A.G.; Kumar Raja, S.; Raghu Ram, H.V. (2002). "Neural network-based
segmentation of textures using Gabor features" (http://eprints.iisc.ac.in/5152/1/neural_networks.p
df) (PDF). Proceedings of the 12th IEEE Workshop on Neural Networks for Signal Processing.
Martigny, Switzerland: IEEE: 365–374. doi:10.1109/NNSP.2002.1030048 (https://doi.org/10.110
9%2FNNSP.2002.1030048). ISBN 978-0-7803-7616-8. OCLC 812617471 (https://www.worldcat.o
rg/oclc/812617471). S2CID 10994982 (https://api.semanticscholar.org/CorpusID:10994982).
13. Pati, Peeta Basa; Ramakrishnan, A.G. (July 2008). "Word level multi-script identification". Pattern
Recognition Letters. 29 (9): 1218–1229. Bibcode:2008PaReL..29.1218P (https://ui.adsabs.harvar
d.edu/abs/2008PaReL..29.1218P). doi:10.1016/j.patrec.2008.01.027 (https://doi.org/10.1016%2F
j.patrec.2008.01.027). ISSN 0167-8655 (https://www.worldcat.org/issn/0167-8655).

https://en.wikipedia.org/wiki/Gabor_filter 5/7
7/14/23, 10:06 AM Gabor filter - Wikipedia

14. Raju S, S.; Pati, P.B.; Ramakrishnan, A.G. (2004). "Gabor filter based block energy analysis for
text extraction from digital document images" (http://eprints.iisc.ac.in/490/1/Gabor_Filter_Based_B
lock_Engery_Analy...pdf) (PDF). First International Workshop on Document Image Analysis for
Libraries, 2004. Proceedings. Palo Alto, CA, USA: IEEE: 233–243.
doi:10.1109/DIAL.2004.1263252 (https://doi.org/10.1109%2FDIAL.2004.1263252). ISBN 978-0-
7695-2088-9. LCCN 2003116308 (https://lccn.loc.gov/2003116308). OL 8067708M (https://openlib
rary.org/books/OL8067708M). S2CID 21856192 (https://api.semanticscholar.org/CorpusID:21856
192).
15. Raju, S. Sabari; Pati, P. B.; Ramakrishnan, A. G. (2005). "Text Localization and Extraction from
Complex Color Images" (https://archive.org/details/advancesvisualco00bebi_320). Lecture Notes
in Computer Science. 3804: 486–493. doi:10.1007/11595755_59 (https://doi.org/10.1007%2F1159
5755_59). ISBN 978-3-540-30750-1. ISSN 0302-9743 (https://www.worldcat.org/issn/0302-9743).
LCCN 2005936803 (https://lccn.loc.gov/2005936803). OL 9056158M (https://openlibrary.org/book
s/OL9056158M).
16. 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.
17. Lyons, M.; Akamatsu, S.; Kamachi, M.; Gyoba, J. (1998). Coding facial expressions with Gabor
wavelets (https://zenodo.org/record/3430156). pp. 200–205. doi:10.1109/AFGR.1998.670949 (htt
ps://doi.org/10.1109%2FAFGR.1998.670949). ISBN 0-8186-8344-9. OL 11390549M (https://openli
brary.org/books/OL11390549M). S2CID 1586662 (https://api.semanticscholar.org/CorpusID:15866
62).
18. Gdyczynski, C.M.; Manbachi, A.; et al. (2014). "On estimating the directionality distribution in
pedicle trabecular bone from micro-CT images". Physiological Measurement. 35 (12): 2415–2428.
Bibcode:2014PhyM...35.2415G (https://ui.adsabs.harvard.edu/abs/2014PhyM...35.2415G).
doi:10.1088/0967-3334/35/12/2415 (https://doi.org/10.1088%2F0967-3334%2F35%2F12%2F241
5). PMID 25391037 (https://pubmed.ncbi.nlm.nih.gov/25391037). S2CID 206078730 (https://api.s
emanticscholar.org/CorpusID:206078730).

External links
MATLAB code for Gabor filters and Gabor feature extraction (http://www.mathworks.com/matlabce
ntral/fileexchange/44630)
3D Gabor demonstrated with Mathematica (http://demonstrations.wolfram.com/Gabor3D/)
python implementation of log-Gabors for still images (https://pythonhosted.org/LogGabor/)
Gabor filter for image processing and computer vision (demonstration) (http://matlabserver.cs.rug.
nl/edgedetectionweb/web/edgedetection_examples.html)

Further reading
Feichtinger, Hans G.; Strohmer, Thomas, eds. (1998). Gabor analysis and algorithms : theory and
applications. Boston: Birkhäuser. ISBN 0-8176-3959-4. LCCN 97032252 (https://lccn.loc.gov/9703
2252). OCLC 37761814 (https://www.worldcat.org/oclc/37761814). OL 685385M (https://openlibra
ry.org/books/OL685385M).
Gröchenig, Karlheinz (2001). Foundations of time-frequency analysis : with 15 figures. Applied
and Numerical Harmonic Analysis. Boston: Birkhäuser. doi:10.1007/978-1-4612-0003-1 (https://do
i.org/10.1007%2F978-1-4612-0003-1). ISBN 0-8176-4022-3. LCCN 00044508 (https://lccn.loc.go
v/00044508). OCLC 44420790 (https://www.worldcat.org/oclc/44420790). OL 8074618M (https://o
penlibrary.org/books/OL8074618M).
https://en.wikipedia.org/wiki/Gabor_filter 6/7
7/14/23, 10:06 AM Gabor filter - Wikipedia

Daugman, J.G. (1988). "Complete discrete 2-D Gabor transforms by neural networks for image
analysis and compression" (http://www.cs.gmu.edu/~zduric/cs774/Papers/Daugman-GaborTransf
orms.pdf) (PDF). IEEE Transactions on Acoustics, Speech, and Signal Processing. 36 (7): 1169–
1179. CiteSeerX 10.1.1.371.5847 (https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.371.
5847). doi:10.1109/29.1644 (https://doi.org/10.1109%2F29.1644). ISSN 0096-3518 (https://www.w
orldcat.org/issn/0096-3518).
"Online Gabor filter demo" (https://web.archive.org/web/20090615224334/http://matlabserver.cs.ru
g.nl/). Archived from the original (http://matlabserver.cs.rug.nl) on 2009-06-15. Retrieved
2009-05-25.
Movellan, Javier R. "Tutorial on Gabor Filters" (https://web.archive.org/web/20090419123314/htt
p://mplab.ucsd.edu/tutorials/gabor.pdf) (PDF). Archived from the original (http://mplab.ucsd.edu/tut
orials/gabor.pdf) (PDF) on 2009-04-19. Retrieved 2008-05-14.
Lagae, Ares; Lefebvre, Sylvain; Drettakis, George; Dutré, Philip (2009). "Procedural Noise using
Sparse Gabor Convolution" (http://www.cs.kuleuven.be/~graphics/publications/LLDD09PNSGC/).
ACM Transactions on Graphics. 28 (3): 1. CiteSeerX 10.1.1.232.5566 (https://citeseerx.ist.psu.ed
u/viewdoc/summary?doi=10.1.1.232.5566). doi:10.1145/1531326.1531360 (https://doi.org/10.114
5%2F1531326.1531360). Retrieved 2009-09-12.
Steerable Pyramids:
1. Eero Simoncelli's page on Steerable Pyramids (http://www.cns.nyu.edu/~eero/STEERPYR/)
2. Manduchi, R.; Perona, P.; Shy, D. (April 1998). "Efficient deformable filter banks" (https://autho
rs.library.caltech.edu/2146/1/MANieeetsp98.pdf) (PDF). IEEE Transactions on Signal
Processing. 46 (4): 1168–1173. Bibcode:1998ITSP...46.1168M (https://ui.adsabs.harvard.edu/
abs/1998ITSP...46.1168M). doi:10.1109/78.668570 (https://doi.org/10.1109%2F78.668570).
ISSN 1053-587X (https://www.worldcat.org/issn/1053-587X). OCLC 926890247 (https://www.
worldcat.org/oclc/926890247). (PDF (http://www.vision.caltech.edu/publications/ManduchiPero
naShy_efficient_deformable.pdf) Archived (https://web.archive.org/web/20211112033332/htt
p://www.vision.caltech.edu/publications/ManduchiPeronaShy_efficient_deformable.pdf) 2021-
11-12 at the Wayback Machine) (Code (http://www.vision.caltech.edu/manduchi/def.tar.Z))
Fischer, Sylvain; Šroubek, Filip; Perrinet, Laurent; Redondo, Rafael; Cristóbal, Gabriel (2007).
"Self-Invertible 2D Log-Gabor Wavelets" (http://staff.utia.cas.cz/sroubekf/papers/gabor_07.pdf)
(PDF). International Journal of Computer Vision. 75 (2): 231–246. CiteSeerX 10.1.1.329.6283 (htt
ps://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.329.6283). doi:10.1007/s11263-006-
0026-8 (https://doi.org/10.1007%2Fs11263-006-0026-8). ISSN 0920-5691 (https://www.worldcat.o
rg/issn/0920-5691). S2CID 1452724 (https://api.semanticscholar.org/CorpusID:1452724).

Retrieved from "https://en.wikipedia.org/w/index.php?title=Gabor_filter&oldid=1141114357"

https://en.wikipedia.org/wiki/Gabor_filter 7/7

You might also like