diff --git a/rtdata/languages/default b/rtdata/languages/default index 8a5381d07..d00ec900f 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -765,7 +765,7 @@ HISTORY_MSG_508;L*a*b Spot circrad HISTORY_MSG_509;L*a*b Spot quality method HISTORY_MSG_510;L*a*b Spot transit HISTORY_MSG_511;L*a*b Spot thresh -HISTORY_MSG_512;L*a*b Spot iter +HISTORY_MSG_512;L*a*b Spot deltaE-weakening HISTORY_MSG_513;L*a*b Spot scope HISTORY_MSG_514;L*a*b Spot structure HISTORY_MSG_515;Local L*a*b* @@ -2010,6 +2010,7 @@ TP_LOCALLAB_ENH;Enhanced TP_LOCALLAB_ENHDEN;Enhanced + chroma denoise TP_LOCALLAB_THRES;Threshold structure TP_LOCALLAB_PROXI;DeltaE weakening +TP_LOCALLAB_THRESDELTAE;Threshold deltaE-scope TP_LOCALLAB_LIGHTNESS;Lightness TP_LOCALLAB_MASK;Mask: TP_LOCALLAB_METHOD_TOOLTIP;'Enhanced + chroma denoise' significantly increases processing times.\nBut reduce artifacts. diff --git a/rtengine/iplocallab.cc b/rtengine/iplocallab.cc index cc8122089..3a68e5dbf 100644 --- a/rtengine/iplocallab.cc +++ b/rtengine/iplocallab.cc @@ -155,6 +155,7 @@ struct local_params { float iterat; int cir; float thr; + float stru; int prox; int chro, cont, sens, sensh, senscb, sensbn, senstm, sensex, sensexclu, sensden, senslc, senssf; float struco; @@ -356,10 +357,12 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall float scal_tm = ((float)locallab.spots.at(sp).scaltm) / 10.f; float rewe = ((float)locallab.spots.at(sp).rewei); float strlight = ((float)locallab.spots.at(sp).streng) / 100.f; + float strucc = locallab.spots.at(sp).struc; + float thre = locallab.spots.at(sp).thresh; - if (thre > 12 || thre < 1) { - thre = 4.f; + if (thre > 6 || thre < 1) {//to avoid artifacts if user does not clear cache with new settings. Can be suppressed after + thre = 2.f; } double local_x = locallab.spots.at(sp).locX / 2000.0; @@ -374,7 +377,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall double local_dyy = locallab.spots.at(sp).iter / 8000.0; float iterati = (float) locallab.spots.at(sp).iter / 10.f; - if (iterati > 4.f || iterati < 1.f) { + if (iterati > 4.f || iterati < 1.f) {//to avoid artifacts if user does not clear cache with new settings Can be suppressed after iterati = 2.f; } @@ -447,7 +450,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall int local_sensitm = locallab.spots.at(sp).sensitm; int local_sensiexclu = locallab.spots.at(sp).sensiexclu; int local_sensilc = locallab.spots.at(sp).sensilc; - int local_struc = locallab.spots.at(sp).struc; +// int local_struc = locallab.spots.at(sp).struc; int local_warm = locallab.spots.at(sp).warm; int local_sensih = locallab.spots.at(sp).sensih; int local_dehaze = locallab.spots.at(sp).dehaz; @@ -536,6 +539,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.dxx = w * local_dxx; lp.dyy = h * local_dyy; lp.thr = thre; + lp.stru = strucc; lp.noiself = local_noiself; lp.noiseldetail = local_noiseldetail; lp.noiselequal = local_noiselequal; @@ -581,7 +585,7 @@ static void calcLocalParams(int sp, int oW, int oH, const LocallabParams& locall lp.hlcompthr = locallab.spots.at(sp).hlcomprthresh; lp.expcomp = locallab.spots.at(sp).expcomp / 100.; lp.sensex = local_sensiex; - lp.strucc = local_struc; +// lp.strucc = local_struc; lp.war = local_warm; } @@ -1968,8 +1972,8 @@ void ImProcFunctions::DeNoise_Local(int call, const struct local_params& lp, in float dEb = 0.f; dEb = sqrt(1.f * SQR(refa - origblur->a[y][x] / 327.6f) + 1.2f * SQR(refb - origblur->b[y][x] / 327.8f) + 0.8f * SQR(lumaref - rL)); - float mindE = 2.f + 0.05f * lp.sensden;//between 2 and 7 - float maxdE = 5.f + 1.5f * lp.sensden; // between 5 and 150, we can chnage this values + float mindE = 2.f + 0.025f * lp.sensden * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * lp.sensden * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float reducdEL = 1.f; float reducdEa = 1.f; float reducdEb = 1.f; @@ -2618,8 +2622,8 @@ void ImProcFunctions::BlurNoise_Local(int call, LabImage * tmp1, LabImage * tmp2 cli = (buflight[loy - begy][lox - begx]); clc = (bufchro[loy - begy][lox - begx]); float reducdE = 0.f; - float mindE = 2.f + 0.05f * lp.sensbn;//between 2 and 7 - float maxdE = 5.f + 1.5f * lp.sensbn; // between 5 and 150, we can chnage this values + float mindE = 2.f + 0.025f * lp.sensbn * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * lp.sensbn * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float ar = 1.f / (mindE - maxdE); @@ -2820,8 +2824,8 @@ void ImProcFunctions::InverseReti_Local(const struct local_params & lp, const fl float reducdE = 0.f; float dE = 0.f; dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); - float mindE = 2.f + 0.05f * lp.sensh;//between 2 and 7 - float maxdE = 5.f + 1.5f * lp.sensh; // between 5 and 150, we can chnage this values + float mindE = 2.f + 0.025f * lp.sensh * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * lp.sensh * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float ar = 1.f / (mindE - maxdE); @@ -3096,8 +3100,8 @@ void ImProcFunctions::InverseSharp_Local(float **loctemp, const float hueref, co float reducdE = 0.f; float dE = 0.f; dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); - float mindE = 2.f + 0.05f * lp.senssha;//between 2 and 7 - float maxdE = 5.f + 1.5f * lp.senssha; // between 5 and 150, we can chnage this values + float mindE = 2.f + 0.025f * lp.senssha * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * lp.senssha * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float ar = 1.f / (mindE - maxdE); @@ -3256,8 +3260,8 @@ void ImProcFunctions::Sharp_Local(int call, float **loctemp, int senstype, cons dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); float reducdE = 0.f; - float mindE = 2.f + 0.05f * varsens;//between 2 and 7 - float maxdE = 5.f + 1.5f * varsens; // between 5 and 150, we can chnage this values + float mindE = 2.f + 0.025f * varsens * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * varsens * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float ar = 1.f / (mindE - maxdE); @@ -3434,8 +3438,8 @@ void ImProcFunctions::Exclude_Local(int sen, float **deltaso, float **buflight, clc = (bufchro[loy - begy][lox - begx]); float reducdE = 0.f; - float mindE = 2.f + 0.05f * varsens;//between 2 and 7 - float maxdE = 5.f + 1.5f * varsens; // between 5 and 150, we can chnage this values + float mindE = 2.f + 0.025f * varsens * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * varsens * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float ar = 1.f / (mindE - maxdE); @@ -3614,7 +3618,7 @@ void ImProcFunctions::transit_shapedetect(int senstype, LabImage * bufexporig, L float k = 1.f; - if (sobelref < meansobel && sobelref < lp.thr)//does not always work wth noisy images + if (sobelref < meansobel && sobelref < lp.stru)//does not always work wth noisy images { k = -1.f; } @@ -3800,8 +3804,8 @@ void ImProcFunctions::transit_shapedetect(int senstype, LabImage * bufexporig, L } float reducdE = 0.f; - float mindE = 2.f + 0.05f * varsens;//between 2 and 7 - float maxdE = 5.f + 1.5f * varsens; // between 5 and 150, we can change this values, with a slider ?? + float mindE = 2.f + 0.025f * varsens * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * varsens * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float ar = 1.f / (mindE - maxdE); @@ -4171,8 +4175,8 @@ void ImProcFunctions::InverseColorLight_Local(const struct local_params & lp, LU dE = sqrt(SQR(refa - origblur->a[y][x] / 327.68f) + SQR(refb - origblur->b[y][x] / 327.68f) + SQR(lumaref - rL)); float reducdE = 0.f; - float mindE = 2.f + 0.05f * lp.sens;//between 2 and 7 - float maxdE = 5.f + 1.5f * lp.sens; // between 5 and 150, we can chnage this values + float mindE = 2.f + 0.025f * lp.sens * lp.thr;//between 2 and 7 + float maxdE = 5.f + 1.38f * lp.sens * (1 + 0.1f * lp.thr); // between 5 and 150, we can change this values, with a slider ?? float ar = 1.f / (mindE - maxdE); @@ -4754,7 +4758,7 @@ void ImProcFunctions::Lab_Local(int call, int sp, float** shbuffer, LabImage * o calcLocalParams(sp, oW, oH, params->locallab, lp, llColorMask, llExpMask); const float radius = lp.rad / (sk * 1.4f); //0 to 70 ==> see skip - int strred = (lp.strucc - 1); + int strred = 1;//(lp.strucc - 1); if (strred > 1) { strred = 1; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 6618511f2..84daf4b8d 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -2342,7 +2342,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : shape("ELI"), spotMethod("norm"), sensiexclu(12), - struc(0), + struc(4), shapeMethod("IND"), locX(250), locXL(250), @@ -2353,7 +2353,7 @@ LocallabParams::LocallabSpot::LocallabSpot() : circrad(18), qualityMethod("enh"), transit(60), - thresh(4), + thresh(2), iter(20), // Color & Light expcolor(false), diff --git a/rtgui/controlspotpanel.cc b/rtgui/controlspotpanel.cc index 6eb1aec92..fc592cd17 100644 --- a/rtgui/controlspotpanel.cc +++ b/rtgui/controlspotpanel.cc @@ -46,7 +46,7 @@ ControlSpotPanel::ControlSpotPanel(): qualityMethod_(Gtk::manage(new MyComboBoxText())), sensiexclu_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_SENSIEXCLU"), 0, 100, 1, 12))), - struc_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_STRUC"), 0, 5, 1, 0))), + struc_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRES"), 1, 12, 1, 4))), locX_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH"), 0, 2250, 1, 250))), locXL_(Gtk::manage(new Adjuster(M("TP_LOCAL_WIDTH_L"), 0, 2250, 1, 250))), locY_(Gtk::manage(new Adjuster(M("TP_LOCAL_HEIGHT"), 0, 2250, 1, 250))), @@ -55,7 +55,7 @@ ControlSpotPanel::ControlSpotPanel(): centerY_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CENTER_Y"), -1000, 1000, 1, 0))), circrad_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_CIRCRADIUS"), 2, 150, 1, 18))), transit_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_TRANSIT"), 5, 95, 1, 60))), - thresh_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRES"), 1, 12, 1, 4))), + thresh_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_THRESDELTAE"), 1, 6, 1, 2))), iter_(Gtk::manage(new Adjuster(M("TP_LOCALLAB_PROXI"), 10, 40, 1, 20))), lastObject_(-1), @@ -166,8 +166,6 @@ ControlSpotPanel::ControlSpotPanel(): sensiexclu_->set_tooltip_text(M("TP_LOCALLAB_SENSIEXCLU_TOOLTIP")); sensiexclu_->setAdjusterListener(this); excluBox->pack_start(*sensiexclu_); - struc_->set_tooltip_text(M("TP_LOCALLAB_STRUC_TOOLTIP")); - struc_->setAdjusterListener(this); // excluBox->pack_start(*struc_); // Uncomment this line to use the struc_ adjuster excluFrame->add(*excluBox); pack_start(*excluFrame); @@ -230,8 +228,11 @@ ControlSpotPanel::ControlSpotPanel(): artifFrame->set_label_align(0.025, 0.5); artifFrame->set_tooltip_text(M("TP_LOCALLAB_ARTIF_TOOLTIP")); ToolParamBlock* const artifBox = Gtk::manage(new ToolParamBlock()); - artifBox->pack_start(*thresh_); thresh_->setAdjusterListener(this); + // struc_->set_tooltip_text(M("TP_LOCALLAB_STRUC_TOOLTIP")); + struc_->setAdjusterListener(this); + artifBox->pack_start(*struc_); + artifBox->pack_start(*thresh_); artifBox->pack_start(*iter_); iter_->setAdjusterListener(this); artifFrame->add(*artifBox);