With the rapid development of technology, computer technology is gradually maturing. In the computer vision field, image processing technology in specific weather has become an important research field. For those photos taken in foggy weather, the mist will affect natural light leading to a certain impact on the visual effect making pictures seem unclear. Additionally, the useful information in the pictures will decrease. To solve the image blurring problem caused by natural weather such as haze, this paper adopts the histogram equalization method. By averaging the gray histogram of the image, the blurred areas are magnified and dispersed, and a clear state is visually presented. The retinex algorithm is used to process the histogram equalization result image to enhance the useful image information and further process the result details to defog the image and obtain the final defogged image.