From 585a7256749d07712e0699a50ddf3dba3c8ba701 Mon Sep 17 00:00:00 2001 From: Fabien Servant Date: Mon, 7 Sep 2020 15:22:03 +0200 Subject: [PATCH] [software] PanoramaCompositing: add graphcut border check --- src/software/pipeline/main_panoramaCompositing.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/software/pipeline/main_panoramaCompositing.cpp b/src/software/pipeline/main_panoramaCompositing.cpp index 80ccfe956f..7da1691645 100644 --- a/src/software/pipeline/main_panoramaCompositing.cpp +++ b/src/software/pipeline/main_panoramaCompositing.cpp @@ -1384,16 +1384,10 @@ class GraphcutSeams { rect.h = input.Height() + 1; /*Extend rect for borders*/ - if (rect.l > 0) { - rect.l = rect.l - 3; - rect.w = rect.w + 6; - } - - if (rect.t > 0) { - rect.t = std::max(0, rect.t - 3); - rect.h = rect.h + 6; - } - + rect.l = std::max(0, rect.l - 3); + rect.t = std::max(0, rect.t - 3); + rect.w = rect.w + 6; + rect.h = rect.h + 6; if (rect.t + rect.h > _owners.Height()) { rect.h = _owners.Height() - rect.t; }