Option Fftwsigma (true) to have substantially the same results FFTW Gaussianblur

This commit is contained in:
Desmis
2019-07-01 14:20:00 +02:00
parent 6bb31aff86
commit f1cc67bc2a
5 changed files with 44 additions and 25 deletions

View File

@@ -33,6 +33,8 @@
namespace rtengine
{
extern const Settings* settings;
LocallabParams locallab; ///< Local lab parameters
void ImProcFunctions::localContrast(LabImage *lab, float **destination, const LocalContrastParams &localContrastParams, bool fftwlc, double scale)
@@ -59,11 +61,15 @@ void ImProcFunctions::localContrast(LabImage *lab, float **destination, const Lo
//emprical adjustement between FFTW radius and Gaussainblur
//under 50 ==> 10.f
//above 400 ==> 1.f
float ak = -9.f / 350.f;
float bk = 10.f - 50.f * ak;
kr = ak * sigma + bk;
if(sigma < 50.f) kr = 10.f;
if(sigma > 400.f) kr = 1.f;
if(settings->fftwsigma == false) {//empirical formula
float ak = -9.f / 350.f;
float bk = 10.f - 50.f * ak;
kr = ak * sigma + bk;
if(sigma < 50.f) kr = 10.f;
if(sigma > 400.f) kr = 1.f;
} else {//sigma *= sigma
kr = sigma;
}
// printf("kr=%f \n", kr);
ImProcFunctions::fftw_convol_blur2(lab->L, buf, width, height, kr * sigma, 0, 0);
}