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对象,以及如何将这个矩阵应用于框架以获得结果?