HarmonicMeanFilter

HarmonicMeanFilter[data,r]

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

HarmonicMeanFilter[data,{r1,r2,}]

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

Details

  • HarmonicMeanFilter is used to locally smooth data, particularly when extreme values are present, where the amount of smoothing is dependent on the value of r.
  • The function applied to each range-r neighborhood is HarmonicMean.
  • 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 and audio signals, HarmonicMeanFilter operates separately on each channel.
  • HarmonicMeanFilter[data,{r1,r2,}] computes the harmonic mean value in blocks centered on each sample.
  • HarmonicMeanFilter assumes the index coordinate system for lists and images.
  • At the data boundaries, HarmonicMeanFilter uses smaller neighborhoods.

Examples

open allclose all

Basic Examples  (3)

Harmonic mean filtering of a list:

Filter a TimeSeries:

Harmonic mean filtering applied to a color image:

Scope  (12)

Data  (8)

Apply a moving harmonic mean filter to a vector:

Harmonic mean filtering of a 2D array:

Filter a TimeSeries:

Filter a quantity array:

Filter an Audio signal:

Filtering a 2D grayscale image:

Harmonic mean filtering of a 3D volume:

Filter a symbolic array:

Parameters  (4)

Specify one radius to be used in all directions:

Increasing the radius will result in smoother images:

Harmonic mean filtering just in the first direction:

Second direction:

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

Filtering of the horizontal planes only:

Applications  (3)

Blur a grayscale image:

Use harmonic mean filtering if your data has outliers:

Reduce effect of outliers in an image:

Properties & Relations  (4)

The harmonic mean is the reciprocal of the mean of reciprocals of the given data:

For positive data, HarmonicMeanFilter[data,r]GeometricMeanFilter[data,r]MeanFilter[data,r]:

Harmonic mean filtering is the same as ArrayFilter with function HarmonicMean:

Harmonic mean filtering is the same as ImageFilter with function HarmonicMean:

Wolfram Research (2008), HarmonicMeanFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/HarmonicMeanFilter.html (updated 2016).

Text

Wolfram Research (2008), HarmonicMeanFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/HarmonicMeanFilter.html (updated 2016).

CMS

Wolfram Language. 2008. "HarmonicMeanFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/HarmonicMeanFilter.html.

APA

Wolfram Language. (2008). HarmonicMeanFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HarmonicMeanFilter.html

BibTeX

@misc{reference.wolfram_2024_harmonicmeanfilter, author="Wolfram Research", title="{HarmonicMeanFilter}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/HarmonicMeanFilter.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_harmonicmeanfilter, organization={Wolfram Research}, title={HarmonicMeanFilter}, year={2016}, url={https://reference.wolfram.com/language/ref/HarmonicMeanFilter.html}, note=[Accessed: 21-December-2024 ]}