# Trimmed mean filter

A non-linear smoothing filter. Sometimes called the α-trimmed mean filter.

Recall that the biggest disadvantage of the mean filter is the equal influence of all pixels in the kernel, even very noisy ones. Truncating, or ‘trimming’, the distribution before taking the mean, by removing some proportion (usually called α) of the largest and smallest values, is a simple way of ensuring that extreme local values do not influence the output. The portion to be truncated varies between 0% (equivalent to the mean) and 100% (equivalent to the median). Figures 1f and 2f in Hall (2007^{[1]}) show the effect of trimming only the maximum and minimum values in two passes of a 3 × 3 support (α = 25%). Note that, in general, multiple passes of a small support is approximately equivalent to a single pass of a larger support, so two passes of a 3 × 3 support gives about the same result as one pass of a 5 × 5 support, three passes are similar to 7 × 7, and so on.

Like the conservative filter, this filter deals well with images containing spiky noise, but it is less effective at attenuating random noise. Since the filter applies a mean to the untrimmed data, it is not edge preserving, except perhaps when α is quite large (i.e. approaching a median filter).

## See also

- Smoothing filter
- Median filter — a special case of the trimmed mean filter

## References

- ↑ Hall, M (2007). Smooth operator: smoothing seismic horizons and attributes. The Leading Edge 26 (1), January 2007, p16-20. doi:10.1190/1.2431821