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.
Four families
Section titled “Four families”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.
Start here
Section titled “Start here”Median Filter
Section titled “Median Filter”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.
Gaussian Filter
Section titled “Gaussian Filter”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.
Bilateral Filter
Section titled “Bilateral Filter”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.
Glcm Texture
Section titled “Glcm Texture”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.
Unsharp Masking
Section titled “Unsharp Masking”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.
All the tools
Section titled “All the tools”Smoothing
| Tool | What it does |
|---|---|
| Mean Filter | Moving window average. The simplest smoother. |
| Median Filter | Moving window median. Removes isolated outliers, keeps edges sharper than the mean. |
| Gaussian Filter | Distance weighted smoothing, controlled by sigma. |
| Fast Almost Gaussian Filter | A fast approximation of the Gaussian, for large rasters. |
| Total Filter | Moving window sum. |
| Percentile Filter | The local percentile rank of the centre pixel. |
| Olympic Filter | Averages after removing the extreme values, like Olympic scoring. |
| Conservative Smoothing Filter | Only changes a pixel when it falls outside the range of its neighbours. |
| Savitzky Golay 2d Filter | Smoothing by local polynomial fitting, preserving peak shapes. |
Edge preserving
| Tool | What it does |
|---|---|
| Bilateral Filter | Weighs neighbours by distance and by similarity, so edges survive. |
| Guided Filter | Edge preserving smoothing constrained by a guide image. |
| Non Local Means Filter | Averages similar patches from across the image. The strongest denoiser. |
| Kuwahara Filter | Splits the window into quadrants and takes the most uniform one. |
| Anisotropic Diffusion Filter | Iterative diffusion that stops at edges. |
| Edge Preserving Mean Filter | Averages only the neighbours close in value to the centre. |
| K Nearest Mean Filter | Averages the k neighbours most similar to the centre pixel. |
| Adaptive Filter | Varies the filtering strength with the local statistics. |
| Wiener Filter | Adaptive noise reduction minimising the mean squared error. |
Sharpening and high pass
| Tool | What it does |
|---|---|
| Unsharp Masking | Sharpens by adding back the difference with a smoothed copy. |
| High Pass Filter | Isolates the high frequency detail. |
| High Pass Median Filter | High pass built on the local median. |
| High Pass Bilateral Filter | High pass built on a bilateral smoothing. |
| Diff Of Gaussians Filter | Difference between two Gaussian blurs, isolating a scale of detail. |
| Emboss Filter | Directional shading that gives a relief effect. |
Texture and statistics
| Tool | What it does |
|---|---|
| Glcm Texture | Texture descriptors from the grey level co occurrence matrix. |
| Gabor Filter Bank | Directional texture response at several orientations. |
| Standard Deviation Filter | Local standard deviation, a simple roughness measure. |
| Range Filter | Local maximum minus minimum. |
| Diversity Filter | Count of distinct values in the window. For classified rasters. |
| Majority Filter | Most frequent value in the window. Cleans a classified raster. |
| Maximum Filter | Local maximum. |
| Minimum Filter | Local minimum. |
| Integral Image Transform | Summed area table, used internally by fast filters. |
Morphology and binary rasters
| Tool | What it does |
|---|---|
| Opening | Erosion followed by dilation. Removes small bright features. |
| Closing | Dilation followed by erosion. Fills small dark gaps. |
| Tophat Transform | White or black top hat, isolating features smaller than the structuring element. |
| Line Thinning | Reduces binary features to one pixel wide skeletons. |
| Remove Spurs | Prunes the short spurs a thinning leaves behind. |
| Thicken Raster Line | Thickens diagonal lines so flow cannot leak through them. |
Detection and other
| Tool | What it does |
|---|---|
| Line Detection Filter | Detects linear features at several orientations. |
| Frangi Filter | Multiscale vesselness, for elongated thin structures. |
| Scharr Filter | Gradient operator, more rotationally accurate than Sobel. |
| Lee Filter | Speckle reduction for radar imagery. See also SAR. |
| User Defined Weights Filter | Applies a convolution kernel you supply. |
| Flip Image | Flips the raster vertically, horizontally or both. |
| Lidar Ground Point Filter | Slope 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.