diff --git a/modules/gpu/src/hough.cpp b/modules/gpu/src/hough.cpp index a1e7033436..9a39ac6062 100644 --- a/modules/gpu/src/hough.cpp +++ b/modules/gpu/src/hough.cpp @@ -68,6 +68,8 @@ void cv::gpu::GeneralizedHough_GPU::release() {} #else /* !defined (HAVE_CUDA) */ +#include "opencv2/core/utility.hpp" + namespace cv { namespace gpu { namespace device { namespace hough diff --git a/modules/gpu/src/matrix_reductions.cpp b/modules/gpu/src/matrix_reductions.cpp index 67e65fc585..23906f95e9 100644 --- a/modules/gpu/src/matrix_reductions.cpp +++ b/modules/gpu/src/matrix_reductions.cpp @@ -71,6 +71,7 @@ int cv::gpu::countNonZero(const GpuMat&, GpuMat&) { throw_nogpu(); return 0; } void cv::gpu::reduce(const GpuMat&, GpuMat&, int, int, int, Stream&) { throw_nogpu(); } #else +#include "opencv2/core/utility.hpp" namespace { diff --git a/modules/gpu/src/stereocsbp.cpp b/modules/gpu/src/stereocsbp.cpp index 797184f1af..4fc6d04001 100644 --- a/modules/gpu/src/stereocsbp.cpp +++ b/modules/gpu/src/stereocsbp.cpp @@ -55,6 +55,7 @@ cv::gpu::StereoConstantSpaceBP::StereoConstantSpaceBP(int, int, int, int, float, void cv::gpu::StereoConstantSpaceBP::operator()(const GpuMat&, const GpuMat&, GpuMat&, Stream&) { throw_nogpu(); } #else /* !defined (HAVE_CUDA) */ +#include "opencv2/core/utility.hpp" namespace cv { namespace gpu { namespace device { diff --git a/modules/gpu/test/test_bgfg.cpp b/modules/gpu/test/test_bgfg.cpp index 8e98e5fca9..f17a1e65ba 100644 --- a/modules/gpu/test/test_bgfg.cpp +++ b/modules/gpu/test/test_bgfg.cpp @@ -194,7 +194,7 @@ GPU_TEST_P(MOG, Update) cv::gpu::MOG_GPU mog; cv::gpu::GpuMat foreground = createMat(frame.size(), CV_8UC1, useRoi); - cv::BackgroundSubtractorMOG mog_gold; + cv::Ptr mog_gold = cv::createBackgroundSubtractorMOG(); cv::Mat foreground_gold; for (int i = 0; i < 10; ++i) @@ -211,7 +211,7 @@ GPU_TEST_P(MOG, Update) mog(loadMat(frame, useRoi), foreground, (float)learningRate); - mog_gold(frame, foreground_gold, learningRate); + mog_gold->apply(frame, foreground_gold, learningRate); ASSERT_MAT_NEAR(foreground_gold, foreground, 0.0); } @@ -270,7 +270,7 @@ GPU_TEST_P(MOG2, Update) cv::gpu::GpuMat foreground = createMat(frame.size(), CV_8UC1, useRoi); cv::Ptr mog2_gold = cv::createBackgroundSubtractorMOG2(); - mog2_gold.setDetectShadows(detectShadow); + mog2_gold->setDetectShadows(detectShadow); cv::Mat foreground_gold; for (int i = 0; i < 10; ++i) @@ -315,7 +315,7 @@ GPU_TEST_P(MOG2, getBackgroundImage) cv::gpu::GpuMat foreground; cv::Ptr mog2_gold = cv::createBackgroundSubtractorMOG2(); - mog2_gold.setDetectShadows(detectShadow); + mog2_gold->setDetectShadows(detectShadow); cv::Mat foreground_gold; for (int i = 0; i < 10; ++i) diff --git a/modules/nonfree/perf/perf_gpu.cpp b/modules/nonfree/perf/perf_gpu.cpp index c00955c894..e4c4bf40e8 100644 --- a/modules/nonfree/perf/perf_gpu.cpp +++ b/modules/nonfree/perf/perf_gpu.cpp @@ -24,7 +24,7 @@ using namespace perf; DEF_PARAM_TEST_1(Image, string); PERF_TEST_P(Image, GPU_SURF, - Values("gpu/perf/aloe.png")) + Values("gpu/perf/aloe.png")) { declare.time(50.0); diff --git a/modules/nonfree/perf/perf_precomp.hpp b/modules/nonfree/perf/perf_precomp.hpp index 205045b1dc..90b50331ee 100644 --- a/modules/nonfree/perf/perf_precomp.hpp +++ b/modules/nonfree/perf/perf_precomp.hpp @@ -20,6 +20,7 @@ #if defined(HAVE_OPENCV_GPU) && defined(HAVE_CUDA) #include "opencv2/nonfree/gpu.hpp" + #include "opencv2/ts/gpu_perf.hpp" #endif #ifdef GTEST_CREATE_SHARED_LIBRARY diff --git a/modules/nonfree/src/precomp.hpp b/modules/nonfree/src/precomp.hpp index 7b1445b1f9..9ba4136fae 100644 --- a/modules/nonfree/src/precomp.hpp +++ b/modules/nonfree/src/precomp.hpp @@ -59,7 +59,7 @@ #include "opencv2/nonfree/gpu.hpp" #if defined(HAVE_CUDA) - #include "opencv2/gpu/stream_accessor.hpp" + #include "opencv2/core/stream_accessor.hpp" #include "opencv2/gpu/device/common.hpp" static inline void throw_nogpu() { CV_Error(CV_StsNotImplemented, "The called functionality is disabled for current build or platform"); } diff --git a/modules/nonfree/test/test_main.cpp b/modules/nonfree/test/test_main.cpp index c9e33a9431..757d0a095a 100644 --- a/modules/nonfree/test/test_main.cpp +++ b/modules/nonfree/test/test_main.cpp @@ -21,7 +21,7 @@ int main(int argc, char **argv) if (cmd.get("help")) { - cmd.printParams(); + cmd.printMessage(); return 0; } diff --git a/modules/superres/src/btv_l1_gpu.cpp b/modules/superres/src/btv_l1_gpu.cpp index 36b69708f3..5a24588676 100644 --- a/modules/superres/src/btv_l1_gpu.cpp +++ b/modules/superres/src/btv_l1_gpu.cpp @@ -78,8 +78,8 @@ namespace btv_l1_device namespace { - void calcRelativeMotions(const vector >& forwardMotions, const vector >& backwardMotions, - vector >& relForwardMotions, vector >& relBackwardMotions, + void calcRelativeMotions(const std::vector >& forwardMotions, const std::vector >& backwardMotions, + std::vector >& relForwardMotions, std::vector >& relBackwardMotions, int baseIdx, Size size) { const int count = static_cast(forwardMotions.size()); @@ -115,7 +115,7 @@ namespace } } - void upscaleMotions(const vector >& lowResMotions, vector >& highResMotions, int scale) + void upscaleMotions(const std::vector >& lowResMotions, std::vector >& highResMotions, int scale) { highResMotions.resize(lowResMotions.size()); @@ -129,8 +129,8 @@ namespace } } - void buildMotionMaps(const pair& forwardMotion, const pair& backwardMotion, - pair& forwardMap, pair& backwardMap) + void buildMotionMaps(const std::pair& forwardMotion, const std::pair& backwardMotion, + std::pair& forwardMap, std::pair& backwardMap) { forwardMap.first.create(forwardMotion.first.size(), CV_32FC1); forwardMap.second.create(forwardMotion.first.size(), CV_32FC1); @@ -169,7 +169,7 @@ namespace btv_l1_device::diffSign(src1.reshape(1), src2.reshape(1), dst.reshape(1), StreamAccessor::getStream(stream)); } - void calcBtvWeights(int btvKernelSize, double alpha, vector& btvWeights) + void calcBtvWeights(int btvKernelSize, double alpha, std::vector& btvWeights) { const size_t size = btvKernelSize * btvKernelSize; @@ -212,8 +212,8 @@ namespace public: BTVL1_GPU_Base(); - void process(const vector& src, GpuMat& dst, - const vector >& forwardMotions, const vector >& backwardMotions, + void process(const std::vector& src, GpuMat& dst, + const std::vector >& forwardMotions, const std::vector >& backwardMotions, int baseIdx); void collectGarbage(); @@ -230,29 +230,29 @@ namespace Ptr opticalFlow_; private: - vector > filters_; + std::vector > filters_; int curBlurKernelSize_; double curBlurSigma_; int curSrcType_; - vector btvWeights_; + std::vector btvWeights_; int curBtvKernelSize_; double curAlpha_; - vector > lowResForwardMotions_; - vector > lowResBackwardMotions_; + std::vector > lowResForwardMotions_; + std::vector > lowResBackwardMotions_; - vector > highResForwardMotions_; - vector > highResBackwardMotions_; + std::vector > highResForwardMotions_; + std::vector > highResBackwardMotions_; - vector > forwardMaps_; - vector > backwardMaps_; + std::vector > forwardMaps_; + std::vector > backwardMaps_; GpuMat highRes_; - vector streams_; - vector diffTerms_; - vector a_, b_, c_; + std::vector streams_; + std::vector diffTerms_; + std::vector a_, b_, c_; GpuMat regTerm_; }; @@ -276,8 +276,8 @@ namespace curAlpha_ = -1.0; } - void BTVL1_GPU_Base::process(const vector& src, GpuMat& dst, - const vector >& forwardMotions, const vector >& backwardMotions, + void BTVL1_GPU_Base::process(const std::vector& src, GpuMat& dst, + const std::vector >& forwardMotions, const std::vector >& backwardMotions, int baseIdx) { CV_Assert( scale_ > 1 ); @@ -418,18 +418,18 @@ namespace GpuMat curFrame_; GpuMat prevFrame_; - vector frames_; - vector > forwardMotions_; - vector > backwardMotions_; - vector outputs_; + std::vector frames_; + std::vector > forwardMotions_; + std::vector > backwardMotions_; + std::vector outputs_; int storePos_; int procPos_; int outPos_; - vector srcFrames_; - vector > srcForwardMotions_; - vector > srcBackwardMotions_; + std::vector srcFrames_; + std::vector > srcForwardMotions_; + std::vector > srcBackwardMotions_; GpuMat finalOutput_; }; @@ -530,8 +530,8 @@ namespace if (storePos_ > 0) { - pair& forwardMotion = at(storePos_ - 1, forwardMotions_); - pair& backwardMotion = at(storePos_, backwardMotions_); + std::pair& forwardMotion = at(storePos_ - 1, forwardMotions_); + std::pair& backwardMotion = at(storePos_, backwardMotions_); opticalFlow_->calc(prevFrame_, curFrame_, forwardMotion.first, forwardMotion.second); opticalFlow_->calc(curFrame_, prevFrame_, backwardMotion.first, backwardMotion.second); @@ -542,9 +542,9 @@ namespace void BTVL1_GPU::processFrame(int idx) { - const int startIdx = max(idx - temporalAreaRadius_, 0); + const int startIdx = std::max(idx - temporalAreaRadius_, 0); const int procIdx = idx; - const int endIdx = min(startIdx + 2 * temporalAreaRadius_, storePos_); + const int endIdx = std::min(startIdx + 2 * temporalAreaRadius_, storePos_); const int count = endIdx - startIdx + 1; diff --git a/modules/superres/src/precomp.hpp b/modules/superres/src/precomp.hpp index 3049b7aeb4..8aa132efe9 100644 --- a/modules/superres/src/precomp.hpp +++ b/modules/superres/src/precomp.hpp @@ -62,7 +62,7 @@ #ifdef HAVE_OPENCV_GPU #include "opencv2/gpu.hpp" #ifdef HAVE_CUDA - #include "opencv2/gpu/stream_accessor.hpp" + #include "opencv2/core/stream_accessor.hpp" #endif #endif