Bayesian Defogging

Kyoto University Computer Vision Lab

On this page, you will find a software package for defogging single foggy or hazy images. Defogging is accomplished via a factorization of images into albedo and depth layers. Estimation of these layers is achieved using a Bayesian formulation that places statistical priors on the albedo and depth images. More information on the theoretical foundations of the process, as well as implementation details, may be found in the following publications and technical reports:

  • Bayesian Defogging
    K. Nishino, L. Kratz, and S. Lombardi, in Int’l Journal of Computer Vision, vol. 98, no. 3, pp263-278, Jul., 2012.
    [ paper ][ Springer ] [ errata ][ code ]

  • Factorizing Scene Albedo and Depth from a Single Foggy Image
    L. Kratz and K. Nishino, in Proc. of IEEE Twelfth International Conference on Computer Vision ICCV’09, pp1701-1708, Oct., 2009.
    [ paper ][ code ]

  • An Implementation of Bayesian Defogging
    G. Schwartz and K. Nishino,
    Technical Report DU-CS-13-02, Department of Computer Science, Drexel University
    [ paper ]

Please cite these references in your paper when this software is used in your research.

In [Kratz and Nishino 2009], we introduced the use of an initial depth estimate obtained from a simple upper bound on the depth values. This was derived independent of the “Dark Channel Prior” without any knowledge of it (our paper deadline was before its publication). Our method is significantly different from the dark channel prior in that ours is an initial estimate and, most important, a per-pixel estimate. We hope this clarifies any confusion.

About the Software

The executable defog.py will perform the defogging process on a given input image. Users may select a region of pixels to specify the airlight color, or provide a specific color obtained from any other airlight estimation algorithm. Please see the included README for more information and detailed instructions on usage.

Please note that this is research code and may contain bugs or other issues. If you experience major problems with it, you may email us, but we may not have the resources to deal with all issues.

Dependencies

The software is written in Python (supports 2.7+ and 3.2+) and depends on the following libraries:

Optional dependencies, for GPU code generation:

Note that Theano and OpenCV currently support Python 3.x in the master branches of their repositories but not in any released version. If you wish to use the code with Python 3.x, please build them from source.

Download

The software package may be found here.

Sample Results (parameters)

Input
Albedo
Inverse Depth