In order to achieve very good salt and pepper noise cancellation as well as preserving image details
a novel non-linear adaptive algorithm is proposed in this paper. The algorithm is developed by the following main steps. Firstly
pixels with maximum and minimum gray value in filtering window are excluded. Then
mean of the left pixels in filtering window is obtained. Then
difference of the mean and gray value of the corresponding pixel is calculated. Finally
the difference is compared to threshold to decide how to get gray value of output pixel
i.e.
if the difference is larger than the threshold
the filtered output of the pixel is the mean
else the filtered output of the pixel is not changed. The threshold is adaptively chosen according distribution of image intensity. The results compared with other published algorithms show that the proposed algorithm can remove almost all the salt and pepper noise pixels while preserve image details very well. Even if the image is highly corrupted
it can still work properly and provide significant improvement over the conventional median filter.