Alberto, we end up with the same troubles,(u less than me)
on the first plane, retinex regive us info from the shadows, if u look at the trees on the right u will notice, that we got a “bitmap” effect, we have reduced the mist but at an really high tradeoff for.
and as retinex is aimed to work a bit as lightness of human vision, something is wrong.
in my ignorance i think could be something i do not understand on how allow retinex mask correctly the image…
eg an interesting article (i do not understand the math but i’m watching the images 
http://www.cs.huji.ac.il/~raananf/projects/dehaze_cl/results/index_comp_noise.html
or maybe i’m trying to use the wrong tool at all and retinex would work for regain info from shadow, but is not correct to get the rid of fog, and i’ve misunderstood the tool at all, but here they talk about retinex for dehazing
http://www.programering.com/a/MjM5cjNwATc.html
so i get lost how to use it in rt i got a tool but do not understand how to use it 