diff --git a/rtengine/ipretinex.cc b/rtengine/ipretinex.cc index bab98ef0c..f66fb39af 100644 --- a/rtengine/ipretinex.cc +++ b/rtengine/ipretinex.cc @@ -297,7 +297,7 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e if(gradient == 0) { grad = 1.f; - sc = scal;//3.f + sc = 3.f; } else if(gradient == 1) { grad = 0.25f * it + 0.75f; sc = -0.5f * it + 4.5f; @@ -339,6 +339,19 @@ void RawImageSource::MSR(float** luminance, float** originalLuminance, float **e if(iter == 1) { sc = scal; + } else { + //adjust sc in function of choice of scale by user if iterations + if(scal < 3) { + sc -= 1; + + if(sc < 1.f) {//avoid 0 + sc = 1.f; + } + } + + if(scal > 4) { + sc += 1; + } } float varx; diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 96f8be01f..7575564c5 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -158,7 +158,7 @@ void RetinexParams::setDefaults() { enabled = false; str = 20; - scal = 0; + scal = 3; iter = 1; grad = 1; grads = 1; diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 5b5ad6a99..b29348c9f 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -2234,7 +2234,6 @@ void RawImageSource::retinexPrepareCurves(RetinexParams retinexParams, LUTf &cdc void RawImageSource::retinex(ColorManagementParams cmp, RetinexParams deh, ToneCurveParams Tc, LUTf & cdcurve, LUTf & mapcurve, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, multi_array2D &conversionBuffer, bool dehacontlutili, bool mapcontlutili, bool useHsl, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax, LUTu &histLRETI) { - MyTime t4, t5; t4.set();