mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Revert "Revert "Merge pull request #836 from jet47:gpu-modules""
This commit is contained in:
@@ -47,6 +47,10 @@
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
#include "clp.hpp"
|
||||
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
# include "opencv2/gpu.hpp"
|
||||
#endif
|
||||
|
||||
namespace cv
|
||||
{
|
||||
namespace videostab
|
||||
@@ -728,7 +732,8 @@ Mat KeypointBasedMotionEstimator::estimate(const Mat &frame0, const Mat &frame1,
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#if defined(HAVE_OPENCV_GPUIMGPROC) && defined(HAVE_OPENCV_GPU) && defined(HAVE_OPENCV_GPUOPTFLOW)
|
||||
|
||||
KeypointBasedMotionEstimatorGpu::KeypointBasedMotionEstimatorGpu(Ptr<MotionEstimatorBase> estimator)
|
||||
: ImageMotionEstimatorBase(estimator->motionModel()), motionEstimator_(estimator)
|
||||
{
|
||||
@@ -799,7 +804,8 @@ Mat KeypointBasedMotionEstimatorGpu::estimate(const gpu::GpuMat &frame0, const g
|
||||
// estimate motion
|
||||
return motionEstimator_->estimate(hostPointsPrev_, hostPoints_, ok);
|
||||
}
|
||||
#endif // HAVE_OPENCV_GPU
|
||||
|
||||
#endif // defined(HAVE_OPENCV_GPUIMGPROC) && defined(HAVE_OPENCV_GPU) && defined(HAVE_OPENCV_GPUOPTFLOW)
|
||||
|
||||
|
||||
Mat getMotion(int from, int to, const std::vector<Mat> &motions)
|
||||
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
|
||||
MotionInpainter::MotionInpainter()
|
||||
{
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPUOPTFLOW
|
||||
setOptFlowEstimator(new DensePyrLkOptFlowEstimatorGpu());
|
||||
#else
|
||||
CV_Error(Error::StsNotImplemented, "Current implementation of MotionInpainter requires GPU");
|
||||
|
||||
@@ -58,7 +58,8 @@ void SparsePyrLkOptFlowEstimator::run(
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPUOPTFLOW
|
||||
|
||||
SparsePyrLkOptFlowEstimatorGpu::SparsePyrLkOptFlowEstimatorGpu()
|
||||
{
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
@@ -133,7 +134,8 @@ void DensePyrLkOptFlowEstimatorGpu::run(
|
||||
flowX_.download(flowX.getMatRef());
|
||||
flowY_.download(flowY.getMatRef());
|
||||
}
|
||||
#endif // HAVE_OPENCV_GPU
|
||||
|
||||
#endif // HAVE_OPENCV_GPUOPTFLOW
|
||||
|
||||
} // namespace videostab
|
||||
} // namespace cv
|
||||
|
||||
@@ -44,6 +44,15 @@
|
||||
#include "opencv2/videostab/wobble_suppression.hpp"
|
||||
#include "opencv2/videostab/ring_buffer.hpp"
|
||||
|
||||
#ifdef HAVE_OPENCV_GPUWARPING
|
||||
# include "opencv2/gpuwarping.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
# include "opencv2/gpu.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
namespace cv
|
||||
{
|
||||
namespace videostab
|
||||
@@ -113,7 +122,7 @@ void MoreAccurateMotionWobbleSuppressor::suppress(int idx, const Mat &frame, Mat
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPUWARPING
|
||||
void MoreAccurateMotionWobbleSuppressorGpu::suppress(int idx, const gpu::GpuMat &frame, gpu::GpuMat &result)
|
||||
{
|
||||
CV_Assert(motions_ && stabilizationMotions_);
|
||||
|
||||
Reference in New Issue
Block a user