This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

GaussianMatrix

GaussianMatrix[r]
gives a matrix that corresponds to a Gaussian kernel of radius r.
GaussianMatrix[{r, Sigma}]
gives a matrix corresponding to a Gaussian kernel with radius r and standard deviation Sigma.
GaussianMatrix[r, {n1, n2}]
gives a matrix formed from the n1^(th) discrete derivative of the Gaussian with respect to rows and n2^(th) discrete derivative with respect to columns.
GaussianMatrix[r, {{n11, n12}, {n21, n22}, ...}]
gives a matrix formed from the sums of the ni1 and ni2 derivatives.
GaussianMatrix[{{r1, r2, ...}, Sigma}, ...]
gives an array corresponding to a Gaussian kernel with radius ri in the i^(th) index direction.
  • GaussianMatrix[r] gives values that approximate at x index positions from the center, where Sigma=r/2.
  • GaussianMatrix[..., {n1, n2}] by default constructs discrete derivatives as finite differences.
  • GaussianMatrix[r, {{2, 0}, {0, 2}}] gives a matrix formed from the Laplacian of a Gaussian.
  • GaussianMatrix[{Automatic, Sigma, f}, ...] constructs a matrix just large enough to include at least a fraction f of the discrete integral of a Gaussian in each direction.
  • GaussianMatrix allows any of r, Sigma and f to be lists, specifying different values for different directions.
  • For non-integer r, the value of r is effectively rounded to an integer.
  • With the default option setting Method->"Bessel", GaussianMatrix[r] has elements proportional to Exp[-Sigma2] BesselI[x, Sigma2], yielding a kernel with optimal discrete convolution properties.
  • With Method->"Gaussian", GaussianMatrix[r] has elements proportional to the raw continuous functional form Exp[-x2/(2 Sigma2)].
Compute and plot a Gaussian matrix:
First derivative of a Gaussian matrix in the vertical dimension:
Compute and plot a Gaussian matrix:
In[1]:=
Click for copyable input
Out[1]=
 
First derivative of a Gaussian matrix in the vertical dimension:
In[1]:=
Click for copyable input
Out[1]=
Generate an exact symbolic Gaussian matrix:
With Method->"Gaussian", the normalization uses the integral over the domain:
With Method->"Bessel", the normalization uses the sum over the domain:
New in 7