The Median filter takes the nine values in a 3x3 box centered on each pixel and arranges the values in ascending order. It then takes the difference between the 8th highest value and the 2nd highest value which it compares to the difference between the center pixel value and the 5th highest value (the median). If the second difference is greater than the first difference, the center pixel value is replaced with the median value. JIMSAIP uses the absolute value of the differences so that cold pixels are replaced as well as hot ones.
| Original | Median Filtered |
|---|---|
|
![]()
|
Sometimes it is better to run the Median filter more than once to really clean up an image.