This paper presents an automatic method for the defogging process from a single haze image. To recover a foggy image, an accurate depth map is estimated from a multi-level estimation method, which fuses depth maps with different sizes of patches by dark channel prior. Markov random field (MRF) is applied to label the depth level in adjacent region for the compensation of wrong estimated regions. The accurate estimation of scene depth provides good restoration with respect to visibility and contrast but without oversaturating. The algorithm is verified by a handful of foggy and hazy images. Experimental results demonstrate that the defogging method can recover high-quality images through accurate estimation of depth map.