diff --git a/modules/stitching/include/opencv2/stitching.hpp b/modules/stitching/include/opencv2/stitching.hpp index 387e1dec78..8b1bcc1a8c 100644 --- a/modules/stitching/include/opencv2/stitching.hpp +++ b/modules/stitching/include/opencv2/stitching.hpp @@ -312,6 +312,7 @@ private: }; CV_EXPORTS_W Ptr createStitcher(bool try_use_gpu = false); +CV_EXPORTS_W Ptr createStitcherScans(bool try_use_gpu = false); //! @} stitching diff --git a/modules/stitching/src/stitcher.cpp b/modules/stitching/src/stitcher.cpp index 336b53648e..d7ecb7364b 100644 --- a/modules/stitching/src/stitcher.cpp +++ b/modules/stitching/src/stitcher.cpp @@ -606,42 +606,13 @@ Ptr createStitcher(bool try_use_gpu) { CV_INSTRUMENT_REGION() - Ptr stitcher = makePtr(); - stitcher->setRegistrationResol(0.6); - stitcher->setSeamEstimationResol(0.1); - stitcher->setCompositingResol(Stitcher::ORIG_RESOL); - stitcher->setPanoConfidenceThresh(1); - stitcher->setWaveCorrection(true); - stitcher->setWaveCorrectKind(detail::WAVE_CORRECT_HORIZ); - stitcher->setFeaturesMatcher(makePtr(try_use_gpu)); - stitcher->setBundleAdjuster(makePtr()); - - #ifdef HAVE_OPENCV_CUDALEGACY - if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0) - { - #ifdef HAVE_OPENCV_NONFREE - stitcher->setFeaturesFinder(makePtr()); - #else - stitcher->setFeaturesFinder(makePtr()); - #endif - stitcher->setWarper(makePtr()); - stitcher->setSeamFinder(makePtr()); - } - else - #endif - { - #ifdef HAVE_OPENCV_NONFREE - stitcher->setFeaturesFinder(makePtr()); - #else - stitcher->setFeaturesFinder(makePtr()); - #endif - stitcher->setWarper(makePtr()); - stitcher->setSeamFinder(makePtr(detail::GraphCutSeamFinderBase::COST_COLOR)); - } + return Stitcher::create(Stitcher::PANORAMA, try_use_gpu); +} - stitcher->setExposureCompensator(makePtr()); - stitcher->setBlender(makePtr(try_use_gpu)); +Ptr createStitcherScans(bool try_use_gpu) +{ + CV_INSTRUMENT_REGION() - return stitcher; + return Stitcher::create(Stitcher::SCANS, try_use_gpu); } } // namespace cv