Mathematica provides built-in functions for generating standard structure matrices and convolution kernels in any number of dimensions, in a form that can be used directly in image processing, linear algebra, or other applications.
GaussianMatrix — Gaussian and Gaussian derivatives
ShenCastanMatrix — exponential and exponential derivatives
GaborMatrix — Gabor kernel
ConstantArray — constant array
SparseArray — arbitrary sparse array
ArrayFlatten — form a matrix from tiles
ArrayPad — add padding to an array