Some various changes to improve...

This commit is contained in:
Desmis 2017-10-13 08:14:31 +02:00
parent cffb29d17b
commit b19e12732a
4 changed files with 38 additions and 22 deletions

View File

@ -918,7 +918,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
int t_inverssha = 0; int t_inverssha = 0;
int t_qualityMethod = 2; int t_qualityMethod = 2;
int t_thres = 18; int t_thres = 18;
int t_proxi = 20; int t_proxi = 0;
int t_noiselumf = 0; int t_noiselumf = 0;
int t_noiselumc = 0; int t_noiselumc = 0;
int t_noisechrof = 0; int t_noisechrof = 0;
@ -1809,7 +1809,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
int t_inverssha = 0; int t_inverssha = 0;
int t_qualityMethod = 2; int t_qualityMethod = 2;
int t_thres = 18; int t_thres = 18;
int t_proxi = 20; int t_proxi = 0;
int t_noiselumf = 0; int t_noiselumf = 0;
int t_noiselumc = 0; int t_noiselumc = 0;
int t_noisechrof = 0; int t_noisechrof = 0;

View File

@ -1782,6 +1782,10 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli
const float ahu = 1.f / (2.8f * lp.senstm - 280.f); const float ahu = 1.f / (2.8f * lp.senstm - 280.f);
const float bhu = 1.f - ahu * 2.8f * lp.senstm; const float bhu = 1.f - ahu * 2.8f * lp.senstm;
const float alum = 1.f / (lp.senstm - 100.f);
const float blum = 1.f - alum * lp.senstm;
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel if (multiThread) #pragma omp parallel if (multiThread)
#endif #endif
@ -1849,6 +1853,7 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli
float rchro = sqrt (SQR (original->b[y][x]) + SQR (original->a[y][x])) / 327.68f; float rchro = sqrt (SQR (original->b[y][x]) + SQR (original->a[y][x])) / 327.68f;
#endif #endif
// int zone; // int zone;
float rL = original->L[y][x] / 327.68f;
//retrieve data //retrieve data
float cli = 1.f; float cli = 1.f;
@ -1873,6 +1878,7 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli
float khu = 0.f; float khu = 0.f;
float kch = 1.f; float kch = 1.f;
float fach = 1.f; float fach = 1.f;
float falu = 1.f;
float deltachro = fabs (rchro - chromaref); float deltachro = fabs (rchro - chromaref);
float deltahue = fabs (rhue - hueref); float deltahue = fabs (rhue - hueref);
@ -1881,6 +1887,7 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli
} }
float deltaE = 20.f * deltahue + deltachro; //pseudo deltaE between 0 and 280 float deltaE = 20.f * deltahue + deltachro; //pseudo deltaE between 0 and 280
float deltaL = fabs (lumaref - rL); //between 0 and 100
//kch to modulate action with chroma //kch to modulate action with chroma
if (deltachro < 160.f * SQR (lp.senstm / 100.f)) { if (deltachro < 160.f * SQR (lp.senstm / 100.f)) {
@ -1969,22 +1976,31 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli
// kzon = true; // kzon = true;
} }
if (deltaE < 2.8f * lp.senstm) { if (lp.senstm <= 20.f) {
fach = khu;
} else { if (deltaE < 2.8f * lp.senstm) {
fach = khu * (ahu * deltaE + bhu); fach = khu;
} } else {
fach = khu * (ahu * deltaE + bhu);
}
float kcr = 10.f; float kcr = 10.f;
if (rchro < kcr) { if (rchro < kcr) {
fach *= (1.f / (kcr * kcr)) * rchro * rchro; fach *= (1.f / (kcr * kcr)) * rchro * rchro;
} }
if (lp.qualmet == 1) { if (lp.qualmet >= 1) {
} else { } else {
fach = 1.f; fach = 1.f;
}
if (deltaL < lp.senstm) {
falu = 1.f;
} else {
falu = alum * deltaL + blum;
}
} }
//fach = khu ; //fach = khu ;
@ -2026,8 +2042,8 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli
transformed->L[y][x] = original->L[y][x] + difL * kch * fach; transformed->L[y][x] = original->L[y][x] + difL * kch * fach;
transformed->a[y][x] = original->a[y][x] + difa * kch * fach;//same as Luma transformed->a[y][x] = original->a[y][x] + difa * kch * fach * falu;//same as Luma
transformed->b[y][x] = original->b[y][x] + difb * kch * fach;//same as Luma transformed->b[y][x] = original->b[y][x] + difb * kch * fach * falu;//same as Luma
break; break;
} }
@ -2042,8 +2058,8 @@ void ImProcFunctions::TM_Local (int call, int sp, LabImage * tmp1, float **bufli
transformed->L[y][x] = original->L[y][x] + difL * kch * fach; transformed->L[y][x] = original->L[y][x] + difL * kch * fach;
transformed->a[y][x] = original->a[y][x] + difa * kch * fach;//same as Luma transformed->a[y][x] = original->a[y][x] + difa * kch * fach * falu;//same as Luma
transformed->b[y][x] = original->b[y][x] + difb * kch * fach;//same as Luma transformed->b[y][x] = original->b[y][x] + difb * kch * fach * falu;//same as Luma
} }
} }
@ -2181,7 +2197,7 @@ void ImProcFunctions::BlurNoise_Local (int call, int sp, LabImage * tmp1, const
// algo with detection of hue ==> artifacts for noisy images ==> denoise before // algo with detection of hue ==> artifacts for noisy images ==> denoise before
if (lp.qualmet == 1 && lp.sensbn < 20.f) { //to try... if (lp.qualmet >= 1 && lp.sensbn < 20.f) { //to try...
//hue detection //hue detection
if ((hueref + dhue) < rtengine::RT_PI && rhue < hueplus && rhue > huemoins) { //transition are good if ((hueref + dhue) < rtengine::RT_PI && rhue < hueplus && rhue > huemoins) { //transition are good
if (rhue >= hueplus - delhu ) { if (rhue >= hueplus - delhu ) {
@ -6831,7 +6847,7 @@ void ImProcFunctions::Lab_Local (LocallabParams &loc, int call, int sp, float**
int loy = cy + y; int loy = cy + y;
if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) { if (lox >= begx && lox < xEn && loy >= begy && loy < yEn) {
rch = CLIPRET ((loctempch[loy - begy][lox - begx] - sqrt (SQR (original->a[y][x]) + SQR (original->b[y][x]))) / 3.f); rch = CLIPRET ((loctempch[loy - begy][lox - begx] - sqrt (SQR (original->a[y][x]) + SQR (original->b[y][x]))) / 200.f);
bufchrom[loy - begy][lox - begx] = rch; bufchrom[loy - begy][lox - begx] = rch;
} }
} }

View File

@ -991,7 +991,7 @@ void LocallabParams::setDefaults()
// qualityMethod = "enhden"; // qualityMethod = "enhden";
qualitycurveMethod = "none"; qualitycurveMethod = "none";
proxi = 20; proxi = 0;
thres = 18; thres = 18;
lightness = 0; lightness = 0;
contrast = 0; contrast = 0;

View File

@ -66,7 +66,7 @@ Locallab::Locallab ():
centerY (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CENTER_Y"), -1000, 1000, 1, 0))), 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))), circrad (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CIRCRADIUS"), 2, 150, 1, 18))),
thres (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_THRES"), 1, 35, 1, 18))), thres (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_THRES"), 1, 35, 1, 18))),
proxi (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_PROXI"), 0, 60, 1, 20))), proxi (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_PROXI"), 0, 60, 1, 0))),
lightness (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_LIGHTNESS"), -100, 100, 1, 0))), lightness (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_LIGHTNESS"), -100, 100, 1, 0))),
contrast (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CONTRAST"), -100, 100, 1, 0))), contrast (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CONTRAST"), -100, 100, 1, 0))),
chroma (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))), chroma (Gtk::manage (new Adjuster (M ("TP_LOCALLAB_CHROMA"), -100, 150, 1, 0))),