From 677f2427612f2096f46d924fcf49b30349d7c116 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Mon, 8 Aug 2016 15:43:04 +0200 Subject: [PATCH] stitching: use correct ifdef to allow compilation without cudalegacy GraphCutSeamFinderGpu requires cudalegacy. --- modules/stitching/src/stitcher.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/stitching/src/stitcher.cpp b/modules/stitching/src/stitcher.cpp index 41fe81f5fc..7226ac7479 100644 --- a/modules/stitching/src/stitcher.cpp +++ b/modules/stitching/src/stitcher.cpp @@ -56,7 +56,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu) stitcher.setFeaturesMatcher(makePtr(try_use_gpu)); stitcher.setBundleAdjuster(makePtr()); -#ifdef HAVE_CUDA +#ifdef HAVE_OPENCV_CUDALEGACY if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0) { #ifdef HAVE_OPENCV_XFEATURES2D @@ -549,7 +549,7 @@ Ptr createStitcher(bool try_use_gpu) stitcher->setFeaturesMatcher(makePtr(try_use_gpu)); stitcher->setBundleAdjuster(makePtr()); - #ifdef HAVE_CUDA + #ifdef HAVE_OPENCV_CUDALEGACY if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0) { #ifdef HAVE_OPENCV_NONFREE @@ -561,20 +561,20 @@ Ptr createStitcher(bool try_use_gpu) stitcher->setSeamFinder(makePtr()); } else + #endif + { + #ifdef HAVE_OPENCV_NONFREE + stitcher->setFeaturesFinder(makePtr()); + #else + stitcher->setFeaturesFinder(makePtr()); #endif - { - #ifdef HAVE_OPENCV_NONFREE - stitcher->setFeaturesFinder(makePtr()); - #else - stitcher->setFeaturesFinder(makePtr()); - #endif - stitcher->setWarper(makePtr()); - stitcher->setSeamFinder(makePtr(detail::GraphCutSeamFinderBase::COST_COLOR)); - } + stitcher->setWarper(makePtr()); + stitcher->setSeamFinder(makePtr(detail::GraphCutSeamFinderBase::COST_COLOR)); + } - stitcher->setExposureCompensator(makePtr()); - stitcher->setBlender(makePtr(try_use_gpu)); + stitcher->setExposureCompensator(makePtr()); + stitcher->setBlender(makePtr(try_use_gpu)); - return stitcher; + return stitcher; } } // namespace cv