nonfree module fixes
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Thu, 18 Apr 2013 06:10:55 +0000 (10:10 +0400)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Thu, 18 Apr 2013 08:36:11 +0000 (12:36 +0400)
modules/nonfree/CMakeLists.txt
modules/nonfree/include/opencv2/nonfree/gpu.hpp
modules/nonfree/perf/perf_gpu.cpp
modules/nonfree/perf/perf_precomp.hpp
modules/nonfree/src/cuda/surf.cu
modules/nonfree/src/cuda/vibe.cu
modules/nonfree/src/precomp.hpp
modules/nonfree/src/surf_gpu.cpp
modules/nonfree/src/vibe_gpu.cpp
modules/nonfree/test/test_gpu.cpp
modules/nonfree/test/test_precomp.hpp

index 55f6b41..fa73931 100644 (file)
@@ -3,4 +3,5 @@ if(BUILD_ANDROID_PACKAGE)
 endif()
 
 set(the_description "Functionality with possible limitations on the use")
-ocv_define_module(nonfree opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_gpu opencv_ocl)
+ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
+ocv_define_module(nonfree opencv_imgproc opencv_features2d opencv_calib3d OPTIONAL opencv_gpuarithm opencv_ocl)
index aa0c9cb..1be62b2 100644 (file)
 #ifndef __OPENCV_NONFREE_GPU_HPP__
 #define __OPENCV_NONFREE_GPU_HPP__
 
-#include "opencv2/opencv_modules.hpp"
-
-#if defined(HAVE_OPENCV_GPU)
-
-#include "opencv2/gpu.hpp"
+#include "opencv2/core/gpumat.hpp"
 
 namespace cv { namespace gpu {
 
@@ -160,10 +156,6 @@ private:
     GpuMat samples_;
 };
 
-} // namespace gpu
-
-} // namespace cv
-
-#endif // defined(HAVE_OPENCV_GPU)
+}} // namespace cv { namespace gpu {
 
 #endif // __OPENCV_NONFREE_GPU_HPP__
index eeaf5a7..3caa5a2 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "perf_precomp.hpp"
 
-#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA)
+#ifdef HAVE_CUDA
 
 #include "opencv2/ts/gpu_perf.hpp"
 
@@ -65,6 +65,8 @@ using namespace perf;
 //////////////////////////////////////////////////////////////////////
 // SURF
 
+#ifdef HAVE_OPENCV_GPUARITHM
+
 DEF_PARAM_TEST_1(Image, string);
 
 PERF_TEST_P(Image, GPU_SURF,
@@ -108,6 +110,8 @@ PERF_TEST_P(Image, GPU_SURF,
     }
 }
 
+#endif // HAVE_OPENCV_GPUARITHM
+
 //////////////////////////////////////////////////////
 // VIBE
 
@@ -177,6 +181,6 @@ PERF_TEST_P(Video_Cn, GPU_VIBE,
     }
 }
 
-#endif
+#endif // BUILD_WITH_VIDEO_INPUT_SUPPORT
 
-#endif
+#endif // HAVE_CUDA
index 13e1616..5e3f3c3 100644 (file)
@@ -19,9 +19,8 @@
 #  include "opencv2/nonfree/ocl.hpp"
 #endif
 
-#ifdef HAVE_OPENCV_GPU
-    #include "opencv2/nonfree/gpu.hpp"
-    #include "opencv2/ts/gpu_perf.hpp"
+#ifdef HAVE_CUDA
+#  include "opencv2/nonfree/gpu.hpp"
 #endif
 
 #ifdef GTEST_CREATE_SHARED_LIBRARY
index 46e8d2e..cdd54e4 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "opencv2/opencv_modules.hpp"
 
-#ifdef HAVE_OPENCV_GPU
+#ifdef HAVE_OPENCV_GPUARITHM
 
 #include "opencv2/core/cuda/common.hpp"
 #include "opencv2/core/cuda/limits.hpp"
@@ -957,5 +957,4 @@ namespace cv { namespace gpu { namespace cudev
     } // namespace surf
 }}} // namespace cv { namespace gpu { namespace cudev
 
-
-#endif /* CUDA_DISABLER */
+#endif // HAVE_OPENCV_GPUARITHM
index b896e6a..951b964 100644 (file)
 //
 //M*/
 
