I just discovered that SIFT writes the Octave as packed value (octave, layer and scale).
I need this value unpacked since I have to use SIFT detector in combination with other descriptors (ORB, BRIEF, SURF, BRISK). Here you can find a similar question.
I already tried different solutions (see code below) but none seems to work in python (this one as well).
Any suggestion?
unpackOctave(keypoints[i], octave, layer, scale)
or:
unpackOctave(const KeyPoint& kpt, int& octave, int& layer, float& scale){
octave = kpt.octave & 255;
layer = (kpt.octave >> 8) & 255;
octave = octave < 128 ? octave : (-128 | octave);
scale = octave >= 0 ? 1.f/(1 << octave) : (float)(1 << -octave);
}