The elementary theory of mathematics morphology and its' application in detecting the edge of gray images are introduced. A new edge-detector is constructed. Though the experiments on the image blurred with Salt & Pepper Noises, compared to the traditional algorithms and the common morphological methods in edge detection, the algorithm has better results.