mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
stitching: use correct ifdef to allow compilation without cudalegacy
GraphCutSeamFinderGpu requires cudalegacy.
This commit is contained in:
parent
ad974de165
commit
677f242761
@ -56,7 +56,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu)
|
|||||||
stitcher.setFeaturesMatcher(makePtr<detail::BestOf2NearestMatcher>(try_use_gpu));
|
stitcher.setFeaturesMatcher(makePtr<detail::BestOf2NearestMatcher>(try_use_gpu));
|
||||||
stitcher.setBundleAdjuster(makePtr<detail::BundleAdjusterRay>());
|
stitcher.setBundleAdjuster(makePtr<detail::BundleAdjusterRay>());
|
||||||
|
|
||||||
#ifdef HAVE_CUDA
|
#ifdef HAVE_OPENCV_CUDALEGACY
|
||||||
if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0)
|
if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OPENCV_XFEATURES2D
|
#ifdef HAVE_OPENCV_XFEATURES2D
|
||||||
@ -549,7 +549,7 @@ Ptr<Stitcher> createStitcher(bool try_use_gpu)
|
|||||||
stitcher->setFeaturesMatcher(makePtr<detail::BestOf2NearestMatcher>(try_use_gpu));
|
stitcher->setFeaturesMatcher(makePtr<detail::BestOf2NearestMatcher>(try_use_gpu));
|
||||||
stitcher->setBundleAdjuster(makePtr<detail::BundleAdjusterRay>());
|
stitcher->setBundleAdjuster(makePtr<detail::BundleAdjusterRay>());
|
||||||
|
|
||||||
#ifdef HAVE_CUDA
|
#ifdef HAVE_OPENCV_CUDALEGACY
|
||||||
if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0)
|
if (try_use_gpu && cuda::getCudaEnabledDeviceCount() > 0)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OPENCV_NONFREE
|
#ifdef HAVE_OPENCV_NONFREE
|
||||||
@ -561,20 +561,20 @@ Ptr<Stitcher> createStitcher(bool try_use_gpu)
|
|||||||
stitcher->setSeamFinder(makePtr<detail::GraphCutSeamFinderGpu>());
|
stitcher->setSeamFinder(makePtr<detail::GraphCutSeamFinderGpu>());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
#ifdef HAVE_OPENCV_NONFREE
|
||||||
|
stitcher->setFeaturesFinder(makePtr<detail::SurfFeaturesFinder>());
|
||||||
|
#else
|
||||||
|
stitcher->setFeaturesFinder(makePtr<detail::OrbFeaturesFinder>());
|
||||||
#endif
|
#endif
|
||||||
{
|
stitcher->setWarper(makePtr<SphericalWarper>());
|
||||||
#ifdef HAVE_OPENCV_NONFREE
|
stitcher->setSeamFinder(makePtr<detail::GraphCutSeamFinder>(detail::GraphCutSeamFinderBase::COST_COLOR));
|
||||||
stitcher->setFeaturesFinder(makePtr<detail::SurfFeaturesFinder>());
|
}
|
||||||
#else
|
|
||||||
stitcher->setFeaturesFinder(makePtr<detail::OrbFeaturesFinder>());
|
|
||||||
#endif
|
|
||||||
stitcher->setWarper(makePtr<SphericalWarper>());
|
|
||||||
stitcher->setSeamFinder(makePtr<detail::GraphCutSeamFinder>(detail::GraphCutSeamFinderBase::COST_COLOR));
|
|
||||||
}
|
|
||||||
|
|
||||||
stitcher->setExposureCompensator(makePtr<detail::BlocksGainCompensator>());
|
stitcher->setExposureCompensator(makePtr<detail::BlocksGainCompensator>());
|
||||||
stitcher->setBlender(makePtr<detail::MultiBandBlender>(try_use_gpu));
|
stitcher->setBlender(makePtr<detail::MultiBandBlender>(try_use_gpu));
|
||||||
|
|
||||||
return stitcher;
|
return stitcher;
|
||||||
}
|
}
|
||||||
} // namespace cv
|
} // namespace cv
|
||||||
|
Loading…
Reference in New Issue
Block a user