This paper presents a comprehensive and practical method for a window-cleaning robot to detect and recognize obstacles. A sample image is decomposed firstly using wavelet method and its lower frequency histogram is obtained. Then, analyzing the histogram using wavelet gets the thresholds of the fuzzy image. Defining new membership functions according to these thresholds, the sample image is transformed into a fuzzy image and enhanced. At last, the enhanced fuzzy image is transformed back into a enhanced sample image, on which border detecting and recognizing are carried out. Experiments prove the method is more real-time and available.