To overcome the drawback that median filtering algorithm often get rid of fringe details of image while filtering noise,the adaptive median filtering algorithm based on noise detection is proposed in this paper.The algorithm applys the two stages method to detect noise.First,the algorithm determines a pixel point as signal pixel or possible noise pixel according to the characteristic of salt and pepper noise.Second,according to the difference between salt and pepper noise and fringe details,each possible noise pixel is classified to be noise pixel or fringe details.Finally,the algorithm employs adaptive median filtering to remove the noise pixels,while the signal pixels and fringe detail pixels are kept untouched in the filtering process to preserve the detail of image.Simulation results demonstrate that this algorithm is better than traditional median-based filters in performance of filtering noise and detail preservation.