TLD即Tracking Learning Detection,,Zdenek Kalal在其主頁(yè)上給出的代碼http://info.ee./Personal/Z.Kalal/tld.html 我電腦的程序配置:WIN7+VS2010+MATLAB R2010a+OpenCV2.2(也可以是Opencv2.3.1) OpenCV2.2的下載地址(這里含有各種版本的OpenCV)http://www./index.php/Download 第一步:安裝OpenCV2.2 OpenCV和VS2010的安裝教程地址http://www./index.p ... E8%A3%85OpenCV2.4.3(這里OpenCV2.2和OpenCV2.3.4的安裝步驟是一樣的) 第二步:?jiǎn)?dòng)matlab R2010a,在命令窗口中輸入“mex –setup”,按y鍵進(jìn)入編譯器選擇,,輸入vs2010編譯器對(duì)應(yīng)的序號(hào) 第三步:設(shè)置“complie.m”文件的opencv的路徑 原文件路徑為:include = ' -Ic:\OpenCV2.2\include\opencv\ -Ic:\OpenCV2.2\include\'; libpath = 'c:\OpenCV2.2\lib\'; 我的路徑為: include = ' -IE:\OpenCV2.2\include\opencv\ -IE:\OpenCV2.2\include\'; libpath = 'E:\OpenCV2.2\lib\'; 注釋掉:lk.cpp, fern.cpp, bb_overlap.cpp文件中的: #ifdef _CHAR16_T #define CHAR16_T #endif 第四步: 修改complie.m文件中的代碼 解決辦法是打開(kāi)mex文件下的的lk.cpp文件,,找到其中的186行,這里看仔細(xì)了,,是這一行 cvCalcOpticalFlowPyrLK( IMG[J], IMG[I], PYR[J], PYR[I], points[1], points[2], nPts, cvSize(win_size,win_size), Level, 0 ,0, cvTermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS,20,0.03), CV_LKFLOW_INITIAL_GUESSES | CV_LKFLOW_PYR_A_READY | CV_LKFLOW_PYR_B_READY ); 將上述紅色的0改為status,,如下: cvCalcOpticalFlowPyrLK( IMG[J], IMG[I], PYR[J], PYR[I], points[1], points[2], nPts, cvSize(win_size,win_size), Level, status ,0, cvTermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS,20,0.03), CV_LKFLOW_INITIAL_GUESSES | CV_LKFLOW_PYR_A_READY | CV_LKFLOW_PYR_B_READY ); 修改后運(yùn)行,會(huì)出現(xiàn)complete語(yǔ)句,,這樣前面的工作就成功完成了 第五步:運(yùn)行run_TLD.m,,這時(shí)會(huì)出現(xiàn)一個(gè)跟蹤摩托車的影像。 |
|
來(lái)自: 昵稱20590214 > 《論文相關(guān)》