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

This commit is contained in:
Vladislav Vinogradov
2013-06-04 13:32:35 +04:00
parent 10340fe234
commit 3eeaa9189c
472 changed files with 29894 additions and 23019 deletions

View File

@@ -187,12 +187,14 @@ Rect FeatherBlender::createWeightMaps(const std::vector<Mat> &masks, const std::
MultiBandBlender::MultiBandBlender(int try_gpu, int num_bands, int weight_type)
{
setNumBands(num_bands);
#ifdef HAVE_OPENCV_GPU
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
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;
}
@@ -489,7 +491,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)
{
#ifdef HAVE_OPENCV_GPU
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
pyr.resize(num_levels + 1);
std::vector<gpu::GpuMat> gpu_pyr(num_levels + 1);
@@ -529,7 +531,7 @@ void restoreImageFromLaplacePyr(std::vector<Mat> &pyr)
void restoreImageFromLaplacePyrGpu(std::vector<Mat> &pyr)
{
#ifdef HAVE_OPENCV_GPU
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING)
if (pyr.empty())
return;