2014-01-25 68 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);