opencv knnMatch 与 gpuKnnMatch性能比较,不同设备测试效果不同,在我的tesla和i7上测试gpu平均加速3倍。KnnMatch在前面的博文中已有代码
#include<iostream>
#include<sys/time.h>
#include"opencv2/gpu/gpu.hpp"
#include"opencv2/opencv.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
const int samples = 50000;
const int DIM = 1024</