资源简介
本程序实现了fastmathc, 使用c++和opecnv实现,参考了原作者的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<<“耗时“< cout< Mat temp2 = matcher.drawMatch(imgtemptransM);
imshow(“match“temp2);
waitKey();
// system(“pause“);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 948 2014-11-01 23:27 main.cpp
文件 18507 2014-11-01 23:19 MatchTemp.cpp
文件 1618 2014-11-01 23:16 MatchTemp.h
- 上一篇:基于c++的简单文件传输
- 下一篇:算术编码,C语言实现
评论
共有 条评论