Add method KeypointBasedMotionEstimator::estimate(InputArray, InputArray) to support...
authorzongwave <wei.zong@intel.com>
Wed, 21 Dec 2016 08:12:08 +0000 (16:12 +0800)
committerzongwave <wei.zong@intel.com>
Fri, 14 Apr 2017 02:08:48 +0000 (10:08 +0800)
the orignal estimate function has input parameters defined as "Mat", this prevent users to call into algorithm opencl path

modules/videostab/include/opencv2/videostab/global_motion.hpp
modules/videostab/src/global_motion.cpp

index 80b147a..8250654 100644 (file)
@@ -236,6 +236,7 @@ public:
     Ptr<IOutlierRejector> outlierRejector() const { return outlierRejector_; }
 
     virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0);
+    Mat estimate(InputArray frame0, InputArray frame1, bool *ok = 0);
 
 private:
     Ptr<MotionEstimatorBase> motionEstimator_;
index 5360338..e0302ce 100644 (file)
@@ -711,6 +711,14 @@ KeypointBasedMotionEstimator::KeypointBasedMotionEstimator(Ptr<MotionEstimatorBa
 
 Mat KeypointBasedMotionEstimator::estimate(const Mat &frame0, const Mat &frame1, bool *ok)
 {
+    InputArray image0 = frame0;
+    InputArray image1 = frame1;
+
+    return estimate(image0, image1, ok);
+}
+
+Mat KeypointBasedMotionEstimator::estimate(InputArray frame0, InputArray frame1, bool *ok)
+{
     // find keypoints
     detector_->detect(frame0, keypointsPrev_);
     if (keypointsPrev_.empty())