An Adaptive Median Filter for Image Denoising