Sayan Barrie Mccullum
Sayan Barrie Mccullum

Reputation: 125

Algorithm behind score calculation in FAST corner detector

How is the score for a detected corner is calculated in the FAST corner detector? I read the original paper "Machine Learning for High Speed Corner detection" but in the score calculation portion nothing is explicitly mentioned as to which N contiguous pixels they are referring at. Is it the N contiguous pixels that satisfy the corner criteria for that point? I also found the below link

https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/AV1011/AV1FeaturefromAcceleratedSegmentTest.pdf that speaks of the FAST corner score computation . Also, I am not finding any correspondence between the score function described in this paper and the score calculation done by OPENCV for the bresenham circle of radius 3.

https://github.com/opencv/opencv/blob/master/modules/features2d/src/fast_score.cpp

The score has been calculated in the cornerScore<16> function in the above link. Besides these things, no other article explicitly talks about the FAST score calculation in Fast feature Detector. Can anyone kindly give me any insight on this?

N.B -I have also looked at the second paper "Faster and Better:A machine learning approach to corner detection" but it has no explicit mention about the score calculation.

Upvotes: 6

Views: 851

Answers (1)

VictorBian
VictorBian

Reputation: 725

The docs online confused me too:

The score function is defined as: “The sum of the absolute difference between the pixels in the contiguous arc and the centre pixel”

I'm pretty sure OpenCV doesn't calculate score like that. If you patiently read the source code you mentioned, you will find that the function cornerScore<16> is doing this:

  1. Get 16 pixel values on the circle centered at the target pixel
  2. Take a set of 9 contiguous pixels from the 16, calculate the absolute differences between the 9 pixels and the center one, and take the minimum (from 9 abs-diffs) value (which is called a threshold)
  3. Take every pixel in the 16 as the beginning one of the step 2, and you will get 16 thresholds
  4. Return the maximum threshold as the corner score

From this pipeline, you can see that the score OpenCV calculates is the maximum threshold that makes the target pixel a FAST-corner.

Upvotes: 6

Related Questions