From 1fc60e6d64dc8ffec72891d9ca73c8fe6bba1b8e Mon Sep 17 00:00:00 2001 From: zongwave Date: Wed, 21 Dec 2016 16:12:08 +0800 Subject: [PATCH] Add method KeypointBasedMotionEstimator::estimate(InputArray, InputArray) to support both cpu & opencl algorithm processing the orignal estimate function has input parameters defined as "Mat", this prevent users to call into algorithm opencl path --- .../videostab/include/opencv2/videostab/global_motion.hpp | 1 + modules/videostab/src/global_motion.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/modules/videostab/include/opencv2/videostab/global_motion.hpp b/modules/videostab/include/opencv2/videostab/global_motion.hpp index 80b147a6b5..8250654c2c 100644 --- a/modules/videostab/include/opencv2/videostab/global_motion.hpp +++ b/modules/videostab/include/opencv2/videostab/global_motion.hpp @@ -236,6 +236,7 @@ public: Ptr 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 motionEstimator_; diff --git a/modules/videostab/src/global_motion.cpp b/modules/videostab/src/global_motion.cpp index 53603382ad..e0302ced2c 100644 --- a/modules/videostab/src/global_motion.cpp +++ b/modules/videostab/src/global_motion.cpp @@ -710,6 +710,14 @@ KeypointBasedMotionEstimator::KeypointBasedMotionEstimator(Ptrdetect(frame0, keypointsPrev_);