From d19189e80ff266ee52082d4a647c7a89efe8ea82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Rousseau?= Date: Tue, 15 Dec 2015 10:30:06 +0100 Subject: [PATCH] Fixed the formula to compute the well-exposedness weight map. --- modules/photo/src/merge.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/photo/src/merge.cpp b/modules/photo/src/merge.cpp index 295e03c95f..c1d8a2da5a 100644 --- a/modules/photo/src/merge.cpp +++ b/modules/photo/src/merge.cpp @@ -194,10 +194,11 @@ public: wellexp = Mat::ones(size, CV_32F); for(int c = 0; c < channels; c++) { - Mat exp = splitted[c] - 0.5f; - pow(exp, 2.0f, exp); - exp = -exp / 0.08f; - wellexp = wellexp.mul(exp); + Mat expo = splitted[c] - 0.5f; + pow(expo, 2.0f, expo); + expo = -expo / 0.08f; + exp(expo, expo); + wellexp = wellexp.mul(expo); } pow(contrast, wcon, contrast);