gives the magnitude of the gradient of data, computed using discrete derivatives of a Gaussian of sample radius r.

uses a Gaussian with standard deviation σ.

uses a Gaussian with radius ri at level i in data.

# Details and Options

• GradientFilter is commonly used in image processing to highlight regions of rapid intensity change using discrete approximations of first Gaussian derivatives in each dimension.
• The data can be any of the following:
•  list arbitrary-rank numerical array tseries temporal data such as TimeSeries, TemporalData, … image arbitrary Image or Image3D object audio an Audio object
• GradientFilter[data,r] uses standard deviation .
• For a single-channel image and for data, the gradient magnitude is the Euclidean norm of the gradient at a pixel position, approximated using discrete derivatives of Gaussians in each dimension.
• For multichannel images, define the Jacobian matrix to be , where is the gradient for channel . The gradient magnitude is the square root of the largest eigenvalue of .
• GradientFilter[data,] by default gives an array, audio object or image of the same dimensions as data.
• The following options can be specified:
•  Method Automatic convolution kernel Padding "Fixed" padding method WorkingPrecision Automatic the precision to use
• The following suboptions can be given to Method:
•  "DerivativeKernel" "Bessel" convolution kernel "NonMaxSuppression" False whether to use non-maximum suppression
• Possible settings for "DerivativeKernel" include:
•  "Bessel" standardized Bessel derivative kernel, used for Canny edge detection "Gaussian" standardized Gaussian derivative kernel, used for Canny edge detection "ShenCastan" first-order derivatives of exponentials "Sobel" binomial generalizations of the Sobel edge-detection kernels {kernel1,kernel2,…} explicit kernels specified for each dimension
• With setting , GradientFilter[data,] normally gives an array, audio object or image smaller than data.
• GradientFilter[image,] always returns a single-channel image of a real type.

# Examples

open allclose all

## Basic Examples(3)

Apply gradient filtering to a vector of numbers:

 In[1]:=
 Out[1]=

Gradient filter of a grayscale image:

 In[1]:=
 Out[1]=

Gradient filtering of a 3D image:

 In[1]:=
 Out[1]=