The median filter has gained recognition as a filter that will edit impulses and retain edges. Order statistic (OS) filters such as the a-trimmed mean have also proven useful in providing smothers that also eliminate impulses. At first implementation was slow, but due to the introduction of the stack filter may now be implemented in real time. These filters have been extended to the generalized order statistic filters (GOS) which include the least median of squares (LMS) filter. The LMS filter averages the N+1 closest grouped (algebraic range) values in a window of size 2N+1 . We show the LMS eliminates impulses and preserves "perfect" edges exactly as the median. In addition the LMS is shown to enhance "nonperfect" edges.
Harold G. Longbotham,
"LMS: an adaptive optimal order statistic filter", Proc. SPIE 1247, Nonlinear Image Processing, (1 July 1990); doi: 10.1117/12.19599; https://doi.org/10.1117/12.19599