3
我正在嘗試使用OpenCV videostab模塊實現視頻穩定。我需要在流中進行,所以我試圖在兩幀之間進行移動。學習資料後,我決定做這樣說:OpenCV視頻穩定
estimator = new cv::videostab::MotionEstimatorRansacL2(cv::videostab::MM_TRANSLATION);
keypointEstimator = new cv::videostab::KeypointBasedMotionEstimator(estimator);
bool res;
auto motion = keypointEstimator->estimate(this->firstFrame, thisFrame, &res);
std::vector<float> matrix(motion.data, motion.data + (motion.rows*motion.cols));
凡firstFrame
和thisFrame
完全初始化幀。問題是,該方法estimate
總是返回矩陣那樣:
在這個矩陣中只有最後的值(matrix[8]
)從幀到幀變化。我是否正確使用videostab對象,以及如何將這個矩陣應用於框架以獲得結果?