From 960c57dd7cfdf2cadad9f2cafb83965c5c46d07a Mon Sep 17 00:00:00 2001 From: Desmis Date: Mon, 23 Sep 2019 06:49:29 +0200 Subject: [PATCH] Changes to GUI dehaze Retinex --- rtdata/languages/default | 10 ++++++---- rtengine/procparams.cc | 6 +++--- rtgui/locallab.cc | 23 +++++++++++++++++------ rtgui/locallab.h | 2 ++ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 65cf23d5e..7b4997b70 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -2102,9 +2102,9 @@ TP_LOCALLAB_DARKRETI;Darkness TP_LOCALLAB_LIGHTRETI;Lightness TP_LOCALLAB_THRESRETI;Threshold TP_LOCALLAB_DENOIS;Denoise -TP_LOCALLAB_DEHAZ;Strength Dehaze -TP_LOCALLAB_DEPTH;Dehaze depth -TP_LOCALLAB_LUMONLY;Dehaze Luminance only +TP_LOCALLAB_DEHAZ;Strength +TP_LOCALLAB_DEPTH;Depth +TP_LOCALLAB_LUMONLY;Luminance only TP_LOCALLAB_EXPMETHOD_TOOLTIP;Standard : use an algorithm similar as main Exposure but in L*a*b* and taking account of deltaE.\n\nLaplacian & PDE : use another algorithm also with deltaE and with Poisson equation to solve Laplacian in Fourier space.\nPDE Ipol, PDE Fattal and Standard can be combined.\nFFTW Fourier Transform is optimized in size to reduce processing time.\nPDE reduce artifacts and noise. TP_LOCALLAB_PDEFRAME_TOOLTIP;PDE Ipol - personal algorithm adapted from Ipol to Rawtherapee: lead to very different results and needs differents settings that Standard (negative black, gamma < 1,...)\nMay be usefull for low exposure.\n TP_LOCALLAB_FATFRAME_TOOLTIP;PDE Fattal - use Fattal Tone mapping algorithm.\nAnchor allows selection according to the images over or under exposed.\nUseful to increase Luminance for a Second spot near the current and using mask @@ -2195,6 +2195,8 @@ TP_LOCALLAB_RADIUS;Radius TP_LOCALLAB_RADMASKCOL;Radius TP_LOCALLAB_RESID;Residual Image TP_LOCALLAB_CONTRESID;Contrast +TP_LOCALLAB_DEHAFRA;Dehaze +TP_LOCALLAB_RETIFRA;Retinex TP_LOCALLAB_RETI;Dehaze - Retinex Strong local contrast TP_LOCALLAB_RETI_NEIGH_VART_TOOLTIP;Adapt these values according to images - if misty images and depending on whether you want to act on the front or the background TP_LOCALLAB_LC_FFTW_TOOLTIP;FFT improve quality and allow big radius.\nThe treatment time depends on the surface to be treated.\nTo be used preferably for large radius.\n\nDimensions can be reduced by a few pixels to optimize FFTW. @@ -2211,7 +2213,7 @@ TP_LOCALLAB_SHOWDCT;Show process Fourier TP_LOCALLAB_SHOWMASKSOFT_TOOLTIP;Show process Fourier:\nShows the different stages of the process.\nLaplace - builds the second derivative according to the threshold (first step).\nFourier -shows the transformed Laplacian with DCT.\nPoisson - show solution of Poisson DCE.\nNormalize - show result whithout normalization luminance. TP_LOCALLAB_SHOWNORMAL;Normalize luminance (no) TP_LOCALLAB_TM;Tone Mapping -TP_LOCALLAB_STR;Strength Retinex +TP_LOCALLAB_STR;Strength TP_LOCALLAB_LOGLIN;Logarithm mode TP_LOCALLAB_STRRETI_TOOLTIP;if Strength Retinex < 0.2 only Dehaze is enabled.\nif Strength Retinex >= 0.1 Dehaze is in luminance mode. TP_LOCALLAB_NEIGH;Radius diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 79f6a8297..84fdf9ee3 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2580,8 +2580,8 @@ LocallabParams::LocallabSpot::LocallabSpot() : retinexMethod("high"), str(0.0), chrrt(0.0), - neigh(40.0), - vart(100.0), + neigh(50.0), + vart(150.0), dehaz(0), depth(25), sensih(30), @@ -2601,7 +2601,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : chromaskreti(0.0), gammaskreti(1.0), slomaskreti(0.0), - scalereti(2.0), + scalereti(3.0), darkness(2.0), lightnessreti(1.0), limd(8.0), diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 06c45f163..70af1fa18 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -267,8 +267,8 @@ Locallab::Locallab(): // Retinex str(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STR"), 0., 100., 0.1, 0.0))), chrrt(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHRRT"), 0.0, 100.0, 0.1, 0.0))), - neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), MINNEIGH, MAXNEIGH, 0.5, 40., nullptr, nullptr, &retiSlider2neigh, &retiNeigh2Slider))), - vart(Gtk::manage(new Adjuster(M("TP_LOCALLAB_VART"), 0.1, 500., 0.1, 100.))), + neigh(Gtk::manage(new Adjuster(M("TP_LOCALLAB_NEIGH"), MINNEIGH, MAXNEIGH, 0.5, 50., nullptr, nullptr, &retiSlider2neigh, &retiNeigh2Slider))), + vart(Gtk::manage(new Adjuster(M("TP_LOCALLAB_VART"), 0.1, 500., 0.1, 150.))), dehaz(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DEHAZ"), 0, 100, 1, 0))), depth(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DEPTH"), 0, 100, 1, 25))), sensih(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIH"), 0, 100, 1, 30))), @@ -278,7 +278,7 @@ Locallab::Locallab(): chromaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CHROMASKCOL"), -100.0, 100.0, 0.1, 0.))), gammaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_GAMMASKCOL"), 0.05, 5.0, 0.01, 1.))), slomaskreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SLOMASKCOL"), 0.0, 15.0, 0.1, 0.))), - scalereti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALERETI"), 1.0, 10.0, 1., 2.))), + scalereti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALERETI"), 1.0, 10.0, 1., 3.))), darkness(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DARKRETI"), 0.01, 4.0, 0.01, 2.0))), lightnessreti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_LIGHTRETI"), 0.01, 3.0, 0.01, 1.))), limd(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRESRETI"), 1.2, 100.0, 0.1, 8.))), @@ -410,6 +410,8 @@ Locallab::Locallab(): gridFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_LABGRID")))), pdeFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_PDEFRA")))), fatFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_FATFRA")))), + dehaFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_DEHAFRA")))), + retiFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RETIFRA")))), residFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_RESID")))), clariFrame(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CLARIFRA")))), // retiBox(Gtk::manage(new Gtk::Frame(M("TP_LOCALLAB_CLARIFRA")))), @@ -1319,6 +1321,9 @@ Locallab::Locallab(): retinexMethodConn = retinexMethod->signal_changed().connect(sigc::mem_fun(*this, &Locallab::retinexMethodChanged)); + dehaFrame->set_label_align(0.025, 0.5); + retiFrame->set_label_align(0.025, 0.5); + str->setAdjusterListener(this); // if (showtooltip) { @@ -1449,8 +1454,15 @@ Locallab::Locallab(): dehaBox->pack_start(*dehaz); dehaBox->pack_start(*depth); dehaBox->pack_start(*lumonly); - dehaBox->pack_start(*str); - expreti->add(*dehaBox, false); + dehaFrame->add(*dehaBox); + + ToolParamBlock* const deharetiBox = Gtk::manage(new ToolParamBlock()); + deharetiBox->pack_start(*str); + deharetiBox->pack_start(*loglin); + retiFrame->add(*deharetiBox); + + expreti->add(*dehaFrame, false); + expreti->add(*retiFrame, false); ToolParamBlock* const scopeBox = Gtk::manage(new ToolParamBlock()); scopeBox->pack_start(*sensih); @@ -1459,7 +1471,6 @@ Locallab::Locallab(): retiBox->pack_start(*retinexMethod); retiBox->pack_start(*fftwreti); retiBox->pack_start(*equilret); - retiBox->pack_start(*loglin); retiBox->pack_start(*chrrt); retiBox->pack_start(*neigh); retiBox->pack_start(*vart); diff --git a/rtgui/locallab.h b/rtgui/locallab.h index e2780fe3f..b73879f8d 100644 --- a/rtgui/locallab.h +++ b/rtgui/locallab.h @@ -404,6 +404,8 @@ private: Gtk::Frame* gridFrame; Gtk::Frame* pdeFrame; Gtk::Frame* fatFrame; + Gtk::Frame* dehaFrame; + Gtk::Frame* retiFrame; Gtk::Frame* residFrame; Gtk::Frame* clariFrame; ToolParamBlock * retiBox;