3

I am experimenting with different types of OpenCV's FAST detector.

Available types are:

TYPE_5_8, 
TYPE_7_12, 
TYPE_9_16

The last one is the default and is described by this photo:

enter image description here

I assume TYPE_7_12 means the following:

enter image description here

And the TYPE_5_8 means this:

enter image description here

Now, I run the FAST detector with threshold 30 and TYPE_5_8 and the following image section does not produce a single keypoint:

enter image description here

Based on documentation saying:

Now the pixel p is a corner if there exists a set of n contiguous pixels in the circle (of 16 pixels) which are all brighter than I_p + t, or all darker than I_p − t

, I expected that the central pixel (the one with the value 203) will be detected as a keypoint. There are clearly 5 contiguous pixels with intensities lower than 203 - 30.

Yet nothing is detected. Why?

AndroC
  • 4,758
  • 2
  • 46
  • 69

1 Answers1

0

the central pixel will be detected as a keypoint when 8 contiguous pixels is lower/upper. you can read the source code as below,0-8、2-10 mean 0-0、2-2 for type_5_8

int d = tab[ptr[pixel[0]]] | tab[ptr[pixel[8]]];
if( d == 0 )
    continue;
d &= tab[ptr[pixel[2]]] | tab[ptr[pixel[10]]];
d &= tab[ptr[pixel[4]]] | tab[ptr[pixel[12]]];
d &= tab[ptr[pixel[6]]] | tab[ptr[pixel[14]]];

if( d == 0 )
   continue;
d &= tab[ptr[pixel[1]]] | tab[ptr[pixel[9]]];
d &= tab[ptr[pixel[3]]] | tab[ptr[pixel[11]]];
d &= tab[ptr[pixel[5]]] | tab[ptr[pixel[13]]];
d &= tab[ptr[pixel[7]]] | tab[ptr[pixel[15]]];
jojo
  • 1
  • Does any documentation explicitly state that it is always 8 contiguous pixels, regardless of the pattern size? If not, I feel that the documentation should either be updated or this should be considered a bug. I noticed this problem as well in my own experimentation with the 5_8 and the 7_12 patterns. It is rejecting corners would have otherwise passed if not for the shortcut taken. – HesNotTheStig Nov 05 '21 at 18:15