Skip to content

Commit

Permalink
Merge pull request #1462 from alicevision/dev/memoryCompositing
Browse files Browse the repository at this point in the history
Panorama was using too much memory for no reason
  • Loading branch information
mugulmd authored Jun 12, 2023
2 parents c1f79a9 + 45372bb commit 07354f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/software/pipeline/main_panoramaCompositing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<Compositer>(
new LaplacianCompositer(panoramaBoundingBox.width, panoramaBoundingBox.height, panoramaMap.getScale()));
}
Expand Down

0 comments on commit 07354f0

Please sign in to comment.