ASIFT+OpenCV
图像特征匹配实战VC工程源码
OpenCV包含头文件:
#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
核心代码如下:
if (!m_pImage1||!m_pImage2)
{
AfxMessageBox("please,select 2 images!");
return;
}
UpdateData(TRUE);
CvSize sz1 = cvSize(m_pImage1->width,m_pImage1->height);
CvSize sz2 = cvSize(m_pImage2->width,m_pImage2->height);
CvScalar s;
IplImage *gimg1 = cvCreateImage(sz1,IPL_DEPTH_8U,1);
cvCvtColor(m_pImage1,gimg1,CV_BGR2GRAY);
IplImage *gimg2 = cvCreateImage(sz2,IPL_DEPTH_8U,1);
cvCvtColor(m_pImage2,gimg2,CV_BGR2GRAY);
size_t w1, h1;
w1 = gimg1->width;
h1 = gimg1->height;
float * iarr1 = new float[w1*h1];
for(int i=0;i
width;
h2 = gimg2->height;
float * iarr2 = new float[w2*h2];
for(int i=0;i
1