mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
renamed gpu namespace -> cuda
This commit is contained in:
@@ -213,17 +213,17 @@ public:
|
||||
Ptr<IOutlierRejector> outlierRejector() const { return outlierRejector_; }
|
||||
|
||||
virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0);
|
||||
Mat estimate(const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, bool *ok = 0);
|
||||
Mat estimate(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, bool *ok = 0);
|
||||
|
||||
private:
|
||||
Ptr<MotionEstimatorBase> motionEstimator_;
|
||||
Ptr<gpu::CornersDetector> detector_;
|
||||
Ptr<cuda::CornersDetector> detector_;
|
||||
SparsePyrLkOptFlowEstimatorGpu optFlowEstimator_;
|
||||
Ptr<IOutlierRejector> outlierRejector_;
|
||||
|
||||
gpu::GpuMat frame0_, grayFrame0_, frame1_;
|
||||
gpu::GpuMat pointsPrev_, points_;
|
||||
gpu::GpuMat status_;
|
||||
cuda::GpuMat frame0_, grayFrame0_, frame1_;
|
||||
cuda::GpuMat pointsPrev_, points_;
|
||||
cuda::GpuMat status_;
|
||||
|
||||
Mat hostPointsPrev_, hostPoints_;
|
||||
std::vector<Point2f> hostPointsPrevTmp_, hostPointsTmp_;
|
||||
|
||||
@@ -111,15 +111,15 @@ public:
|
||||
InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1,
|
||||
OutputArray status, OutputArray errors);
|
||||
|
||||
void run(const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, const gpu::GpuMat &points0, gpu::GpuMat &points1,
|
||||
gpu::GpuMat &status, gpu::GpuMat &errors);
|
||||
void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1,
|
||||
cuda::GpuMat &status, cuda::GpuMat &errors);
|
||||
|
||||
void run(const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, const gpu::GpuMat &points0, gpu::GpuMat &points1,
|
||||
gpu::GpuMat &status);
|
||||
void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1,
|
||||
cuda::GpuMat &status);
|
||||
|
||||
private:
|
||||
gpu::PyrLKOpticalFlow optFlowEstimator_;
|
||||
gpu::GpuMat frame0_, frame1_, points0_, points1_, status_, errors_;
|
||||
cuda::PyrLKOpticalFlow optFlowEstimator_;
|
||||
cuda::GpuMat frame0_, frame1_, points0_, points1_, status_, errors_;
|
||||
};
|
||||
|
||||
class CV_EXPORTS DensePyrLkOptFlowEstimatorGpu
|
||||
@@ -133,8 +133,8 @@ public:
|
||||
OutputArray errors);
|
||||
|
||||
private:
|
||||
gpu::PyrLKOpticalFlow optFlowEstimator_;
|
||||
gpu::GpuMat frame0_, frame1_, flowX_, flowY_, errors_;
|
||||
cuda::PyrLKOpticalFlow optFlowEstimator_;
|
||||
cuda::GpuMat frame0_, frame1_, flowX_, flowY_, errors_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -120,12 +120,12 @@ private:
|
||||
class CV_EXPORTS MoreAccurateMotionWobbleSuppressorGpu : public MoreAccurateMotionWobbleSuppressorBase
|
||||
{
|
||||
public:
|
||||
void suppress(int idx, const gpu::GpuMat &frame, gpu::GpuMat &result);
|
||||
void suppress(int idx, const cuda::GpuMat &frame, cuda::GpuMat &result);
|
||||
virtual void suppress(int idx, const Mat &frame, Mat &result);
|
||||
|
||||
private:
|
||||
gpu::GpuMat frameDevice_, resultDevice_;
|
||||
gpu::GpuMat mapx_, mapy_;
|
||||
cuda::GpuMat frameDevice_, resultDevice_;
|
||||
cuda::GpuMat mapx_, mapy_;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -742,9 +742,9 @@ Mat KeypointBasedMotionEstimator::estimate(const Mat &frame0, const Mat &frame1,
|
||||
KeypointBasedMotionEstimatorGpu::KeypointBasedMotionEstimatorGpu(Ptr<MotionEstimatorBase> estimator)
|
||||
: ImageMotionEstimatorBase(estimator->motionModel()), motionEstimator_(estimator)
|
||||
{
|
||||
detector_ = gpu::createGoodFeaturesToTrackDetector(CV_8UC1);
|
||||
detector_ = cuda::createGoodFeaturesToTrackDetector(CV_8UC1);
|
||||
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
CV_Assert(cuda::getCudaEnabledDeviceCount() > 0);
|
||||
setOutlierRejector(new NullOutlierRejector());
|
||||
}
|
||||
|
||||
@@ -757,16 +757,16 @@ Mat KeypointBasedMotionEstimatorGpu::estimate(const Mat &frame0, const Mat &fram
|
||||
}
|
||||
|
||||
|
||||
Mat KeypointBasedMotionEstimatorGpu::estimate(const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, bool *ok)
|
||||
Mat KeypointBasedMotionEstimatorGpu::estimate(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, bool *ok)
|
||||
{
|
||||
// convert frame to gray if it's color
|
||||
|
||||
gpu::GpuMat grayFrame0;
|
||||
cuda::GpuMat grayFrame0;
|
||||
if (frame0.channels() == 1)
|
||||
grayFrame0 = frame0;
|
||||
else
|
||||
{
|
||||
gpu::cvtColor(frame0, grayFrame0_, COLOR_BGR2GRAY);
|
||||
cuda::cvtColor(frame0, grayFrame0_, COLOR_BGR2GRAY);
|
||||
grayFrame0 = grayFrame0_;
|
||||
}
|
||||
|
||||
@@ -777,7 +777,7 @@ Mat KeypointBasedMotionEstimatorGpu::estimate(const gpu::GpuMat &frame0, const g
|
||||
optFlowEstimator_.run(frame0, frame1, pointsPrev_, points_, status_);
|
||||
|
||||
// leave good correspondences only
|
||||
gpu::compactPoints(pointsPrev_, points_, status_);
|
||||
cuda::compactPoints(pointsPrev_, points_, status_);
|
||||
|
||||
pointsPrev_.download(hostPointsPrev_);
|
||||
points_.download(hostPoints_);
|
||||
|
||||
@@ -62,7 +62,7 @@ void SparsePyrLkOptFlowEstimator::run(
|
||||
|
||||
SparsePyrLkOptFlowEstimatorGpu::SparsePyrLkOptFlowEstimatorGpu()
|
||||
{
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
CV_Assert(cuda::getCudaEnabledDeviceCount() > 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,8 @@ void SparsePyrLkOptFlowEstimatorGpu::run(
|
||||
|
||||
|
||||
void SparsePyrLkOptFlowEstimatorGpu::run(
|
||||
const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, const gpu::GpuMat &points0,
|
||||
gpu::GpuMat &points1, gpu::GpuMat &status, gpu::GpuMat &errors)
|
||||
const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0,
|
||||
cuda::GpuMat &points1, cuda::GpuMat &status, cuda::GpuMat &errors)
|
||||
{
|
||||
optFlowEstimator_.winSize = winSize_;
|
||||
optFlowEstimator_.maxLevel = maxLevel_;
|
||||
@@ -98,8 +98,8 @@ void SparsePyrLkOptFlowEstimatorGpu::run(
|
||||
|
||||
|
||||
void SparsePyrLkOptFlowEstimatorGpu::run(
|
||||
const gpu::GpuMat &frame0, const gpu::GpuMat &frame1, const gpu::GpuMat &points0,
|
||||
gpu::GpuMat &points1, gpu::GpuMat &status)
|
||||
const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0,
|
||||
cuda::GpuMat &points1, cuda::GpuMat &status)
|
||||
{
|
||||
optFlowEstimator_.winSize = winSize_;
|
||||
optFlowEstimator_.maxLevel = maxLevel_;
|
||||
@@ -109,7 +109,7 @@ void SparsePyrLkOptFlowEstimatorGpu::run(
|
||||
|
||||
DensePyrLkOptFlowEstimatorGpu::DensePyrLkOptFlowEstimatorGpu()
|
||||
{
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
CV_Assert(cuda::getCudaEnabledDeviceCount() > 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ void MoreAccurateMotionWobbleSuppressor::suppress(int idx, const Mat &frame, Mat
|
||||
|
||||
|
||||
#ifdef HAVE_OPENCV_GPUWARPING
|
||||
void MoreAccurateMotionWobbleSuppressorGpu::suppress(int idx, const gpu::GpuMat &frame, gpu::GpuMat &result)
|
||||
void MoreAccurateMotionWobbleSuppressorGpu::suppress(int idx, const cuda::GpuMat &frame, cuda::GpuMat &result)
|
||||
{
|
||||
CV_Assert(motions_ && stabilizationMotions_);
|
||||
|
||||
@@ -141,12 +141,12 @@ void MoreAccurateMotionWobbleSuppressorGpu::suppress(int idx, const gpu::GpuMat
|
||||
Mat ML = S1 * getMotion(k1, idx, *motions2_) * getMotion(k1, idx, *motions_).inv() * S1.inv();
|
||||
Mat MR = S1 * getMotion(idx, k2, *motions2_).inv() * getMotion(idx, k2, *motions_) * S1.inv();
|
||||
|
||||
gpu::calcWobbleSuppressionMaps(k1, idx, k2, frame.size(), ML, MR, mapx_, mapy_);
|
||||
cuda::calcWobbleSuppressionMaps(k1, idx, k2, frame.size(), ML, MR, mapx_, mapy_);
|
||||
|
||||
if (result.data == frame.data)
|
||||
result = gpu::GpuMat(frame.size(), frame.type());
|
||||
result = cuda::GpuMat(frame.size(), frame.type());
|
||||
|
||||
gpu::remap(frame, result, mapx_, mapy_, INTER_LINEAR, BORDER_REPLICATE);
|
||||
cuda::remap(frame, result, mapx_, mapy_, INTER_LINEAR, BORDER_REPLICATE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user