MaxFilter

MaxFilter[data,r]

filters data by replacing every value by the maximum value in its range-r neighborhood.

MaxFilter[data,{r1,r2,}]

uses ri for filtering the ^(th)dimension in data.

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:
  • listarbitrary-rank numerical array
    tseriestemporal data such as TimeSeries, TemporalData,
    imagearbitrary Image or Image3D object
    audioan 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 all

Basic Examples  (3)

Maximum filter of a list:

Filter a TimeSeries:

Maximum filtering of a color image:

Scope  (12)

Data  (7)

Maximum filtering of a numeric vector:

Filtering a symbolic array:

Maximum filtering of a 2D array:

Maximum filtering of a list of Quantity objects:

Filter an Audio signal:

Filtering a 2D grayscale image:

Maximum filter of a 3D image:

Parameters  (5)

Specify one radius to be used in all directions:

Increasing the radius will result in brighter images:

Maximum filtering just in the first direction:

Filtering just in the second direction:

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

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

Applications  (4)

Remove pepper noise from an astronomical image:

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

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

Use maximum filtering to locate borders in an image:

Properties & Relations  (3)

Maximum filtering is the same as Dilation with a box structuring element:

Maximum filtering is the same as ImageFilter with function Max:

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

Introduced in 2008
 (7.0)
 |
Updated in 2015
 (10.2)
2016
 (11.0)