diff --git a/modules/stitching/blenders.cpp b/modules/stitching/blenders.cpp index 99e1b15e30..3c35e41a88 100644 --- a/modules/stitching/blenders.cpp +++ b/modules/stitching/blenders.cpp @@ -233,7 +233,10 @@ void MultiBandBlender::feed(const Mat &img, const Mat &mask, Point tl) copyMakeBorder(img, img_with_border, top, bottom, left, right, BORDER_REFLECT); vector src_pyr_laplace; - createLaplacePyr(img_with_border, num_bands_, src_pyr_laplace); + if (can_use_gpu_) + createLaplacePyrGpu(img_with_border, num_bands_, src_pyr_laplace); + else + createLaplacePyr(img_with_border, num_bands_, src_pyr_laplace); // Create the weight map Gaussian pyramid Mat weight_map; @@ -338,7 +341,6 @@ void createLaplacePyr(const Mat &img, int num_levels, vector &pyr) } -#if 0 void createLaplacePyrGpu(const Mat &img, int num_levels, vector &pyr) { pyr.resize(num_levels + 1); @@ -358,7 +360,6 @@ void createLaplacePyrGpu(const Mat &img, int num_levels, vector &pyr) pyr[num_levels] = gpu_pyr[num_levels]; } -#endif void restoreImageFromLaplacePyr(vector &pyr) diff --git a/modules/stitching/blenders.hpp b/modules/stitching/blenders.hpp index 4595877ecc..119d70a314 100644 --- a/modules/stitching/blenders.hpp +++ b/modules/stitching/blenders.hpp @@ -109,10 +109,7 @@ void createWeightMap(const cv::Mat& mask, float sharpness, cv::Mat& weight); void createLaplacePyr(const cv::Mat &img, int num_levels, std::vector& pyr); -// TODO Use it after gpu::pyrDown and gpu::pyrUp are updated -#if 0 void createLaplacePyrGpu(const cv::Mat &img, int num_levels, std::vector& pyr); -#endif // Restores source image void restoreImageFromLaplacePyr(std::vector& pyr);