Skip to main content

Contraharmonic Mean Filter

Command

Image
Filters
Contraharmonic Mean Filter

Description

Applies a contraharmonic mean filter to an image.

With a contraharmonic mean filter, the color value of each pixel is replaced with the contraharmonic mean of color values of the pixels in a surrounding region.

The contraharmonic mean with order Q is defined as:

Contraharmonic mean

A contraharmonic mean filter reduces or virtually eliminates the effects of salt-and-pepper noise. For positive values of Q, the filter eliminates pepper noise. For negative values of Q it eliminates salt noise. It cannot do both simultaneously.

Note that the contraharmonic filter is simply the arithmetic mean filter if Q = 0, and the harmonic mean filter if Q = −1.

A larger region (filter size) yields a stronger filter effect with the drawback of some blurring.

Dialog box

Contraharmonic Mean Filter dialog box

Filter Size: larger filter yields stronger effect.

Order: the order Q of the filter.

Click Preview to judge the results.

Click OK to proceed.

Examples

Before: After (Q=1): After (Q=-1):
Effect of Contraharmonic Mean Filter (Q=1) Effect of Contraharmonic Mean Filter (Q=-1)
Effect of Contraharmonic Mean Filter (Q=1)border:1px solid black Effect of Contraharmonic Mean Filter (Q=-1)border:1px solid black
Effect of Contraharmonic Mean Filter (Q=1) Effect of Contraharmonic Mean Filter (Q=-1)

See also

Share on Facebook Share on Twitter