Edge detection is an important method of image processing.In this paper a new method that auto selects thresholds of the image based on gray gradient of the image edge is applied on the processing of images. It is proved by practice that the results of this method is obviously practice that the results of this method is obviously better than other traditional edge detection methods.