mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Fixed Android build
This commit is contained in:
@@ -621,7 +621,7 @@ Mat ToFileMotionWriter::estimate(const Mat &frame0, const Mat &frame1, bool *ok)
|
||||
|
||||
KeypointBasedMotionEstimator::KeypointBasedMotionEstimator(Ptr<MotionEstimatorBase> estimator)
|
||||
: ImageMotionEstimatorBase(estimator->motionModel()), motionEstimator_(estimator)
|
||||
{
|
||||
{
|
||||
setDetector(new GoodFeaturesToTrackDetector());
|
||||
setOpticalFlowEstimator(new SparsePyrLkOptFlowEstimator());
|
||||
setOutlierRejector(new NullOutlierRejector());
|
||||
@@ -686,11 +686,11 @@ Mat KeypointBasedMotionEstimator::estimate(const Mat &frame0, const Mat &frame1,
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
KeypointBasedMotionEstimatorGpu::KeypointBasedMotionEstimatorGpu(Ptr<MotionEstimatorBase> estimator)
|
||||
: ImageMotionEstimatorBase(estimator->motionModel()), motionEstimator_(estimator)
|
||||
{
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
setOutlierRejector(new NullOutlierRejector());
|
||||
}
|
||||
|
||||
@@ -720,7 +720,7 @@ Mat KeypointBasedMotionEstimatorGpu::estimate(const gpu::GpuMat &frame0, const g
|
||||
detector_(grayFrame0, pointsPrev_);
|
||||
|
||||
// find correspondences
|
||||
optFlowEstimator_.run(frame0, frame1, pointsPrev_, points_, status_);
|
||||
optFlowEstimator_.run(frame0, frame1, pointsPrev_, points_, status_);
|
||||
|
||||
// leave good correspondences only
|
||||
gpu::compactPoints(pointsPrev_, points_, status_);
|
||||
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
for (int dx = -rad; dx <= rad; ++dx)
|
||||
{
|
||||
int qx0 = x + dx;
|
||||
int qy0 = y + dy;
|
||||
int qy0 = y + dy;
|
||||
|
||||
if (qy0 >= 0 && qy0 < mask0.rows && qx0 >= 0 && qx0 < mask0.cols && mask0(qy0,qx0))
|
||||
{
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
|
||||
MotionInpainter::MotionInpainter()
|
||||
{
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
setOptFlowEstimator(new DensePyrLkOptFlowEstimatorGpu());
|
||||
#else
|
||||
CV_Error(CV_StsNotImplemented, "Current implementation of MotionInpainter requires GPU");
|
||||
@@ -374,7 +374,7 @@ void MotionInpainter::inpaint(int idx, Mat &frame, Mat &mask)
|
||||
|
||||
// warp frame
|
||||
|
||||
frame1_ = at(neighbor, *frames_);
|
||||
frame1_ = at(neighbor, *frames_);
|
||||
|
||||
if (motionModel_ != MM_HOMOGRAPHY)
|
||||
warpAffine(
|
||||
@@ -532,7 +532,7 @@ void completeFrameAccordingToFlow(
|
||||
|
||||
if (x1 >= 0 && x1 < frame1.cols && y1 >= 0 && y1 < frame1.rows && mask1_(y1,x1)
|
||||
&& sqr(flowX_(y0,x0)) + sqr(flowY_(y0,x0)) < sqr(distThresh))
|
||||
{
|
||||
{
|
||||
frame0.at<Point3_<uchar> >(y0,x0) = frame1.at<Point3_<uchar> >(y1,x1);
|
||||
mask0_(y0,x0) = 255;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ void SparsePyrLkOptFlowEstimator::run(
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
SparsePyrLkOptFlowEstimatorGpu::SparsePyrLkOptFlowEstimatorGpu()
|
||||
{
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
@@ -135,7 +135,7 @@ void DensePyrLkOptFlowEstimatorGpu::run(
|
||||
flowX_.download(flowX.getMatRef());
|
||||
flowY_.download(flowY.getMatRef());
|
||||
}
|
||||
#endif // #if HAVE_OPENCV_GPU
|
||||
#endif // HAVE_OPENCV_GPU
|
||||
|
||||
} // namespace videostab
|
||||
} // namespace cv
|
||||
|
||||
@@ -115,7 +115,7 @@ void MoreAccurateMotionWobbleSuppressor::suppress(int idx, const Mat &frame, Mat
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
void MoreAccurateMotionWobbleSuppressorGpu::suppress(int idx, const gpu::GpuMat &frame, gpu::GpuMat &result)
|
||||
{
|
||||
CV_Assert(motions_ && stabilizationMotions_);
|
||||
|
||||
Reference in New Issue
Block a user