【发布时间】:2015-06-16 15:15:36
【问题描述】:
我正在尝试使用 OpenCV videostab 模块实现视频稳定。我需要在流中进行,所以我试图在两帧之间进行运动。在学习了文档之后,我决定这样做:
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])会随着帧的变化而变化。我是否正确使用了 videotab 对象,如何在帧上应用此矩阵以获得结果?
【问题讨论】: