OpenCV图像匹配算法之surf

本文深入探讨了OpenCV库中的SURF(Speeded Up Robust Features)算法,详细阐述了如何利用该算法进行图像特征匹配,并提供了相关的实用代码示例,包括utils.h和utils.cpp文件的内容解析。
摘要由CSDN通过智能技术生成

utils.h与utils.cpp

//surf.cpp
#include "stdafx.h"
#include <cv.hpp>
#include <highgui.h>
#include "utils.h"
#include <iostream>
using namespace std;

void surf(char* path1, char* path2, INFO& info, bool show)
{
	double t1,t2;
	t1=cvGetTickCount();

	initModule_nonfree();

	Mat img1, img2;
	img1=imread(path1,0);
	img2=imread(path2,0);
	if(img1.data==NULL)
	{
		cout<<"The image can not been loaded: "<<path1<<endl;
		system("pause");
		exit(-1);
	}
	if(img2.data==NULL)
	{
		cout<<"The image can not been loaded: "<<path2<<endl;
		system("pause");
		exit(-1);
	}

	int minHessian=200;
	SurfFeatureDetector surf_detector(minHessian) ;
	SurfDescriptorExtractor surf_descriptor ;  
	vector<KeyPoint>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值