Commit aa368980 authored by Volodymyr Kysenko's avatar Volodymyr Kysenko

added epsilon value to weights in the MergeMertens in order to avoid zero…

added epsilon value to weights in the MergeMertens in order to avoid zero weights for pixels from uniformly filled areas of image
parent 1c3bfae2
...@@ -208,7 +208,7 @@ public: ...@@ -208,7 +208,7 @@ public:
if(channels == 3) { if(channels == 3) {
weights[i] = weights[i].mul(saturation); weights[i] = weights[i].mul(saturation);
} }
weights[i] = weights[i].mul(wellexp); weights[i] = weights[i].mul(wellexp) + 1e-12f;
weight_sum += weights[i]; weight_sum += weights[i];
} }
int maxlevel = static_cast<int>(logf(static_cast<float>(min(size.width, size.height))) / logf(2.0f)); int maxlevel = static_cast<int>(logf(static_cast<float>(min(size.width, size.height))) / logf(2.0f));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment