Skip to content

Filters

Filters is the general purpose image processing sub toolbox: 46 tools that move a window over the raster and replace each pixel by something computed from its neighbours. Smoothing, sharpening, noise removal, texture measurement and morphological operations all work that way.

They apply to any raster, not only to imagery. A slope raster, a density surface or a classified map can all be filtered.

Smoothing replaces each pixel by an average of its surroundings, which removes noise and detail together. Mean, median and Gaussian are the classics.

Edge preserving smoothing does the same while refusing to blur across boundaries. Bilateral, guided, Kuwahara, anisotropic diffusion and non local means belong here. They are what you want on imagery you intend to classify afterwards.

Sharpening and high pass do the opposite, emphasising the fine detail. Unsharp masking is the standard.

Texture and morphology measure the local structure rather than the value: how variable the neighbourhood is, or how the shapes behave under erosion and dilation.

The first filter to try on noisy imagery. It replaces each pixel by the median of its neighbourhood, which removes isolated aberrant pixels completely while leaving edges sharper than any averaging filter would.

The window size is the only real parameter. Larger removes more noise and more detail.

Mathematically optimal smoothing, weighted by distance. Its sigma parameter sets how far the blur reaches. It is the reference smoother, and the first step of many other algorithms, including edge detection.

Use Fast Almost Gaussian Filter on large rasters when the exact kernel is not required, since it approximates the same result much faster.

The edge preserving smoother to know. It weighs neighbours both by distance and by how similar their values are, so pixels across a boundary barely contribute. The result is a cleaner image with its boundaries intact, which is exactly what a classifier needs.

Guided Filter and Non Local Means Filter solve the same problem with different methods, the second being the strongest denoiser and the slowest.

Measures texture rather than brightness, from the grey level co occurrence matrix: contrast, homogeneity, entropy and related descriptors. Texture separates classes that spectra cannot, such as a forest from a meadow of the same colour, or an orchard from a plantation.

A standard input to classification, and to OBIA object features.

The standard sharpening method: subtract a smoothed copy from the original and add the difference back. Improves the readability of an orthophoto without inventing information.

Smoothing

ToolWhat it does
Mean FilterMoving window average. The simplest smoother.
Median FilterMoving window median. Removes isolated outliers, keeps edges sharper than the mean.
Gaussian FilterDistance weighted smoothing, controlled by sigma.
Fast Almost Gaussian FilterA fast approximation of the Gaussian, for large rasters.
Total FilterMoving window sum.
Percentile FilterThe local percentile rank of the centre pixel.
Olympic FilterAverages after removing the extreme values, like Olympic scoring.
Conservative Smoothing FilterOnly changes a pixel when it falls outside the range of its neighbours.
Savitzky Golay 2d FilterSmoothing by local polynomial fitting, preserving peak shapes.

Edge preserving

ToolWhat it does
Bilateral FilterWeighs neighbours by distance and by similarity, so edges survive.
Guided FilterEdge preserving smoothing constrained by a guide image.
Non Local Means FilterAverages similar patches from across the image. The strongest denoiser.
Kuwahara FilterSplits the window into quadrants and takes the most uniform one.
Anisotropic Diffusion FilterIterative diffusion that stops at edges.
Edge Preserving Mean FilterAverages only the neighbours close in value to the centre.
K Nearest Mean FilterAverages the k neighbours most similar to the centre pixel.
Adaptive FilterVaries the filtering strength with the local statistics.
Wiener FilterAdaptive noise reduction minimising the mean squared error.

Sharpening and high pass

ToolWhat it does
Unsharp MaskingSharpens by adding back the difference with a smoothed copy.
High Pass FilterIsolates the high frequency detail.
High Pass Median FilterHigh pass built on the local median.
High Pass Bilateral FilterHigh pass built on a bilateral smoothing.
Diff Of Gaussians FilterDifference between two Gaussian blurs, isolating a scale of detail.
Emboss FilterDirectional shading that gives a relief effect.

Texture and statistics

ToolWhat it does
Glcm TextureTexture descriptors from the grey level co occurrence matrix.
Gabor Filter BankDirectional texture response at several orientations.
Standard Deviation FilterLocal standard deviation, a simple roughness measure.
Range FilterLocal maximum minus minimum.
Diversity FilterCount of distinct values in the window. For classified rasters.
Majority FilterMost frequent value in the window. Cleans a classified raster.
Maximum FilterLocal maximum.
Minimum FilterLocal minimum.
Integral Image TransformSummed area table, used internally by fast filters.

Morphology and binary rasters

ToolWhat it does
OpeningErosion followed by dilation. Removes small bright features.
ClosingDilation followed by erosion. Fills small dark gaps.
Tophat TransformWhite or black top hat, isolating features smaller than the structuring element.
Line ThinningReduces binary features to one pixel wide skeletons.
Remove SpursPrunes the short spurs a thinning leaves behind.
Thicken Raster LineThickens diagonal lines so flow cannot leak through them.

Detection and other

ToolWhat it does
Line Detection FilterDetects linear features at several orientations.
Frangi FilterMultiscale vesselness, for elongated thin structures.
Scharr FilterGradient operator, more rotationally accurate than Sobel.
Lee FilterSpeckle reduction for radar imagery. See also SAR.
User Defined Weights FilterApplies a convolution kernel you supply.
Flip ImageFlips the raster vertically, horizontally or both.
Lidar Ground Point FilterSlope based separation of ground from off ground points.

Window size is the parameter. Almost every tool here takes one, and it decides the scale you are working at. It is expressed in cells, so its meaning on the ground depends on your resolution.

Filter before classifying, not after. Cleaning a classified map with a majority filter is legitimate. Trying to fix a noisy classification that came from unfiltered imagery is not.