Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.76k stars 313 forks source link

Retinex (Haze removal) #2833

Closed Beep6581 closed 5 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 2853

This PDF outlines a method of haze removal I don't think is current possible in RawTherapee.
Have any of you tried it? Is it useful in practice?
http://research.microsoft.com/en-us/um/people/jiansun/papers/dehaze_cvpr2009.pdf

Reported by entertheyoni on 2015-07-24 22:32:05

Beep6581 commented 9 years ago
Search keywords: Single Image Haze Removal Using Dark Channel Prior

Reported by entertheyoni on 2015-07-24 22:32:41

Beep6581 commented 9 years ago
I'll test something with wavelet, I is different from Farral...

I will probably inspire me the principles of :
http://www.mcs.csueastbay.edu/~grewe/pubs/DistSensorNetworkBook2011/Atmosphere/HazeREmoval_SingleImage_Luminance.pdf

I don't guaranty it will work !!

but :
1) I am recovering from emergency surgery
2) my family is at home for holidays
3) my computer gives worrying signs of probable failure
4) !!!

:)

Reported by jdesmis on 2015-08-08 06:53:30

Beep6581 commented 9 years ago
Jaqcues, first and foremost, get well and recover from your operation. 
I hope you get back on your feet safely! 

Reported by johan@birkagatan.com on 2015-08-08 11:09:39

Beep6581 commented 9 years ago
Johan

Thank you very much :)

Reported by jdesmis on 2015-08-08 11:16:48

Beep6581 commented 9 years ago
Jacques, wishing you a speedy recovery and strong health:) Take it slow, get as much
rest as your body needs:)

Reported by michaelezra000 on 2015-08-09 18:50:05

Beep6581 commented 9 years ago
Jacques, get well! Meanwhile, if there are Issues reported in some of your stuff (which
I know mostly pretty well) I'll take a look and help out in case fixes are needed.
So don't care about possible bugs. Recover and relax!

Ingo

Reported by heckflosse@i-weyrich.de on 2015-08-09 19:17:12

Desmis commented 9 years ago

Here a first patch - not optimize...probably with bug and segfault...

I have add this functionnality in "Lab adjustements"...which is necessary (L curve, CC curve)...You can also use Wavelet to increase local contrast.

Desmis commented 9 years ago

How can I join a patch ??

heckflosse commented 9 years ago

Hi Jacques,

I create patches this way:

1.) create a new branch (I do that with GitHub for Windows) 2.) commit the new branch git commit -m "First patch for Haze Removal" -a 4.) create a pull request. I use GitHub for Windows to create pull requests.

Ingo

Desmis commented 9 years ago

Sorry but I don't realy understand...

Is it necessary to create a branch, commit and so on...

If so, do you do? and did I right?

I think it is very complex...to do simple things...

And if it continues to be as complex ... I think I'll stop the project ..

Thank you;

Jacques

2015-08-16 12:57 GMT+02:00 heckflosse notifications@github.com:

Hi Jacques,

I create patches this way:

1.) create a new branch (I do that with GitHub for Windows) 2.) commit the new branch git commit -m "First patch for Haze Removal" -a 4.) create a pull request. I use GitHub for Windows to create pull requests.

Ingo

— Reply to this email directly or view it on GitHub https://github.com/Beep6581/RawTherapee/issues/2833#issuecomment-131524276 .

Jacques Desmis 407 rue Gustave Bret - Le Lagon Bleu 83600 Fréjus tel : 0483125966 http://jacques.desmis.perso.neuf.fr/

heckflosse commented 9 years ago

Jacques, I also had get used to it. Now I think it's easier than mercurial As you can see I already created 2 branches (dualIso and icctiffcrash) and created pull requests. Don't desperate. We'll help you with git

Ingo

Desmis commented 9 years ago

I use GitHub Shell

When I want to commit, Git said me... _*Please tell me who you are _Git config --global user.mail "you@example.com" ** Git config --gloabl user.name "Your name"

I tried with my email and my name...and Git said "tell me who you are!!"

Desmis commented 9 years ago

I progress slowly...but I don't understand what I do...for me it is chineese... I have: a) git config --global user.name "Desmis" b) git config --global user.email jdesmis@gmail.com 1) git branch dehaze

2) git commit -m "Dehaze" -a

==>say me : Your barnch is up-to-date with 'origin/master' 3) git push

Now I have the message : Permission to Beep6581/Rawtherapee.git denied to Desmis Please make sure you have the correct access rights... Where I can verify ?? Where i can change permissions ?

Hombre57 commented 9 years ago

Jacques, je suis moi-même en phase d'apprentissage de Git et GitHub avec Ingo. Dès que nous maîtriserons mieux cet outil, on te fera part de nos trouvailles, évitant de t'induire en erreur. En attendant, y'a la plage pas loin je crois, ou fais tes recherches de ton côté si tu veux.

