方法如下:使用OPENCV下SIFT库做图像匹配的例程// : 定义控制台应用程序的入口点。//#include ""#include #include #include#include#includeusing namespace std;using namespace cv;int _tmain(int argc, _TCHAR* argv[]){ const char* imagename = ""; //从文件中读入图像 Mat img = imread(imagename); Mat img2=imread(""); //如果读入图像失败 if(()) { fprintf(stderr, "Can not load image %s\n", imagename); return -1; } if(()) { fprintf(stderr, "Can not load image %s\n", imagename); return -1; } //显示图像 imshow("image before", img); imshow("image2 before",img2); //sift特征检测 SiftFeatureDetector siftdtc; vectorkp1,kp2; (img,kp1); Mat outimg1; drawKeypoints(img,kp1,outimg1); imshow("image1 keypoints",outimg1); KeyPoint kp; vector::iterator itvc; for(itvc=();itvc!=();itvc++) { cout<<"angle:"<angle<<"\t"<class_id<<"\t"<octave<<"\t"<pt<<"\t"<response<> matcher; vector matches; Mat img_matches; (img,kp1,descriptor1); (img2,kp2,descriptor2); imshow("desc",descriptor1); cout<