MaxFilter
✖
MaxFilter
Details

- MaxFilter is a nonlinear filter commonly used to locally smooth data and diminish pepper-like noise, where the amount of smoothing is dependent on the value of r.
- The function applied to each range-r neighborhood is Max.
- The data can be any of the following:
-
list arbitrary-rank numerical array tseries temporal data such as TimeSeries, TemporalData, … image arbitrary Image or Image3D object audio an Audio object - For multichannel images, MaxFilter replaces each pixel by a pixel in its neighborhood that has the maximum total intensity, averaged over all channels.
- MaxFilter[data,{r1,r2,…}] computes the maximum value in
blocks centered on each sample.
- MaxFilter assumes the index coordinate system for lists and images.
- At the data boundaries, MaxFilter uses smaller neighborhoods.


Examples
open allclose allBasic Examples (3)Summary of the most common use cases

https://wolfram.com/xid/0d6eqz5h5m-lyqoqk

Filter a TimeSeries:

https://wolfram.com/xid/0d6eqz5h5m-62t833

https://wolfram.com/xid/0d6eqz5h5m-77v7p5


https://wolfram.com/xid/0d6eqz5h5m-18tdm0

Maximum filtering of a color image:

https://wolfram.com/xid/0d6eqz5h5m-rmsi5c

Scope (12)Survey of the scope of standard use cases
Data (7)
Maximum filtering of a numeric vector:

https://wolfram.com/xid/0d6eqz5h5m-zyc8vf


https://wolfram.com/xid/0d6eqz5h5m-h6hztm

Maximum filtering of a 2D array:

https://wolfram.com/xid/0d6eqz5h5m-cxywqj

Maximum filtering of a list of Quantity objects:

https://wolfram.com/xid/0d6eqz5h5m-38ay6t

https://wolfram.com/xid/0d6eqz5h5m-w60ef5

Filter an Audio signal:

https://wolfram.com/xid/0d6eqz5h5m-p90slf

https://wolfram.com/xid/0d6eqz5h5m-o6g2aw


https://wolfram.com/xid/0d6eqz5h5m-j5yrn4

Filtering a 2D grayscale image:

https://wolfram.com/xid/0d6eqz5h5m-dc0gtv


https://wolfram.com/xid/0d6eqz5h5m-ells2t

Parameters (5)
Specify one radius to be used in all directions:

https://wolfram.com/xid/0d6eqz5h5m-tlzgi7

Increasing the radius will result in brighter images:

https://wolfram.com/xid/0d6eqz5h5m-ibus74

Maximum filtering just in the first direction:

https://wolfram.com/xid/0d6eqz5h5m-gdx3zh

Filtering just in the second direction:

https://wolfram.com/xid/0d6eqz5h5m-79md3z

Maximum filtering of a 3D image in the vertical direction only:

https://wolfram.com/xid/0d6eqz5h5m-camcbp

Filtering of a 3D image in the horizontal planes only:

https://wolfram.com/xid/0d6eqz5h5m-5u7xo

Applications (4)Sample problems that can be solved with this function
Remove pepper noise from an astronomical image:

https://wolfram.com/xid/0d6eqz5h5m-yfvy09

Use a maximum filter to dilate the brighter parts of a color image:

https://wolfram.com/xid/0d6eqz5h5m-6y1vk2

Dilate the brighter parts of an image to remove thin, dark features:

https://wolfram.com/xid/0d6eqz5h5m-4gbc4x

Use maximum filtering to locate borders in an image:

https://wolfram.com/xid/0d6eqz5h5m-fd8j67

Properties & Relations (3)Properties of the function, and connections to other functions
Maximum filtering is the same as Dilation with a box structuring element:

https://wolfram.com/xid/0d6eqz5h5m-jm6ubz

Maximum filtering is the same as ImageFilter with function Max:

https://wolfram.com/xid/0d6eqz5h5m-dhww66

Subsequent application of MaxFilter and MinFilter is the same as Closing:

https://wolfram.com/xid/0d6eqz5h5m-n3e96r

Wolfram Research (2008), MaxFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxFilter.html (updated 2016).
Text
Wolfram Research (2008), MaxFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxFilter.html (updated 2016).
Wolfram Research (2008), MaxFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/MaxFilter.html (updated 2016).
CMS
Wolfram Language. 2008. "MaxFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/MaxFilter.html.
Wolfram Language. 2008. "MaxFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/MaxFilter.html.
APA
Wolfram Language. (2008). MaxFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MaxFilter.html
Wolfram Language. (2008). MaxFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MaxFilter.html
BibTeX
@misc{reference.wolfram_2025_maxfilter, author="Wolfram Research", title="{MaxFilter}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/MaxFilter.html}", note=[Accessed: 23-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_maxfilter, organization={Wolfram Research}, title={MaxFilter}, year={2016}, url={https://reference.wolfram.com/language/ref/MaxFilter.html}, note=[Accessed: 23-March-2025
]}