Convolution — SciPy Filters for QGIS

Convolve

class scipy_filters.algs.scipy_convolve_algorithm.SciPyConvolveAlgorithm[source]

Convolve raster with given kernel. Calculated with convolve from scipy.ndimage.

Note

No data cells within the filter radius are filled with 0.

Dimension Calculate for each band separately (2D) or use all bands as a 3D datacube and perform filter in 3D.

Note

bands will be the first axis of the datacube.

Kernel String representation of array. Must have 2 dimensions if dimension is set to 2D. Should have 3 dimensions if dimension is set to 3D, but a 2D array is also excepted (a new axis is added as first axis and the result is the same as calculating each band seperately).

Normalization Normalize the kernel by dividing through given value; set to 0 to devide through the sum of the absolute values of the kernel.

Origin Shift the origin (hotspot) of the kernel.

Border mode determines how input is extended around the edges: Reflect (input is extended by reflecting at the edge), Constant (fill around the edges with a constant value), Nearest (extend by replicating the nearest pixel), Mirror (extend by reflecting about the center of last pixel), Wrap (extend by wrapping around to the opposite edge).

Dtype Data type of output. Beware of clipping and potential overflow errors if min/max of output does not fit. Default is Float32.

Correlate

class scipy_filters.algs.scipy_convolve_algorithm.SciPyCorrelateAlgorithm[source]

Correlate raster with given kernel. Calculated with correlate from scipy.ndimage.

Note

No data cells within the filter radius are filled with 0.

Dimension Calculate for each band separately (2D) or use all bands as a 3D datacube and perform filter in 3D.

Note

bands will be the first axis of the datacube.

Kernel String representation of array. Must have 2 dimensions if dimension is set to 2D. Should have 3 dimensions if dimension is set to 3D, but a 2D array is also excepted (a new axis is added as first axis and the result is the same as calculating each band seperately).

Normalization Normalize the kernel by dividing through given value; set to 0 to devide through the sum of the absolute values of the kernel.

Origin Shift the origin (hotspot) of the kernel.

Border mode determines how input is extended around the edges: Reflect (input is extended by reflecting at the edge), Constant (fill around the edges with a constant value), Nearest (extend by replicating the nearest pixel), Mirror (extend by reflecting about the center of last pixel), Wrap (extend by wrapping around to the opposite edge).

Dtype Data type of output. Beware of clipping and potential overflow errors if min/max of output does not fit. Default is Float32.

FFT Convolve

class scipy_filters.algs.scipy_fourier_algorithm.SciPyFFTConvolveAlgorithm[source]

Convolve raster band(s) with custom kernel using FFT.

This is faster for large kernels. Both, raster band(s) and kernel are transformed into the frequency domain with fast fourier transform (FFT), the results are multiplied and the product is converted back using FFT.

Calculated using fftconvolve from scipy.signal.

Note

No data cells within the filter radius are filled with 0.

Kernel String representation of array. Must have 2 dimensions if dimension is set to 2D. Should have 3 dimensions if dimension is set to 3D, but a 2D array is also excepted (a new axis is added as first axis and the result is the same as calculating each band seperately). Normalization Normalize the kernel by dividing through given value; set to 0 to devide through the sum of the absolute values of the kernel.

Dtype Data type of output. Beware of clipping and potential overflow errors if min/max of output does not fit. Default is Float32.

FFT Correlate

class scipy_filters.algs.scipy_fourier_algorithm.SciPyFFTCorrelateAlgorithm[source]

Correlate raster band(s) with custom kernel using FFT

This is faster for large kernels. Both, raster band(s) and kernel are transformed into the frequency domain with fast fourier transform (FFT), the results are multiplied and the product is converted back using FFT.

Calculated using correlate from scipy.signal. using method “fft”.

Note

No data cells within the filter radius are filled with 0.

Kernel String representation of array. Must have 2 dimensions if dimension is set to 2D. Should have 3 dimensions if dimension is set to 3D, but a 2D array is also excepted (a new axis is added as first axis and the result is the same as calculating each band seperately).

Normalization Normalize the kernel by dividing through given value; set to 0 to devide through the sum of the absolute values of the kernel.

Dtype Data type of output. Beware of clipping and potential overflow errors if min/max of output does not fit. Default is Float32.