heckflosse commented 9 years ago

Jacques, I guess DrSlony has to change your permissions first.

Desmis commented 9 years ago

Donc je mets tout entre parenthèses...mais pour moi, pas de plage, pas de piscine, pas de sport, pas de marche...après l'opération en urgence.. Donc wait and see... Car cela me semble très compliqué...pour un patch d'ouvrir une "branch"... D'autre part quoique je fasse j'ai toujours des droits "denied"...malgré toutes mes tentatives.

Celui qui me dit que GIt est intuitif !!! Lorsqu'on lit la doc....on débute par l'accessoire...en passant à côté de l'essentiel...Comment démarrer ?

En tous cas merci...

Hombre57 commented 9 years ago

Je suis bien d'accord, git est un sac de noeud, ou plus précisément plusieurs sac de billes que l'on peut passer de sac en sac, d'après ce que j'ai compris pour le moment.

Te souhaitant un prompt rétablissement (et en espérant que tu n'ai plus à retourner aux urgences..)...

Desmis commented 9 years ago

merci... c'était un poil plus que les urgences....bloc opératoire + chirurgiens pour moi tout seul - VIP - le dimanche...

Hombre57 commented 9 years ago

Ils n'ont pas voulu de toi là haut ? :) (je sais, c'est de mauvais goût) En tout cas, on est bien content que tu sois encore là !

Desmis commented 9 years ago

Oh j'ai failli y passer...et cela peut arriver à tout le monde...de 3 mois à 99 ans...comme m'a dit le chirurgien Une hernie inguinale qui a bloqué la vessie et l'intestin...J'ai rendu tripes et boyaux, ch.. tripes et boyaux pendant plusieurs jours - avant - après - l'opération.

Depuis 3 jours tout est redevenu "normal"

merci encore

jacques

2015-08-16 16:00 GMT+02:00 Jean-Christophe notifications@github.com:

Ils n'ont pas voulu de toi là haut ? :) (je sais, c'est de mauvais goût) En tout cas, on est bien content que tu sois encore là !

— Reply to this email directly or view it on GitHub https://github.com/Beep6581/RawTherapee/issues/2833#issuecomment-131554041 .

Jacques Desmis 407 rue Gustave Bret - Le Lagon Bleu 83600 Fréjus tel : 0483125966 http://jacques.desmis.perso.neuf.fr/

Beep6581 commented 9 years ago

Hello

I was away, now I'm back and I added you to the "collaborators". If you still have a problem, please see the "github" topic in RT-OSMC on google groups, I had to add a SSH key to identify with github.

Desmis commented 9 years ago

I think I'm becoming completely crazy ... Is my computer kidding ... or me. But the patch that I saved ... I am unable to restore ...

with: git apply dehaz.patch after: git reset HEAD --hard I get the message "unrecognized input"... I tried many things...but all fails...

It's 6:00 I try all orders ... nothing works properly ... it's completely discouraging

do I have to change my computer? What am I doing wrong?

Desmis commented 9 years ago

If I want to apply my patch..the only way..is to start all over again

heckflosse commented 9 years ago

Jacques, can you attach the patch please or upload it to filebin.net and post the link ? I'll take a look then. Maybe DrSlony can help too.

Ingo

Desmis commented 9 years ago

My patch..is now completly destroyed... :)

Desmis commented 9 years ago

I'll reconstruct manually...much time !!

I don't know why !! but it is completly discouraging... More of 12 hours...and nothing..nothing..only bugs...

heckflosse commented 9 years ago

Jacques, do you mean you don't have the .patch file anymore?

Beep6581 commented 9 years ago

Jacques if you have the .patch file, in any shape or form, please upload it to filebin.net and let me help you find out the problem. Don't reconstruct it manually - I'm confident that I can help!

If you don't have the .patch file but you do have the modified files in some repository, type "git status" so we'll get a picture of what's going on.

Desmis commented 9 years ago

I reconstruct...all..

I'll send a patch...when I think...it is working :)

But I think...all my repos are broken...

:)

2015-08-17 15:46 GMT+02:00 Beep6581 notifications@github.com:

Jacques if you have the .patch file, in any shape or form, please upload it to filebin.net and let me help you find out the problem. Don't reconstruct it manually - I'm confident that I can help!

If you don't have the .patch file but you do have the modified files in some repository, type "git status" so we'll get a picture of what's going on.

— Reply to this email directly or view it on GitHub https://github.com/Beep6581/RawTherapee/issues/2833#issuecomment-131821946 .

