2014-01-25 75 views
3

我是一个关于视频稳定领域的新手。现在我正在研究它。 我正在编码一个小视频稳定演示。但我被困在一些问题 我使用OpenCV的函数“estimateGlobalMotionLeastSquares”估计全局运动 但它不工作视频稳定 - 使用估计GlobalMotionLeastSquares opencv 2.4.7

这里是我的代码:

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”。 但是,当我遵守,误差为:

1> VS_OpenCVDlg.obj:错误LNK2001:解析外部符号“类CV ::垫__cdecl CV :: videostab :: estimateGlobalMotionLeastSquares(类的std ::载体, class std :: allocator >> const &,class std :: vector,class std :: allocator >> const &,int,float *)“(?estimateGlobalMotionLeastSquares @ videostab @ cv @@ YA?AVMat @ 2 @ ABV?$ F:\ Research \ Workspace \ VS_OpenCV向量@ V $ $ Point_ @ M @ cv @@ V $ $分配器@ V $ $ Point_ @ M @ cv @@@ std @@@ std @@ 0HPAM @ Z) 1> F:\ Research \ Workspace \ VS_OpenCV \ Debug \ VS_OpenCV.exe:致命错误LNK1120:1个未解析的外部设备

请帮我解决这个问题! 你可以给我一些关于这个功能的例子吗?

回答

3

尝试包括正确的文件:

#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);