From fd10557e78731885370c2df78af7152fe8ee82c2 Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Thu, 31 Jul 2014 09:21:44 +0200 Subject: [PATCH] Removed cvCalcOpticalFlowBM from cudaoptflow test --- modules/cudaoptflow/test/test_optflow.cpp | 30 +---------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/modules/cudaoptflow/test/test_optflow.cpp b/modules/cudaoptflow/test/test_optflow.cpp index 110fed0339..d537f5b4c2 100644 --- a/modules/cudaoptflow/test/test_optflow.cpp +++ b/modules/cudaoptflow/test/test_optflow.cpp @@ -41,7 +41,6 @@ //M*/ #include "test_precomp.hpp" -#include "opencv2/legacy.hpp" #ifdef HAVE_CUDA @@ -373,32 +372,11 @@ INSTANTIATE_TEST_CASE_P(CUDA_OptFlow, OpticalFlowDual_TVL1, testing::Combine( ////////////////////////////////////////////////////// // OpticalFlowBM -namespace -{ - void calcOpticalFlowBM(const cv::Mat& prev, const cv::Mat& curr, - cv::Size bSize, cv::Size shiftSize, cv::Size maxRange, int usePrevious, - cv::Mat& velx, cv::Mat& vely) - { - cv::Size sz((curr.cols - bSize.width + shiftSize.width)/shiftSize.width, (curr.rows - bSize.height + shiftSize.height)/shiftSize.height); - - velx.create(sz, CV_32FC1); - vely.create(sz, CV_32FC1); - - CvMat cvprev = prev; - CvMat cvcurr = curr; - - CvMat cvvelx = velx; - CvMat cvvely = vely; - - cvCalcOpticalFlowBM(&cvprev, &cvcurr, bSize, shiftSize, maxRange, usePrevious, &cvvelx, &cvvely); - } -} - struct OpticalFlowBM : testing::TestWithParam { }; -CUDA_TEST_P(OpticalFlowBM, Accuracy) +CUDA_TEST_P(OpticalFlowBM, BlockMatching) { cv::cuda::DeviceInfo devInfo = GetParam(); cv::cuda::setDevice(devInfo.deviceID()); @@ -419,12 +397,6 @@ CUDA_TEST_P(OpticalFlowBM, Accuracy) cv::cuda::calcOpticalFlowBM(loadMat(frame0), loadMat(frame1), block_size, shift_size, max_range, false, d_velx, d_vely, buf); - - cv::Mat velx, vely; - calcOpticalFlowBM(frame0, frame1, block_size, shift_size, max_range, false, velx, vely); - - EXPECT_MAT_NEAR(velx, d_velx, 0); - EXPECT_MAT_NEAR(vely, d_vely, 0); } INSTANTIATE_TEST_CASE_P(CUDA_OptFlow, OpticalFlowBM, ALL_DEVICES);