From 497ee7a5f36669f8cf0e8c9b5c7eca5381cb0eb0 Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Thu, 26 May 2011 09:01:27 +0000 Subject: [PATCH] added some comments into multi-band blending code --- modules/stitching/blenders.cpp | 6 +++++- modules/stitching/main.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/stitching/blenders.cpp b/modules/stitching/blenders.cpp index 2033ce0090..1b7873611c 100644 --- a/modules/stitching/blenders.cpp +++ b/modules/stitching/blenders.cpp @@ -200,7 +200,11 @@ void MultiBandBlender::feed(const Mat &img, const Mat &mask, Point tl) Point br_new(min(dst_roi_.br().x, tl.x + img.cols + gap), min(dst_roi_.br().y, tl.y + img.rows + gap)); - // Ensure coordinates of top-left, bootom-right corners are divided by (1 << num_bands_) + // Ensure coordinates of top-left, bootom-right corners are divided by (1 << num_bands_). + // After that scale between layers is exactly 2. + // + // We do it to avoid interpolation problems when keeping sub-images only. There is no such problem when + // image is bordered to have size equal to the final image size, but this is too memory hungry approach. tl_new.x = dst_roi_.x + (((tl_new.x - dst_roi_.x) >> num_bands_) << num_bands_); tl_new.y = dst_roi_.y + (((tl_new.y - dst_roi_.y) >> num_bands_) << num_bands_); int width = br_new.x - tl_new.x; diff --git a/modules/stitching/main.cpp b/modules/stitching/main.cpp index 7459417993..4f97ecace8 100644 --- a/modules/stitching/main.cpp +++ b/modules/stitching/main.cpp @@ -85,7 +85,7 @@ void printUsage() // Default command line args vector img_names; bool trygpu = false; -double work_megapix = 0.5; +double work_megapix = 0.6; double seam_megapix = 0.1; double compose_megapix = 1; int ba_space = BundleAdjuster::FOCAL_RAY_SPACE;