Median filter (source code)

= Median filter
{wiki=Median_filter}

A median filter is a non-linear digital filtering technique commonly used in image processing to reduce noise while preserving edges. It operates by moving a window (or kernel) over the image and replacing the value of each pixel with the median value of the pixels in the surrounding neighborhood defined by the window.