This article was automatically translated from the original Turkish version.
Fog is a common issue in outdoor photographs. Dust, moisture, and other particles in the atmosphere reduce contrast and color accuracy in images by scattering and absorbing light. This condition particularly causes loss of detail in objects at distant locations. While traditional methods require multiple images or additional hardware, single-image fog removal techniques offer an innovative approach to solving this problem.
The Dark Channel Prior (DCP) algorithm was initially developed by Kaiming He and his team to recover clear images from hazy ones.
DCP is based on a statistical observation made in non-foggy outdoor images. He and colleagues (2009) found through analysis of over 5,000 non-foggy images that, except for bright areas such as the sky, most local patches contain at least one color channel (red, green, or blue) with very low pixel intensity. This low intensity typically arises from shadows, dark-colored objects, or non-reflective surfaces. Mathematically, the dark channel is defined as:
Here, J(x) represents the haze-free image, c denotes the color channels (R, G, B), and Ω(x) is the local patch centered at x. In hazy images, this dark channel intensity is increased by atmospheric light, and this increase is used to estimate fog density.
The formation of hazy images is based on the atmospheric scattering model, expressed by the following formula:
The transmission map is calculated using the formula t(x) = e^(-β d(x)), where β is the scattering coefficient and d(x) is the scene depth. As fog density increases, t(x) decreases, leading to loss of contrast in the image. The Dark Channel Prior algorithm aims to invert this model to recover J(x).
The original algorithm developed by He and colleagues (2009) performs fog removal in five key steps.
Atmospheric light (A) is typically estimated from the brightest region of the image. He and his team select the brightest 0.1% of pixels in the dark channel and compute their average to determine A. This method provides a more robust result than simply selecting the absolute brightest pixel, as it reduces errors caused by noise or bright objects.
The image is divided into local patches (e.g., 15x15 pixels). For each patch, the minimum intensity across each color channel is found, and the lowest among these minima is selected as the dark channel:
This operation is efficiently implemented using Marcel van Herk’s fast minimum filter, and the computational complexity scales linearly with image size.
Using the dark channel, the transmission map is calculated as follows:
Here, ω is a parameter controlling the amount of fog and is typically set to 0.95. This value preserves a slight residual fog to maintain a natural appearance rather than completely removing all haze.
The initially estimated transmission map is often noisy and has blurred edges. Therefore, it is refined using techniques such as soft matting or guided filtering. Soft matting minimizes the following cost function:
Here, L is the Laplacian matrix and λ is a regularization parameter (e.g., 10^-4). This step reduces noise while preserving edges.
In the final step, the clear image is recovered from the hazy image using the following formula:
Here, t_0 (e.g., 0.1) is a lower bound used to prevent division by zero. This formula reverses the haze effect to produce a clear image.
The Dark Channel Prior algorithm delivers impressive results in fog removal from a single image and requires no additional hardware. However, it has several limitations:
The Dark Channel Prior algorithm can be applied in various fields:
Sample Output:

class=\

class=\
He, K., Sun, J., & Tang, X. (2010). Single image haze removal using dark channel prior. IEEE transactions on pattern analysis and machine intelligence, 33(12), 2341-2353.
He, K., Sun, J., & Tang, X. (2010). Single image haze removal using dark channel prior. IEEE transactions on pattern analysis and machine intelligence, 33(12), 2341-2353.
Lee, S., Yun, S., Nam, J. H., Won, C. S., & Jung, S. W. (2016). A review on dark channel prior based image dehazing algorithms. EURASIP Journal on Image and Video Processing, 2016, 1-23.
Liang, Q., Zhu, B., & Ngo, C. W. (2021). Pyramid fusion dark channel prior for single image dehazing. arXiv preprint arXiv:2105.10192.
Pan, J., Sun, D., Pfister, H., & Yang, M. H. (2016). Blind image deblurring using dark channel prior. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 1628-1636).
Zhou, X., Bai, L., & Wang, C. (2017). Single image dehazing algorithm based on dark channel prior and Inverse Image.

No Discussion Added Yet
Start discussion for "Dark Channel Prior Algorithm" article
Dark Channel Prior (DCP)
Fog Model and Mathematical Foundation
Steps of the Original Dark Channel Prior Algorithm
1- Estimation of Atmospheric Light
2- Calculation of the Dark Channel
3- Initial Estimation of the Transmission Map
4- Refinement of the Transmission Map
5- Recovery of the Clear Image
Advantages and Limitations of the Algorithm
Application Areas
DCP Algorithm Implementation Code