Update (More of a discussion, really.)
Transmission
Been working on morphology as it relates to transmission. The challenge of any dehaze tool is to generate a transmission (or depth) map that accurately removes the right amount of haze in the right places. This isn’t easy to achieve even now.
I discovered that reading other papers didn’t help me all that much and that it was better to stick with my own R&D. The main issue that I have been trying to overcome has been haloing and fine detail. The original He paper brought simplicity together with efficiency but it lacks in accuracy. I find that most papers since then have that shortcoming as well to a certain extent.
Since the writing of the original copy of afre_dehaze
, I have been investigating ways to come up with a more accurate transmission map. The original had a halo and edge issue that stems from the guided filter that is required to refine the edges of a crude morphology. Earlier editions of the paper demonstrated the use of a Laplacian matrix to optimize the map but it is too complex in terms of math and code for me to unravel. Also the Laplacian soft matting method is too operation intensive to be of any practical use for the filter.
Haloing and edging is not the only issue. There is also the question of detail and differentiation. A simple example where haloing, edging, detail and differentiation are all at play is the bicycle. A bicycle has spokes and sometimes a mesh basket. The original method is unable to dehaze the areas between the metal strands as it does for other background areas. Another example would be tree canopies, where even more types of light related problems exist, many of which are outside of the scope of this filter.
More control over atmospheric light
The #2 problem that I am dealing with is the decoupling of atmospheric light estimation from transmission estimation. Both are interrelated and work in tandem to remove the haze. However, this presents a trade off that is undesirable and unfriendly to the end user of the filter. You can read about the trade offs of patch radius in post #12.
I don’t think I will be able to separate the two completely because I found that any inefficiency in the dehaze method usually results in the failure to dehaze effectively. You can see that in the torino.jpg example in the previous post. Even a couple of changes in the code and method can drastically and irreversibly (because I only keep a few copies of my older code; that is probably why I should do versioning ) change how effective it is.
Other remarks
Anyway, in another life, I would have been a paid scientist, engineer and / or prof of some sort, but life sucks big time. However, at least I can have my fun on this forum. Keep sending more samples and thoughts my way. I love wholesome feedback and banter.