-#include "opencv2/opencv_modules.hpp"
-
-#ifdef HAVE_OPENCV_GPU
-
 #include "opencv2/core/cuda/common.hpp"
 
 namespace cv { namespace gpu { namespace cudev
@@ -267,5 +263,3 @@ namespace cv { namespace gpu { namespace cudev
         }
     }
 }}}
-
-#endif
index cc0098c..f89e156 100644 (file)
 #include "opencv2/core/utility.hpp"
 #include "opencv2/core/private.hpp"
 
+#include "opencv2/nonfree/gpu.hpp"
+#include "opencv2/core/gpu_private.hpp"
+
 #include "opencv2/opencv_modules.hpp"
 
-#ifdef HAVE_OPENCV_GPU
-#  include "opencv2/nonfree/gpu.hpp"
-#  include "opencv2/core/gpu_private.hpp"
+#ifdef HAVE_OPENCV_GPUARITHM
+#  include "opencv2/gpuarithm.hpp"
 #endif
 
 #ifdef HAVE_OPENCV_OCL
index 328b3cb..ace9bb5 100644 (file)
 
 #include "precomp.hpp"
 
-#if defined(HAVE_OPENCV_GPU)
-
 using namespace cv;
 using namespace cv::gpu;
 
-#if !defined (HAVE_CUDA)
+#if !defined (HAVE_CUDA) || !defined (HAVE_OPENCV_GPUARITHM)
 
 cv::gpu::SURF_GPU::SURF_GPU() { throw_no_cuda(); }
 cv::gpu::SURF_GPU::SURF_GPU(double, int, int, bool, float, bool) { throw_no_cuda(); }
@@ -144,13 +142,13 @@ namespace
 
             bindImgTex(img);
 
-            integralBuffered(img, surf_.sum, surf_.intBuffer);
+            gpu::integralBuffered(img, surf_.sum, surf_.intBuffer);
             sumOffset = bindSumTex(surf_.sum);
 
             if (use_mask)
             {
                 min(mask, 1.0, surf_.mask1);
-                integralBuffered(surf_.mask1, surf_.maskSum, surf_.intBuffer);
+                gpu::integralBuffered(surf_.mask1, surf_.maskSum, surf_.intBuffer);
                 maskOffset = bindMaskSumTex(surf_.maskSum);
             }
         }
@@ -421,5 +419,3 @@ void cv::gpu::SURF_GPU::releaseMemory()
 }
 
 #endif // !defined (HAVE_CUDA)
-
-#endif // defined(HAVE_OPENCV_GPU)
index 6bf9938..2d291fb 100644 (file)
@@ -42,9 +42,7 @@
 
 #include "precomp.hpp"
 
-#if defined(HAVE_OPENCV_GPU)
-
-#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
+#ifndef HAVE_CUDA
 
 cv::gpu::VIBE_GPU::VIBE_GPU(unsigned long) { throw_no_cuda(); }
 void cv::gpu::VIBE_GPU::initialize(const GpuMat&, Stream&) { throw_no_cuda(); }
@@ -137,5 +135,3 @@ void cv::gpu::VIBE_GPU::release()
 }
 
 #endif
-
-#endif // defined(HAVE_OPENCV_GPU)
index 30aec35..42b2d06 100644 (file)
 
 #include "test_precomp.hpp"
 
-#if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA)
+#ifdef HAVE_CUDA
 
 using namespace cvtest;
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 // SURF
 
+#ifdef HAVE_OPENCV_GPUARITHM
+
 namespace
 {
     IMPLEMENT_PARAM_CLASS(SURF_HessianThreshold, double)
@@ -191,6 +193,8 @@ INSTANTIATE_TEST_CASE_P(GPU_Features2D, SURF, testing::Combine(
     testing::Values(SURF_Extended(false), SURF_Extended(true)),
     testing::Values(SURF_Upright(false), SURF_Upright(true))));
 
+#endif // HAVE_OPENCV_GPUARITHM
+
 //////////////////////////////////////////////////////
 // VIBE
 
@@ -229,4 +233,4 @@ INSTANTIATE_TEST_CASE_P(GPU_Video, VIBE, testing::Combine(
     testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4)),
     WHOLE_SUBMAT));
 
-#endif
+#endif // HAVE_CUDA
index cacf372..563dad4 100644 (file)
@@ -24,7 +24,7 @@
 #  include "opencv2/nonfree/ocl.hpp"
 #endif
 
-#ifdef HAVE_OPENCV_GPU
+#ifdef HAVE_CUDA
 #  include "opencv2/nonfree/gpu.hpp"
 #endif