superres module fixes

pull/836/head
Vladislav Vinogradov 12 years ago
parent f375c86dfb
commit 033dd77504
  1. 4
      modules/superres/CMakeLists.txt
  2. 7
      modules/superres/src/btv_l1_gpu.cpp
  3. 6
      modules/superres/src/cuda/btv_l1_gpu.cu
  4. 2
      modules/superres/src/input_array_utility.cpp
  5. 6
      modules/superres/src/optical_flow.cpp
  6. 23
      modules/superres/src/precomp.hpp
  7. 2
      modules/superres/test/test_superres.cpp

@ -4,4 +4,6 @@ endif()
set(the_description "Super Resolution")
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 -Wundef)
ocv_define_module(superres opencv_imgproc opencv_video OPTIONAL opencv_highgui opencv_gpu opencv_gpuarithm opencv_gpufilters opencv_gpucodec)
ocv_define_module(superres opencv_imgproc opencv_video
OPTIONAL opencv_highgui
opencv_gpuarithm opencv_gpufilters opencv_gpuwarping opencv_gpuimgproc opencv_gpuoptflow opencv_gpucodec)

@ -50,7 +50,7 @@ using namespace cv::gpu;
using namespace cv::superres;
using namespace cv::superres::detail;
#if !defined(HAVE_CUDA) || !defined(HAVE_OPENCV_GPU)
#if !defined(HAVE_CUDA) || !defined(HAVE_OPENCV_GPUARITHM) || !defined(HAVE_OPENCV_GPUWARPING) || !defined(HAVE_OPENCV_GPUFILTERS)
Ptr<SuperResolution> cv::superres::createSuperResolution_BTVL1_GPU()
{
@ -266,7 +266,12 @@ namespace
btvKernelSize_ = 7;
blurKernelSize_ = 5;
blurSigma_ = 0.0;
#ifdef HAVE_OPENCV_GPUOPTFLOW
opticalFlow_ = createOptFlow_Farneback_GPU();
#else
opticalFlow_ = createOptFlow_Farneback();
#endif
curBlurKernelSize_ = -1;
curBlurSigma_ = -1.0;

@ -40,6 +40,10 @@
//
//M*/
#include "opencv2/opencv_modules.hpp"
#if defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING) && defined(HAVE_OPENCV_GPUFILTERS)
#include "opencv2/core/cuda/common.hpp"
#include "opencv2/core/cuda/transform.hpp"
#include "opencv2/core/cuda/vec_traits.hpp"
@ -232,3 +236,5 @@ namespace btv_l1_cudev
template void calcBtvRegularization<3>(PtrStepSzb src, PtrStepSzb dst, int ksize);
template void calcBtvRegularization<4>(PtrStepSzb src, PtrStepSzb dst, int ksize);
}
#endif

@ -177,7 +177,7 @@ namespace
switch (src.kind())
{
case _InputArray::GPU_MAT:
#ifdef HAVE_OPENCV_GPU
#ifdef HAVE_OPENCV_GPUIMGPROC
gpu::cvtColor(src.getGpuMat(), dst.getGpuMatRef(), code, cn);
#else
CV_Error(cv::Error::StsNotImplemented, "The called functionality is disabled for current build or platform");

@ -343,7 +343,7 @@ Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_DualTVL1()
///////////////////////////////////////////////////////////////////
// GpuOpticalFlow
#ifndef HAVE_OPENCV_GPU
#ifndef HAVE_OPENCV_GPUOPTFLOW
Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_Farneback_GPU()
{
@ -369,7 +369,7 @@ Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_PyrLK_GPU()
return Ptr<DenseOpticalFlowExt>();
}
#else // HAVE_OPENCV_GPU
#else // HAVE_OPENCV_GPUOPTFLOW
namespace
{
@ -717,4 +717,4 @@ Ptr<DenseOpticalFlowExt> cv::superres::createOptFlow_DualTVL1_GPU()
return new DualTVL1_GPU;
}
#endif // HAVE_OPENCV_GPU
#endif // HAVE_OPENCV_GPUOPTFLOW

@ -55,9 +55,26 @@
#include "opencv2/video/tracking.hpp"
#include "opencv2/core/private.hpp"
#ifdef HAVE_OPENCV_GPU
# include "opencv2/gpu.hpp"
# include "opencv2/core/gpu_private.hpp"
#include "opencv2/core/gpu_private.hpp"
#ifdef HAVE_OPENCV_GPUARITHM
# include "opencv2/gpuarithm.hpp"
#endif
#ifdef HAVE_OPENCV_GPUWARPING
# include "opencv2/gpuwarping.hpp"
#endif
#ifdef HAVE_OPENCV_GPUFILTERS
# include "opencv2/gpufilters.hpp"
#endif
#ifdef HAVE_OPENCV_GPUIMGPROC
# include "opencv2/gpuimgproc.hpp"
#endif
#ifdef HAVE_OPENCV_GPUOPTFLOW
# include "opencv2/gpuoptflow.hpp"
#endif
#ifdef HAVE_OPENCV_GPUCODEC

@ -268,7 +268,7 @@ TEST_F(SuperResolution, BTVL1)
RunTest(cv::superres::createSuperResolution_BTVL1());
}
#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA)
#if defined(HAVE_CUDA) && defined(HAVE_OPENCV_GPUARITHM) && defined(HAVE_OPENCV_GPUWARPING) && defined(HAVE_OPENCV_GPUFILTERS)
TEST_F(SuperResolution, BTVL1_GPU)
{

Loading…
Cancel
Save