資源簡介
本程序?qū)崿F(xiàn)了fastmathc, 使用c++和opecnv實(shí)現(xiàn),參考了原作者的matlab程序

代碼片段和文件信息
#include?“MatchTemp.h“
#include?
#define???flt?at
using?namespace?std;
int?main()
{
#define??ITT?1
#if?ITT
string?srcImg?=?“D:/image/face.jpg“;
string?tempImg=“D:/image/face_temp.jpg“;
#else
string?srcImg?=?“D:/image/image.png“;
string?tempImg=“D:/image/template.png“;
#endif
Mat?img1?=?imread(srcImg0);
Mat?temp1?=?imread(tempImg0);
Mat?img?;
Mat?temp?;
float?fx?=?1;
resize(img1imgSize(00)fxfx);
resize(temp1tempSize(00)fxfx);
if?(img.empty()?&&?temp.empty())
{
cout<<“cann‘t?open?image“< system(“pause“);
return?0;
}
CMatchTemp?matcher;
double?tic?=?cv::getTickCount();
Mat?transM?=?matcher.match(imgtemp);
tic?=cv::getTickCount()-tic;
cout<<“耗時(shí)“< cout< Mat?temp2?=?matcher.drawMatch(imgtemptransM);
imshow(“match“temp2);
waitKey();
// system(“pause“);
return?0;
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????????948??2014-11-01?23:27??main.cpp
?????文件???????18507??2014-11-01?23:19??MatchTemp.cpp
?????文件????????1618??2014-11-01?23:16??MatchTemp.h
評(píng)論
共有 條評(píng)論