Tri-state median filter for image denoising

In this work, a novel nonlinear filter, called tri-state median (TSM) filter, is proposed for preserving image details while effectively suppressing impulse noise. We incorporate the standard median (SM) filter and the center weighted median (CWM) filter into a noise detection framework to determine whether a pixel is corrupted, before applying filtering unconditionally. Extensive simulation results demonstrate that the proposed filter consistently outperforms other median filters by balancing the tradeoff between noise reduction and detail preservation.