fix cudabgsegm module compilation
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Thu, 31 Jul 2014 13:55:59 +0000 (17:55 +0400)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Thu, 31 Jul 2014 13:55:59 +0000 (17:55 +0400)
modules/cudabgsegm/CMakeLists.txt
modules/cudabgsegm/perf/perf_bgsegm.cpp
modules/cudabgsegm/test/test_bgsegm.cpp

index 3a88282..41517b6 100644 (file)
@@ -6,4 +6,4 @@ set(the_description "CUDA-accelerated Background Segmentation")
 
 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 /wd4324 /wd4512 -Wundef -Wmissing-declarations)
 
-ocv_define_module(cudabgsegm opencv_video OPTIONAL opencv_legacy opencv_imgproc opencv_cudaarithm opencv_cudafilters opencv_cudaimgproc)
+ocv_define_module(cudabgsegm opencv_video OPTIONAL opencv_imgproc opencv_cudaarithm opencv_cudafilters opencv_cudaimgproc)
index 02fc9a8..6e1ab46 100644 (file)
 
 #include "perf_precomp.hpp"
 
-#ifdef HAVE_OPENCV_CUDALEGACY
-#  include "opencv2/cudalegacy.hpp"
-#endif
-
 #ifdef HAVE_OPENCV_CUDAIMGPROC
 #  include "opencv2/cudaimgproc.hpp"
 #endif
@@ -72,18 +68,6 @@ using namespace perf;
 
 #if BUILD_WITH_VIDEO_INPUT_SUPPORT
 
-#ifdef HAVE_OPENCV_CUDALEGACY
-
-namespace cv
-{
-    template<> void DefaultDeleter<CvBGStatModel>::operator ()(CvBGStatModel* obj) const
-    {
-        cvReleaseBGStatModel(&obj);
-    }
-}
-
-#endif
-
 DEF_PARAM_TEST_1(Video, string);
 
 PERF_TEST_P(Video, FGDStatModel,
@@ -150,48 +134,7 @@ PERF_TEST_P(Video, FGDStatModel,
     }
     else
     {
-#ifdef HAVE_OPENCV_CUDALEGACY
-        IplImage ipl_frame = frame;
-        cv::Ptr<CvBGStatModel> model(cvCreateFGDStatModel(&ipl_frame));
-
-        int i = 0;
-
-        // collect performance data
-        for (; i < numIters; ++i)
-        {
-            cap >> frame;
-            ASSERT_FALSE(frame.empty());
-
-            ipl_frame = frame;
-
-            startTimer();
-            if(!next())
-                break;
-
-            cvUpdateBGStatModel(&ipl_frame, model);
-
-            stopTimer();
-        }
-
-        // process last frame in sequence to get data for sanity test
-        for (; i < numIters; ++i)
-        {
-            cap >> frame;
-            ASSERT_FALSE(frame.empty());
-
-            ipl_frame = frame;
-
-            cvUpdateBGStatModel(&ipl_frame, model);
-        }
-
-        const cv::Mat background = cv::cvarrToMat(model->background);
-        const cv::Mat foreground = cv::cvarrToMat(model->foreground);
-
-        CPU_SANITY_CHECK(background);
-        CPU_SANITY_CHECK(foreground);
-#else
         FAIL_NO_CPU();
-#endif
     }
 }
 
index 34f3dcc..89fd694 100644 (file)
 
 #include "test_precomp.hpp"
 
-#ifdef HAVE_OPENCV_CUDALEGACY
-#  include "opencv2/cudalegacy.hpp"
-#endif
-
 #ifdef HAVE_CUDA
 
 using namespace cvtest;
@@ -64,80 +60,6 @@ using namespace cvtest;
 #endif
 
 //////////////////////////////////////////////////////
-// FGDStatModel
-
-#if BUILD_WITH_VIDEO_INPUT_SUPPORT && defined(HAVE_OPENCV_CUDALEGACY)
-
-namespace cv
-{
-    template<> void DefaultDeleter<CvBGStatModel>::operator ()(CvBGStatModel* obj) const
-    {
-        cvReleaseBGStatModel(&obj);
-    }
-}
-
-PARAM_TEST_CASE(FGDStatModel, cv::cuda::DeviceInfo, std::string)
-{
-    cv::cuda::DeviceInfo devInfo;
-    std::string inputFile;
-
-    virtual void SetUp()
-    {
-        devInfo = GET_PARAM(0);
-        cv::cuda::setDevice(devInfo.deviceID());
-
-        inputFile = std::string(cvtest::TS::ptr()->get_data_path()) + "video/" + GET_PARAM(1);
-    }
-};
-
-CUDA_TEST_P(FGDStatModel, Update)
-{
-    cv::VideoCapture cap(inputFile);
-    ASSERT_TRUE(cap.isOpened());
-
-    cv::Mat frame;
-    cap >> frame;
-    ASSERT_FALSE(frame.empty());
-
-    IplImage ipl_frame = frame;
-    cv::Ptr<CvBGStatModel> model(cvCreateFGDStatModel(&ipl_frame));
-
-    cv::cuda::GpuMat d_frame(frame);
-    cv::Ptr<cv::cuda::BackgroundSubtractorFGD> d_fgd = cv::cuda::createBackgroundSubtractorFGD();
-    cv::cuda::GpuMat d_foreground, d_background;
-    std::vector< std::vector<cv::Point> > foreground_regions;
-    d_fgd->apply(d_frame, d_foreground);
-
-    for (int i = 0; i < 5; ++i)
-    {
-        cap >> frame;
-        ASSERT_FALSE(frame.empty());
-
-        ipl_frame = frame;
-        int gold_count = cvUpdateBGStatModel(&ipl_frame, model);
-
-        d_frame.upload(frame);
-        d_fgd->apply(d_frame, d_foreground);
-        d_fgd->getBackgroundImage(d_background);
-        d_fgd->getForegroundRegions(foreground_regions);
-        int count = (int) foreground_regions.size();
-
-        cv::Mat gold_background = cv::cvarrToMat(model->background);
-        cv::Mat gold_foreground = cv::cvarrToMat(model->foreground);
-
-        ASSERT_MAT_NEAR(gold_background, d_background, 1.0);
-        ASSERT_MAT_NEAR(gold_foreground, d_foreground, 0.0);
-        ASSERT_EQ(gold_count, count);
-    }
-}
-
-INSTANTIATE_TEST_CASE_P(CUDA_BgSegm, FGDStatModel, testing::Combine(
-    ALL_DEVICES,
-    testing::Values(std::string("768x576.avi"))));
-
-#endif
-
-//////////////////////////////////////////////////////
 // MOG
 
 #if BUILD_WITH_VIDEO_INPUT_SUPPORT