From 189f474e033c908ed06bfcb32580ab63427b9ad0 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sun, 22 Sep 2019 20:53:03 +0200 Subject: [PATCH] dehaze: add accidently removed early exit in case there is no haze detected, #5456 --- rtengine/ipdehaze.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rtengine/ipdehaze.cc b/rtengine/ipdehaze.cc index 125fa4d60..00236d1de 100644 --- a/rtengine/ipdehaze.cc +++ b/rtengine/ipdehaze.cc @@ -257,6 +257,13 @@ BENCHFUN } } + if (min(ambient[0], ambient[1], ambient[2]) < 0.01f) { + if (options.rtSettings.verbose) { + std::cout << "dehaze: no haze detected" << std::endl; + } + img->normalizeFloatTo65535(); + return; // probably no haze at all + } patchsize = max(max(W, H) / 600, 2); if (options.rtSettings.verbose) {