我是视频稳定 Realm 的新手。现在,我正在对此进行研究。
我正在编写一个小型视频稳定演示。但是我陷入了一些问题
我在OpenCV中使用函数“estimateGlobalMotionLeastSquares”来估算全局运动
但这不起作用

这是我的代码:

CvPoint2D32f p0, p1;
vector<Point2f,allocator<Point2f>> ax, by;
ax.push_back(Point2f(2,2));
by.push_back(Point2f(3,2));
Mat t = estimateGlobalMotionLeastSquares(ax,by,AFFINE,0);

例如:我创建2个变量p0,p1作为函数“
EstimateGlobalMotionLeastSquares”,我想估算全局运动“t”。
但是当我编译时,错误如下:



请帮我解决这个问题!!!
您能给我一些有关该功能的例子吗?

最佳答案

尝试包含适当的文件:

#include "opencv2/videostab/videostab.hpp"

并将您的代码更改为:
CvPoint2D32f p0, p1;
vector<Point2f,allocator<Point2f>> ax, by;
ax.push_back(Point2f(2,2));
ax.push_back(Point2f(2,3));
ax.push_back(Point2f(2,4));
by.push_back(Point2f(3,2));
by.push_back(Point2f(3,3));
by.push_back(Point2f(3,4));
Mat t = videostab::estimateGlobalMotionLeastSquares(ax,by,3,0);

09-27 16:14