Page 1 of 1

Dehaze explained

Posted: November 22nd, 2019, 4:00 am
by tomczak
Jonathan, could you v. briefly explain how Dehaze works internally?

Re: Dehaze explained

Posted: November 22nd, 2019, 6:23 am
by jsachs

Re: Dehaze explained

Posted: December 6th, 2019, 3:51 pm
by tomczak
Is the 'Strength' slider what the authors call the 'scattering coefficient beta' in eq. 2? Thanks for the paper - not that important, just interesting.

Re: Dehaze explained

Posted: December 6th, 2019, 4:37 pm
by jsachs
Sorry, I don't remember all the details and I am working on something else right now.

I had a change to take a look at the code at strength does appear to be related to beta.

Re: Dehaze explained

Posted: February 26th, 2020, 12:09 am
by croos
What does dehaze do in practice, in not so technical terms? From the look of it it increases contrast and saturation. Is that it or is it more to it?

I just discovered this feature in darktable and now I realize it's also in the new PWP. It seems it can sort of work as a shortcut to enhance a photo that's a little washed out or to add a little zing to any photo if used with care, not only to remove actual haze. But I can't decide if it's any different from increasing local contrast and saturation "on my own".

Re: Dehaze explained

Posted: February 26th, 2020, 12:17 am
by priort
It can often shift the colors...easy to get way too heavy handed with it but it can deepen and really help those washed out photos...

Re: Dehaze explained

Posted: February 26th, 2020, 4:18 am
by tomczak
I read the paper that Jonathan linked to above, and it is complicated... The way I understand the method is this:

1) First, they use the combination of saturation and brightness of the image to figure out the 'depth-map' of the image - haze, being an atmospheric scattering phenomenon, is higher for the image element farther away from the camera.

2) Then, they figure out the brightest pixel(s) from the original image that are also farthest away (according to the 'depth map' above) - that's their pure haze.

3) Finally, they darken the image and probably correct for haze tint (i.e. remove haze), the degree of this darkening depending on a) the 'depth map' b) the brightness/tint of pure haze.

In PWP the colour of the haze is guessed automatically, but you can change it to your liking. The Strenght slider is related to the ability of the haze to scatter light - not all hazes are equal...