Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Performance of OpenCV GPU BruteForceMatcher

Hello,

I'm trying to accelerate the OpenCV CPU BruteForce Matcher by using its GPU version. Here is my code:

// OpenCV CPU BruteForceMatcher
timer.start();
    vector < vector<DMatch> > cpu_matches;
    Ptr<DescriptorMatcher> cpu_matcher = DescriptorMatcher::create("BruteForce");
    cpu_matcher->knnMatch(descriptors_img , descriptors_fond , cpu_matches , 2);
timer.stop();
cout << "OpenCV CPU MATCHING TIME : " << timer.ellapsedTime() << " ms." << endl;

// OpenCV GPU BruteForceMatcher
timer.start();
    GpuMat gpu_descriptors_img (descriptors_img) , gpu_descriptors_fond (descriptors_fond);
    vector < vector<DMatch> > gpu_matches;
    BruteForceMatcher_GPU_base gpu_matcher;
    gpu_matcher.knnMatch(gpu_descriptors_img , gpu_descriptors_fond , gpu_matches , 2);
timer.stop();
cout << "OpenCV GPU MATHING TIME : " << timer.ellapsedTime() << " ms." << endl;

The problem is that the GPU matcher is always slower than the cpu one. Can anyone can explain me why? thank you.

Set up: I'm Using CUDA 5.0 with GeForce GTX 650 (compute capability 3.0) , Ubuntu 14.04 LTS