From 45372bb6d36d82b16e2d37c5ba4ad3efba4ede16 Mon Sep 17 00:00:00 2001 From: Fabien SERVANT Date: Fri, 9 Jun 2023 11:45:00 +0200 Subject: [PATCH] Panorama was using too much memory for no reason --- src/software/pipeline/main_panoramaCompositing.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/software/pipeline/main_panoramaCompositing.cpp b/src/software/pipeline/main_panoramaCompositing.cpp index dac0aac633..59b3d53096 100644 --- a/src/software/pipeline/main_panoramaCompositing.cpp +++ b/src/software/pipeline/main_panoramaCompositing.cpp @@ -63,7 +63,7 @@ size_t getCompositingOptimalScale(int width, int height) * Ideally, should be gaussianFilterSize = 1 + 2 * gaussianFilterRadius with: * const size_t gaussianFilterRadius = 2; */ - const int gaussianFilterSize = 1; + const int gaussianFilterSize = 5; //Avoid negative values on scale if (minsize < gaussianFilterSize) @@ -163,6 +163,10 @@ bool processImage(const PanoramaMap& panoramaMap, const sfmData::SfMData& sfmDat panoramaBoundingBox = referenceBoundingBox.divide(panoramaMap.getScale()) .dilate(panoramaMap.getBorderSize()) .multiply(panoramaMap.getScale()); + + panoramaBoundingBox.clampTop(); + panoramaBoundingBox.clampBottom(panoramaMap.getHeight()); + compositer = std::unique_ptr( new LaplacianCompositer(panoramaBoundingBox.width, panoramaBoundingBox.height, panoramaMap.getScale())); }