From beb033aff5c811dc9bb635f24bff45faa4174e5b Mon Sep 17 00:00:00 2001 From: Desmis Date: Wed, 22 May 2019 12:33:13 +0200 Subject: [PATCH] Improvments to local retinex --- rtengine/ipretinex.cc | 6 +++--- rtgui/locallab.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index 6a767de65..67755194a 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -893,7 +893,7 @@ void ImProcFunctions::MSRLocal(int sp, int lum, LabImage * bufreti, LabImage * b const float high = 0.f; // Dummy to pass to retinex_scales(...) - constexpr auto maxRetinexScales = 8; + constexpr auto maxRetinexScales = 10; float RetinexScales[maxRetinexScales]; retinex_scales(RetinexScales, scal, moderetinex, nei, high); @@ -1197,9 +1197,9 @@ void ImProcFunctions::MSRLocal(int sp, int lum, LabImage * bufreti, LabImage * b guid[i][j] = src[i][j]/32768.f; ble[i][j] = luminance[i][j]/32768.f; } - + double epsilon = 4. * 1e-5 / (double) scal; if (loc.spots.at(sp).softradiusret > 0.f) { - guidedFilter(guid, ble, ble, loc.spots.at(sp).softradiusret * 10.f / skip, 1e-5, multiThread, 4); + guidedFilter(guid, ble, ble, loc.spots.at(sp).softradiusret * 10.f / skip, epsilon, multiThread, 4); } #ifdef _OPENMP diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc index 1089163cc..59d94f344 100644 --- a/rtgui/locallab.cc +++ b/rtgui/locallab.cc @@ -161,7 +161,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, 8.0, 1., 4.))), + scalereti(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SCALERETI"), 1.0, 10.0, 1., 4.))), darkness(Gtk::manage(new Adjuster(M("TP_LOCALLAB_DARKRETI"), 0.01, 3.0, 0.01, 1.))), 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.))),