Revert "Merge pull request #836 from jet47:gpu-modules"

This reverts commit fba72cb60d, reversing
changes made to 02131ffb62.
This commit is contained in:
Andrey Kamaev
2013-04-18 15:03:50 +04:00
parent fba72cb60d
commit 416fb50594
472 changed files with 22945 additions and 29803 deletions

View File

@@ -187,14 +187,12 @@ Rect FeatherBlender::createWeightMaps(const std::vector<Mat> &masks, const std::
MultiBandBlender::MultiBandBlender(int try_gpu, int num_bands, int weight_type)
{
setNumBands(num_bands);
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
#ifdef HAVE_OPENCV_GPU
can_use_gpu_ = try_gpu && gpu::getCudaEnabledDeviceCount();
#else
(void) try_gpu;
(void)try_gpu;
can_use_gpu_ = false;
#endif
CV_Assert(weight_type == CV_32F || weight_type == CV_16S);
weight_type_ = weight_type;
}
@@ -491,7 +489,7 @@ void createLaplacePyr(const Mat &img, int num_levels, std::vector<Mat> &pyr)
void createLaplacePyrGpu(const Mat &img, int num_levels, std::vector<Mat> &pyr)
{
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
#ifdef HAVE_OPENCV_GPU
pyr.resize(num_levels + 1);
std::vector<gpu::GpuMat> gpu_pyr(num_levels + 1);
@@ -531,7 +529,7 @@ void restoreImageFromLaplacePyr(std::vector<Mat> &pyr)
void restoreImageFromLaplacePyrGpu(std::vector<Mat> &pyr)
{
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
#ifdef HAVE_OPENCV_GPU
if (pyr.empty())
return;

View File

@@ -44,7 +44,10 @@
using namespace cv;
using namespace cv::detail;
#ifdef HAVE_OPENCV_GPU
using namespace cv::gpu;
#endif
#ifdef HAVE_OPENCV_NONFREE
#include "opencv2/nonfree.hpp"
@@ -129,7 +132,7 @@ private:
float match_conf_;
};
#ifdef HAVE_OPENCV_GPUFEATURES2D
#ifdef HAVE_OPENCV_GPU
class GpuMatcher : public FeaturesMatcher
{
public:
@@ -204,7 +207,7 @@ void CpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat
LOG("1->2 & 2->1 matches: " << matches_info.matches.size() << endl);
}
#ifdef HAVE_OPENCV_GPUFEATURES2D
#ifdef HAVE_OPENCV_GPU
void GpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info)
{
matches_info.matches.clear();
@@ -432,7 +435,7 @@ void OrbFeaturesFinder::find(const Mat &image, ImageFeatures &features)
}
}
#ifdef HAVE_OPENCV_NONFREE
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU)
SurfFeaturesFinderGpu::SurfFeaturesFinderGpu(double hess_thresh, int num_octaves, int num_layers,
int num_octaves_descr, int num_layers_descr)
{
@@ -533,18 +536,14 @@ void FeaturesMatcher::operator ()(const std::vector<ImageFeatures> &features, st
BestOf2NearestMatcher::BestOf2NearestMatcher(bool try_use_gpu, float match_conf, int num_matches_thresh1, int num_matches_thresh2)
{
(void)try_use_gpu;
#ifdef HAVE_OPENCV_GPUFEATURES2D
#ifdef HAVE_OPENCV_GPU
if (try_use_gpu && getCudaEnabledDeviceCount() > 0)
{
impl_ = new GpuMatcher(match_conf);
}
else
#else
(void)try_use_gpu;
#endif
{
impl_ = new CpuMatcher(match_conf);
}
is_thread_safe_ = impl_->isThreadSafe();
num_matches_thresh1_ = num_matches_thresh1;

View File

@@ -66,25 +66,11 @@
#include "opencv2/imgproc.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/calib3d.hpp"
#ifdef HAVE_OPENCV_GPUARITHM
# include "opencv2/gpuarithm.hpp"
#endif
#ifdef HAVE_OPENCV_GPUWARPING
# include "opencv2/gpuwarping.hpp"
#endif
#ifdef HAVE_OPENCV_GPUFEATURES2D
# include "opencv2/gpufeatures2d.hpp"
#endif
#ifdef HAVE_OPENCV_GPU
# include "opencv2/gpu.hpp"
#endif
#ifdef HAVE_OPENCV_NONFREE
# include "opencv2/nonfree/gpu.hpp"
# ifdef HAVE_OPENCV_NONFREE
# include "opencv2/nonfree/gpu.hpp"
# endif
#endif
#include "../../imgproc/src/gcgraph.hpp"

View File

@@ -59,7 +59,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu)
#ifdef HAVE_OPENCV_GPU
if (try_use_gpu && gpu::getCudaEnabledDeviceCount() > 0)
{
#ifdef HAVE_OPENCV_NONFREE
#if defined(HAVE_OPENCV_NONFREE)
stitcher.setFeaturesFinder(new detail::SurfFeaturesFinderGpu());
#else
stitcher.setFeaturesFinder(new detail::OrbFeaturesFinder());

View File

@@ -210,7 +210,7 @@ void SphericalWarper::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_b
}
#ifdef HAVE_OPENCV_GPUWARPING
#ifdef HAVE_OPENCV_GPU
Rect PlaneWarperGpu::buildMaps(Size src_size, const Mat &K, const Mat &R, gpu::GpuMat &xmap, gpu::GpuMat &ymap)
{
return buildMaps(src_size, K, R, Mat::zeros(3, 1, CV_32F), xmap, ymap);