Dehazing using color-lines
While reading a review of dehazing algorithms by Li at al [1], I was surprised to see that all deep learning methods were being outperformed by a classical computer vision algorithm. This algorithm was described in a paper called Dehazing using color-lines [2]. The takeaway from this work is that small image patches generally form color-lines in color space. When an image contains air-light, i.e., when the image is hazy, this color-line does not intersect with the origin. Realigning the color-line to make it intersect the origin, therefore, removes the haze.
After looking through Github, I found two implementations of the algorithm. Unfortunately, they were both poorly documented and difficult to use. Therefore I decided to create my own implementation.
Implementation features:
- Concisely implemented in 300 lines of code, which is 40% shorter than implementation A (500 SLOC) and 70% shorter than B (1000 SLOC).
- Extremely low cyclomatic complexity (2.35 on average).
- Methods are documented and refer to the part of the paper they implement.
- 4 experiment notebooks, each testing a part of the algorithm and its underlying assumptions.
- Supports both linear interpolation and the Markov random field smoothing described in the paper.
[1] Yu Li et al. - Haze Visibility Enhancement: A Survey and Quantitative Benchmarking
[2] Raanan Fattal - Dehazing using Color-Lines