Spatial Maximum filter

Spatial Maximum filter.

The filter operates by moving a window or kernel across the image and replacing the pixel within the window with the maximum pixel value found within that window. The size of the window determines the extent of the filter’s effect on the image.

Usage:

  1. Start the algorithm from the Processing Toolbox panel.

  2. Select the raster to process and modify the parameterization if necessary, then click run.

    usr_section/usr_manual/processing_algorithms/convolution__morphology_and_filtering/source/usr_section/usr_manual/processing_algorithms_includes/convolution__morphology_and_filtering/img/max_filter_interface.png
  3. Processed image in comparison to the original.

    usr_section/usr_manual/processing_algorithms/convolution__morphology_and_filtering/source/usr_section/usr_manual/processing_algorithms_includes/convolution__morphology_and_filtering/img/max_filter_result.png

Parameters

Raster layer [raster]

Raster layer to be processed band-wise.

Function [string]

Python code. See maximum_filter for information on different parameters.

Default:

from scipy.ndimage.filters import maximum_filter

function = lambda array: maximum_filter(array, size=3)

Outputs

Output raster layer [rasterDestination]

Raster file destination.

Command-line usage

>qgis_process help enmapbox:SpatialMaximumFilter:

----------------
Arguments
----------------

raster: Raster layer
    Argument type:  raster
    Acceptable values:
            - Path to a raster layer
function: Function
    Default value:  from scipy.ndimage.filters import maximum_filter

function = lambda array: maximum_filter(array, size=3)
    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