Jacques Desmis 407 rue Gustave Bret - Le Lagon Bleu 83600 Fréjus tel : 0483125966 http://jacques.desmis.perso.neuf.fr/

Desmis commented 9 years ago

But sure this is not the patch causes this...but other things...:

It is very very very frustrating...Nothing works !!

Desmis commented 9 years ago

Ingo I send you by mail dehaze.patch

Not optimized...but problem is not here, but with Git !!

Thank you

Jacques

heckflosse commented 9 years ago

I created a new branch 'DeHaze' which contains Jacques' patch : https://github.com/Beep6581/RawTherapee/tree/DeHaze

Desmis commented 9 years ago

Thank you Ingo... Now it's work...

I join a link to test ! I don't say, this pp3 is good but it shows how to

http://filebin.net/k6f53dm6ue

michaelezra commented 9 years ago

HI Jacques, I opened a random test image, applied neutral profile then set dehaze to low, high, uniform and nothing changed. Am I missing any step?

michaelezra commented 9 years ago

Interesting, the sample you shared works.. but I can't recreate it from scratch. when starting from neutral profile I can't get dehaze to apply any changes to the image

Desmis commented 9 years ago

Hello Michael

Yes there was a big bug in GUI...I will solve it... But I continue to improve code..

Desmis commented 9 years ago

Is somebody could explain, how Git works ? And not say me "use xxx" or "Use yyy"...or "use eclipse"

I think I am realy too stupid...

I tried many many things...not working

eg: I have clone "RTGIT5" ==> repo-rt

Now, How to do to revert / Reset...I tried...many things (in the doc) But cannot realy cancel

2) How can we do, with DeHaze, if files in master have changed ?

3) How to do a patch that work...For me and when I read doc..it is the way...as with "Google code". I can bilr a patch...but despite all precautions (LF, whitespace...) impossible to "apply"

Thank you

Hombre57 commented 9 years ago

http://noirbizarre.info/2010/12/06/git-lessentiel/ http://fr.slideshare.net/jbvigneron/atelier-git-github-et-git-dans-visual-studio The last tutorial contains snapshots from here : http://nvie.com/posts/a-successful-git-branching-model/ which is a "must read" for every one, and possibly a "must follow" too.

Beep6581 commented 9 years ago

Will the Dehaze tool have an accurate preview at <100% zoom?

Desmis commented 9 years ago

As I say...I have a huge problem with RT pipeline... With Dcrop wust me use "full image" and here it is not case...==> delta color, delta luminance

To solve: Dcrop with full image :)

michaelezra commented 9 years ago

Could Dcrop use a low resolution version of the full image?

Desmis commented 9 years ago

I'll test to move (as proposed by mail by Ingo) Dehaze at the beginning of pocess.

I'll be away for one or 2 days

Desmis commented 9 years ago

I want to commit and push...but Git said me "Changed no staged for commit"

What does I do, with my repo ??

Beep6581 commented 9 years ago

Please show the command you used.

'git status' will show you which files are modified. You need to add the modified files to your commit, -a adds all modified files, so 'git commit -m "bla bla" -a'

Desmis commented 9 years ago

I have only declared, my config...and now it's work

Beep6581 commented 9 years ago

The effect is good, and the output perfectly matches the preview. I love it!

One problem: the DeHaze widgets don't respond to change. I must reload the image (or force it to re-demosaic) for the changes to take effect. SETM/vertical tabs.

Desmis commented 9 years ago

Beep6581 thank you for testing, 1) for me no problem with Dehaze widgets...all works fine

2) but, for me this algoritm (Retinex) give strong artifacts... Look at image "Madeira05.08;2005_10-21-33.dng"...at the right of image; there are big halos.. If I use wavelet, I obtain a better image... I will look to improve algorithm !

heckflosse commented 9 years ago

Jacques, in current DeHaze implementation we use gauss with very high sigma. There is a switch in gauss function which switches to non SSE double version of gauss when sigma > 70. I can see a big difference between Neighboring pixels 36 (sigma = 71) and Neighboring pixels 35 (sigma = 69) when method is high. Maybe this is related to the halos you mention.

Ingo

Desmis commented 9 years ago

Effectively, very high sigma, but it is the original algorithm...and if no changes there are halos with this image in all case, when you use "Dehaze"

I push a change with only change range of settings : variance gain *offset

I put a link I think a good compromize, using Dehaze and Wavelet for "Madeira...dng" http://jacques.desmis.perso.neuf.fr/RT/Madeira05.08.2005_10-21-33.dehaz-wavedng.pp3 I hope you have the image "Madeira..." which is a good test for Dehaze

heckflosse commented 9 years ago

Jacques, did you read this http://www.sersc.org/journals/IJHIT/vol7_no4_2014/30.pdf ?