Spatial Gaussian Gradient Magnitude filter
Spatial Gaussian Gradient Magnitude filter.
The Spatial Gaussian Gradient Magnitude filter computes the magnitude of the gradient of an image using Gaussian derivatives, providing a measure of the strength of the gradient at each pixel and helping to highlight edges and transitions in the image. The filter operates by convolving the image with a pair of Gaussian derivative kernels—one for the x-direction and another for the y-direction. These kernels are derived from the Gaussian function and are used to estimate the image gradient in both the horizontal and vertical directions.
Usage:
Start the algorithm from the Processing Toolbox panel.
Select the raster to process and modify the parameterization if necessary, then click run.
Processed image in comparison to the original.
Parameters
- Raster layer [raster]
Raster layer to be processed band-wise.
- Function [string]
Python code. See gaussian_gradient_magnitude for information on different parameters. Default:
from scipy.ndimage.filters import gaussian_gradient_magnitude function = lambda array: gaussian_gradient_magnitude\(array, sigma=1\)
Outputs
- Output raster layer [rasterDestination]
Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialGaussianGradientMagnitudeFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import gaussian_gradient_magnitude
function = lambda array: gaussian_gradient_magnitude(array, sigma=1)
Argument type: string
Acceptable values:
- String value
- field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
- expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer