GaborMatrix[r,k]
gives a matrix that corresponds to the real part of a Gabor kernel of radius r and wave vector k.
GaborMatrix[r,k,ϕ]
uses phase shift ϕ.
GaborMatrix[{r,σ},…]
uses the specified standard deviation σ.
GaborMatrix[{{r1,r2,…}},…]
gives an array corresponding to a Gabor kernel with radius ri in the i
index direction.
GaborMatrix
GaborMatrix[r,k]
gives a matrix that corresponds to the real part of a Gabor kernel of radius r and wave vector k.
GaborMatrix[r,k,ϕ]
uses phase shift ϕ.
GaborMatrix[{r,σ},…]
uses the specified standard deviation σ.
GaborMatrix[{{r1,r2,…}},…]
gives an array corresponding to a Gabor kernel with radius ri in the i
index direction.
Details and Options
- GaborMatrix[{r,σ},k,ϕ] gives values proportional to
at index position
from the center. - GaborMatrix[r,k] is equivalent to GaborMatrix[{r,r/2},k,0].
- By default, the matrix is rescaled so that the elements of Abs[GaborMatrix[r,k,0]+I GaborMatrix[r,k,π/2]] sum to 1.
- For integer r, GaborMatrix[r,…] yields a
×
matrix. - For noninteger r, the value of r is effectively rounded to an integer.
- Either of the r or σ can be lists, specifying different values for different directions.
- With GaborMatrix[{r,{σ1,σ2,…}},k], σ1 is the standard deviation along k, and σ2, … are standard deviations perpendicular to k. The i
direction is defined by the i
column of RotationMatrix[{{1,0,…},k}]. - For data arrays with n dimensions and a wave vector {k1,…,kn}, ki is pointing in the same direction as the i
dimension of data. For images, the filter is effectively applied to ImageData[image]. - The following options can be specified:
-
Standardized True whether to rescale the matrix to account for truncation WorkingPrecision Automatic the precision with which to compute matrix elements
Examples
open all close allBasic Examples (3)
ListPlot3D[GaborMatrix[100, {.1, .1}]]MatrixPlot of a Gabor matrix:
MatrixPlot[GaborMatrix[5, {1, 1}]]ListPlot[GaborMatrix[{{25}}, {.3}, Pi / 2], Filling -> 0]Scope (9)
Gabor matrix using a 45° wave vector. Notice that the wave vector is perpendicular to the wave front:
GaborMatrix[5, {1, -1}]//MatrixPlotSpecify an isotropic standard deviation
:
GaborMatrix[{5, 2}, {1, -1}]//MatrixPlotSpecify an anisotropic standard deviation
and
:
GaborMatrix[{5, {2, 3}}, {1, -1}]//MatrixPlotDecrease the wave number to get a Gabor matrix with a larger wavelength:
GaborMatrix[5, .5{1, -1}]//MatrixPlotCreate a rectangular Gabor matrix:
GaborMatrix[{{5, 10}}, {1, -1}]//MatrixPlotAn anisotropic Gabor matrix with a large wavelength and a node at the center:
ArrayPlot[GaborMatrix[{100, {17, 50}}, .001 * {1, 1}, Pi / 2], ColorFunction -> "TemperatureMap"]Visualize a 1D Gabor vector with different wave number and phase shift:
Manipulate[ListPlot[GaborMatrix[{{20}}, {k}, ϕ], Filling -> 0], {k, 0, 1}, {ϕ, 0, π}]Visualize the magnitude spectrum of a 1D Gabor vector for different values of the wavenumber:
Manipulate[Plot[Abs@ListFourierSequenceTransform[GaborMatrix[{{10}}, {k}], ω], {ω, 0, π}, PlotRange -> All], {k, 0, π}]GaborMatrix[20, 3{.1, .1, .1}]//Image3D//ImageAdjustOptions (2)
Standardized (1)
The default setting is True:
GaborMatrix[{{4}}, {1}]Use StandardizedFalse:
GaborMatrix[{{4}}, {1}, Standardized -> False]WorkingPrecision (1)
MachinePrecision is used by default:
GaborMatrix[{{2}}, {1}]Perform exact computation instead:
GaborMatrix[{{2}}, {1}, WorkingPrecision -> ∞]Properties & Relations (3)
GaborFilter is equivalent to a convolution with a GaborMatrix:
img = [image];
g1 = GaborFilter[img, 10, .5{1, -1}]//ImageAdjustg2 = ImageConvolve[img, GaborMatrix[10, .5{1, -1}]]//ImageAdjustg1 === g2Visualize the 1D Gabor kernel on its equivalent Gabor wavelet function:
Manipulate[Show[Plot[Re[WaveletPsi[GaborWavelet[k], x]], {x, -r, r}, PlotRange -> All], ListPlot[Transpose[{Range[-r, r], GaborMatrix[{{r}, 1}, {k}, "Standardization" -> False]Sqrt[2]Surd[Pi, 4]}], PlotStyle -> Directive[Red, PointSize[Large]]], PlotRange -> {-1, 1}], {k, .1, 10}, {r, 5, 100, 1}]With a zero-length wave vector, Gabor matrix is equivalent to GaussianMatrix:
GaborMatrix[5, {0, 0}, 0] == GaussianMatrix[5, Method -> "Gaussian"]Related Guides
Text
Wolfram Research (2012), GaborMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/GaborMatrix.html (updated 2015).
CMS
Wolfram Language. 2012. "GaborMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GaborMatrix.html.
APA
Wolfram Language. (2012). GaborMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GaborMatrix.html
BibTeX
@misc{reference.wolfram_2026_gabormatrix, author="Wolfram Research", title="{GaborMatrix}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/GaborMatrix.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_gabormatrix, organization={Wolfram Research}, title={GaborMatrix}, year={2015}, url={https://reference.wolfram.com/language/ref/GaborMatrix.html}, note=[Accessed: 13-June-2026]}