diff --git a/modules/photo/src/merge.cpp b/modules/photo/src/merge.cpp index 7adfb5ec6..295e03c95 100644 --- a/modules/photo/src/merge.cpp +++ b/modules/photo/src/merge.cpp @@ -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(logf(static_cast(min(size.width, size.height))) / logf(2.0f));