Median Filter

Median filter operation

For each pixel of the image, a median value of the neighbor pixels is computed. The number of neighbors depends on the requested Kernel Size. This can be seen as a sliding window around each pixel, the default being 3x3 pixels wide, so one pixel around each considered pixel in all directions.

The median value is then used to modify the value of the original image's pixel value, either by replacing it if the Modulation is equal to 1, or blending it with the original image if it is between 0 and 1. A value of 0 in the Modulation will only use the original pixel value.

Calling the median filter multiple times will tend to a convergence point where it doesn't change the pixel values anymore. If this is the wanted outcome, change the Iterations number to avoid running it multiple times manually.

Use of the filter

This filter can be used to reduce noise in an image, at the expense of losing some resolution in the useful signal.