// FeatureDetector.cpp : Defines the entry point for the console application.
#include<opencv2/nonfree/features2d.hpp> //使用SiftFeatureDetector需要加上此头文件
#include<opencv2\opencv.hpp>
#include<iostream>
#include<fstream>
using namespace cv;
using namespace std;
int main(int argc, char* argv[])
{
//ofstream fileo("data.txt");
//Load Image
Mat c_src1 = imread("E:\\P\\case2\\CV_RoiImage.bmp");
Mat c_src2 = imread("E:\\P\\case2\\cv_temp.bmp");
Mat src1 = imread("E:\\P\\case2\\cv_temp.bmp", CV_LOAD_IMAGE_GRAYSCALE);
Mat src2 = imread("E:\\P\\case2\\CV_RoiImage.bmp", CV_LOAD_IMAGE_GRAYSCALE);
if (!src1.data || !src2.data)
{
std::cout << " --(!) Error reading images " << std::endl; return -1;
}
//sift feature detect
SiftFeatureDetector detector;
vector<KeyPoint> kp1, kp2;
detector.detect(src1, kp1);
detector.detect(src2, kp2);
使用SIFT描述子计算模板旋转角度
最新推荐文章于 2021-02-02 17:29:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)