Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SURF slower than SIFT

Hi everyone, I'm testing the performance of opencv feature detection and description algorithms and even though the paper claims otherwise, Surf works slower than Sift by about a milisecond or two. I couldn't make sense of it. I changed the cvRound input to float as suggested here, but it doesn't do anything. My code is below, there are also other detectors and descriptors there and I uncomment whichever I'd like to test, I'd appreciate anyone who can shed light on this, they both match around 600-700 keypoints:

//// DETECTION
    //OrbFeatureDetector detector(500);
    SurfFeatureDetector detector(1500,4);
    ////cv::FAST(imgB, keypointsB, 20);
    //SiftFeatureDetector detector;


    // DESCRIPTOR ORB, SURF, BRIEF, SIFT. Uncomment these lines if you want to use SURF, ORB, BRIEF or SIFT.
    //OrbDescriptorExtractor extractor;
    SurfDescriptorExtractor extractor;
    //BriefDescriptorExtractor extractor;
    //SiftDescriptorExtractor extractor;

        // detect
    double t11 = (double)getTickCount();
    detector.detect( img1, keypointsB );
    t11 = ((double)getTickCount() - t11)/getTickFrequency();

    double t1 = (double)getTickCount();
    detector.detect( img2, keypointsA );
    t1 = ((double)getTickCount() - t1)/getTickFrequency();

    double t22 = (double)getTickCount();
    extractor.compute( img1, keypointsB, descriptorsB);
    t22 = ((double)getTickCount() - t22)/getTickFrequency();

        // extract
    double t2 = (double)getTickCount();
    extractor.compute( img2, keypointsA, descriptorsA);
    t2 = ((double)getTickCount() - t2)/getTickFrequency();


    // match
    double t3 = (double)getTickCount();
    matcher.match(descriptorsA, descriptorsB, matches);
    t3 = ((double)getTickCount() - t3)/getTickFrequency();
    //std::cout << "matching time [s]: " << t3 << std::endl;