SURF description faster with FAST detection?
Asked Answered
M

1

7

for my master thesis, i am running some test on the SIFT SURF en FAST algoritms for logo detection on smartphones.

when i simply time the detection, description en matching for some methods i get the following results.

For a SURF detector and SURF descriptor:

180 keypoints found

  • 1,994 seconds keypoint calculation time (SURF)

  • 4,516 seconds description time (SURF)

  • 0.282 seconds matching time (SURF)

when I use a FAST detector in stead of the SURF detector

319 keypoints found

  • 0.023 seconds keypoint calculation time (FAST)

  • 1.295 seconds description time (SURF)

  • 0.397 seconds matching time (SURF)

The FAST detector is much faster than the SURF detector, and even detects almost twice as many keypoints 100 times faster. These results are predictable.

The next step though is not a predicted result. How is it possible that de SURF descriptor is faster with the 319 FAST keypoints then with the 180 SURF keypoints?

From what I know, the description has no relation with the detection algorithm... yet these results are not as predicted.

does any one know how this is possible?

here is the code:

    FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
    //FeatureDetector detector = FeatureDetector.create(FeatureDetector.FAST);
    Imgproc.cvtColor(image1, image1, Imgproc.COLOR_RGBA2RGB);
    Imgproc.cvtColor(image2, image2, Imgproc.COLOR_RGBA2RGB);

    DescriptorExtractor SurfExtractor = DescriptorExtractor
    .create(DescriptorExtractor.SURF);


    //extract keypoints
    long time= System.currentTimeMillis();
    detector.detect(image1, keypoints);
    Log.d("LOG!", "number of query Keypoints= " + keypoints.size());
    detector.detect(image2, logoKeypoints);
    Log.d("LOG!", "number of logo Keypoints= " + logoKeypoints.size());
    Log.d("LOG!", "keypoint calculation time elapsed" + (System.currentTimeMillis() -time));

    //Descript keypoints
    long time2 = System.currentTimeMillis();
    Mat descriptors = new Mat();
    Mat logoDescriptors = new Mat();
    Log.d("LOG!", "logo type" + image2.type() + "  intype" + image1.type());
    SurfExtractor.compute(image1, keypoints, descriptors);
    SurfExtractor.compute(image2, logoKeypoints, logoDescriptors);
    Log.d("LOG!", "Description time elapsed" + (System.currentTimeMillis()- time2));
Muster answered 21/5, 2012 at 19:40 Comment(2)
could you please post some of your code? :)Ahn
some of my code is added to the question!Muster
P
7

AFAIK the most time consuming part of SURF descriptor extraction is subpixel extraction of patch having (2.8*keypoint.size x 2.8*keypoint.size) size around the every keypoint.

So here is my guess: keypoints found by FAST detector always have their size equal to 7 but SURF detector can find keypoints of much bigger size. So 180 "big" keypoints are processed longer than 319 "small".

Polyvinyl answered 21/5, 2012 at 20:40 Comment(1)
I have worked out the SIFT descriptor but didn't fully describe the SURF descriptor in my thesis, maybe if I did, I would have known this. Your explanation seems very reasonable and I think this may be the right answer to my question! thanks!Muster

© 2022 - 2024 — McMap. All rights reserved.