Ask Your Question

Revision history [back]

It is not a bug, it's a feature. :) The reason why keypoint.octave has a weird value is because it carries the information on:

  • the actual octave in the least significant byte of the keypoint.octave field
  • the layer of that octave in the second least significant byte of the keypoint.octave field
  • something else that gets packed into the third least significant byte by the SIFT keypoint detection, but doesn't get used by the SIFT descriptor

keypoint.octave gets unpacked into the variables octave, layer, and scale (scale is just 1/2^octave) with the method unpackOctave (see OpenCV implementation).

To get a visual understanding of variables octave and layer, this image might help:

image description

(I've explained this in an answer on Stack Overflow.)