Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


filters image by replacing every value by the harmonic mean of the values in its range-r neighborhood.

applies harmonic mean filtering to an array of data.


  • HarmonicMeanFilter works with arbitrary-rank numerical arrays, regular and irregular time series, 2D and 3D images, and sampled sound objects, operating separately on each channel.
  • HarmonicMeanFilter[image,r] computes the harmonic mean of the values in blocks centered on each pixel.
  • At the edges of an image, HarmonicMeanFilter uses smaller neighborhoods.
  • HarmonicMeanFilter works with 3D as well as 2D images, and also with data arrays of any rank.
  • HarmonicMeanFilter[image,{rrow,rcol}] uses range rrow in height, and rcol in width.
  • HarmonicMeanFilter[image,{rslice,rrow,rcol}] uses range rslice in height, rrow in depth, and rcol in width.
  • HarmonicMeanFilter operates separately on each channel in an image.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Harmonic mean filtering applied to a three-channel image:

Click for copyable input

Applying a harmonic mean filter smoothens an image while preserving sharp transitions:

Click for copyable input

Apply a moving harmonic mean filter to a vector:

Click for copyable input
Introduced in 2008
| Updated in 2015