From dd9f8a062b67ed3b34ae7b643b393975f8311f86 Mon Sep 17 00:00:00 2001 From: Desmis Date: Tue, 7 May 2019 15:52:41 +0200 Subject: [PATCH] Blur only levels 0 1 2 3 4 --- rtdata/languages/default | 2 +- rtengine/dirpyr_equalizer.cc | 10 +++++----- rtengine/improcfun.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rtdata/languages/default b/rtdata/languages/default index 91af3bf5f..8187f6ea2 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1981,7 +1981,7 @@ TP_LOCALLAB_BLUFR;Blur & Noise TP_LOCALLAB_BLURDE;Blur Shape detection TP_LOCALLAB_BLNORM;Normal TP_LOCALLAB_BLINV;Inverse -TP_LOCALLAB_BLURCBDL;Blur levels +TP_LOCALLAB_BLURCBDL;Blur levels 0-1-2-3-4 TP_LOCALLAB_BLSYM;Symmetric TP_LOCALLAB_CENTER_X;Center X TP_LOCALLAB_CENTER_Y;Center Y diff --git a/rtengine/dirpyr_equalizer.cc b/rtengine/dirpyr_equalizer.cc index 52b58d01f..7681b4c93 100644 --- a/rtengine/dirpyr_equalizer.cc +++ b/rtengine/dirpyr_equalizer.cc @@ -409,12 +409,12 @@ void ImProcFunctions::cbdl_local_temp(float ** src, float ** loctemp, int srcwid for (int level = lastlevel - 1; level > 0; level--) { - idirpyr_eq_channel_loc(dirpyrlo[level], dirpyrlo[level - 1], residbuff, srcwidth, srcheight, level, multi, blurcb, dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, multiThread); + idirpyr_eq_channel_loc(dirpyrlo[level], dirpyrlo[level - 1], residbuff, srcwidth, srcheight, level, multi, blurcb, dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, scaleprev, multiThread); } scale = scalesloc[0]; - idirpyr_eq_channel_loc(dirpyrlo[0], src, residbuff, srcwidth, srcheight, 0, multi, blurcb, dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, multiThread); + idirpyr_eq_channel_loc(dirpyrlo[0], src, residbuff, srcwidth, srcheight, 0, multi, blurcb, dirpyrThreshold, nullptr, nullptr, skinprot, gamutlab, b_l, t_l, t_r, b_r, choice, scaleprev, multiThread); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% array2D loct(srcwidth, srcheight); @@ -806,7 +806,7 @@ void ImProcFunctions::dirpyr_channel(float ** data_fine, float ** data_coarse, i } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[5], const float blurcb, const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, bool multiThread) +void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float mult[6], const float blurcb, const double dirpyrThreshold, float ** hue, float ** chrom, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev, bool multiThread) { // const float skinprotneg = -skinprot; // const float factorHard = (1.f - skinprotneg / 100.f); @@ -864,9 +864,9 @@ void ImProcFunctions::idirpyr_eq_channel_loc(float ** data_coarse, float ** data } } - if(blurcb > 0.f && choice == 0) { + if(blurcb > 0.f && choice == 0 && level != 5) { AlignedBuffer blurbufcbdl(width * height); - float rad = 0.05f * blurcb * fabs((level + 1) * (multbis[level] - 1.f)); + float rad = 0.05f * blurcb * fabs((level + 1) * (multbis[level] - 1.f)) / scaleprev; // printf("rad=%f level=%i\n", rad, level); #ifdef _OPENMP diff --git a/rtengine/improcfun.h b/rtengine/improcfun.h index 17834ca36..5cfbf5076 100644 --- a/rtengine/improcfun.h +++ b/rtengine/improcfun.h @@ -387,7 +387,7 @@ public: // pyramid wavelet void cbdl_local_temp(float ** src, float ** loctemp, int srcwidth, int srcheight, const float * mult, float kchro, const double dirpyrThreshold, const float mergeL, const float contres, const float blurcb, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scale, bool multiThread); - void idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float multi[5], const float blucb, const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, bool multiThread); + void idirpyr_eq_channel_loc(float ** data_coarse, float ** data_fine, float ** buffer, int width, int height, int level, float multi[6], const float blucb, const double dirpyrThreshold, float ** l_a_h, float ** l_b_c, const double skinprot, const bool gamutlab, float b_l, float t_l, float t_r, float b_r, int choice, int scaleprev, bool multiThread); void dirpyr_equalizer(float ** src, float ** dst, int srcwidth, int srcheight, float ** l_a, float ** l_b, const double * mult, const double dirpyrThreshold, const double skinprot, float b_l, float t_l, float t_r, int scale); //Emil's directional pyramid wavelet void dirpyr_equalizercam(CieImage* ncie, float ** src, float ** dst, int srcwidth, int srcheight, float ** h_p, float ** C_p, const double * mult, const double dirpyrThreshold, const double skinprot, bool execdir, float b_l, float t_l, float t_r, int scale); //Emil's directional pyramid wavelet void dirpyr_channel(float ** data_fine, float ** data_coarse, int width, int height, int level, int scale);