An improved mean-valued method of adaptive median filter