added epsilon value to weights in the MergeMertens in order to avoid zero weights for pixels from uniformly filled areas of image

This commit is contained in:
Volodymyr Kysenko 2014-01-07 19:38:57 -08:00
parent 1c3bfae212
commit aa36898024

View File

@ -208,7 +208,7 @@ public:
if(channels == 3) {
weights[i] = weights[i].mul(saturation);
}
weights[i] = weights[i].mul(wellexp);
weights[i] = weights[i].mul(wellexp) + 1e-12f;
weight_sum += weights[i];
}
int maxlevel = static_cast<int>(logf(static_cast<float>(min(size.width, size.height))) / logf(2.0f));